Wiznet W5300 Porting Manual page 14

Linux driver porting guide
Hide thumbs Also See for W5300:
Table of Contents

Advertisement

Also we should add PF_WIZNET to header file using by application.
Add PF_WIZNET to '/usr/include/bits/socket.h' file.
...
#define PF_RXRPC
#define PF_WIZNET 34
#define PF_MAX
...
#define AF_RXRPC
#define AF_WIZNET PF_WIZNET
#define AF_MAX
If we want use it without PF_WIZNET in the Linux kernel, we use disabled socket family as a
PF_WIZNET by redefinition. Basically default value redefines the PF_BLUETOOTH. We should
modify the driver code of 'wizsock.c' file when we want redefinition with other socket family.
/* If PF_WIZNET is not defined, PF_BLUETOOTH is re-defined as PF_WIZNET.
* In this case, PF_BLUETOOTH is not in use. */
#ifndef PF_WIZNET
#define PF_WIZNET PF_BLUETOOTH
#endif
A simple loopback example code by using H/W TCP/IP stack as follows
#include <stdio.h>
#include <sys/socket.h>
#include <arpa/inet.h>
unsigned char data_buf[4096];
#ifndef PF_WIZNET
#define PF_WIZNET PF_BLUETOOTH
#endif
int main(int argc, const char *argv[])
{
int sd, fd, addr_len, ret;
struct sockaddr_in sock_in;
Copyright © WIZnet All Rights Reserved
33
/* RxRPC sockets. */
35
/* For now.. */
PF_RXRPC
PF_MAX
W5300 Linux Driver Porting Guide | 14 page

Advertisement

Table of Contents
loading

Table of Contents