⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 os_net_device.h

📁 marvell wifi driver GSPI-8385-LINUX-OMAP1510-5.0.10.p0-144-src.rar
💻 H
字号:
/****************************************************************************** 
 *  Description:
 *      wlan network device structure and interface
 *
 *  The wlan drivers use a net_device structure to maintain context.
 *  This structure was defined in some linux header files, but since we're
 *  not on linux, we really don't need anything that complex, so we'll
 *  just create our own analogue structure here.
 *
 *  This structure will maintain the context for the drivers and will serve
 *  as the function pointer interface from the upper level protocols into
 *  the wlan component.
 *
 *****************************************************************************/

#ifndef _OS_NET_DEVICE_H
#define _OS_NET_DEVICE_H

struct sk_buff{
	struct sk_buff	*prev;
	struct sk_buff	*next;
	UINT32		len;
	UCHAR		*data;
	UCHAR		*tail;
	void 		*bufDesc;
};

#include	"os_defs.h"
#define ETH_HLEN	14
#define ENOTSUPP	523

#define	IFF_BROADCAST	0x2		/* broadcast address valid	*/
#define	IFF_PROMISC	0x100		/* receive all packets		*/
#define	IFF_ALLMULTI	0x200		/* receive all multicast packets*/
#define IFF_MULTICAST	0x1000		/* Supports multicast		*/
#define MAX_SSID_NAME_LEN 33 // 32 plus null
#define MAX_PASS_PHRASE 64

#ifndef ETH_ALEN
#define ETH_ALEN 6
#endif


typedef struct iw_point
{
    int *pointer;		
    u16 length;
    u16 flags;
}iw_point;

struct SCAN_SSID_IE{
	UINT8 SSID[33];
	u32 ssid_len;
	UINT8 BSSID[6];
	
	UINT16 Capability;
	UINT8	WPA_IE[40];
	int	wpa_ie_len;
};

typedef struct {
    UINT8 SSID[MAX_SSID_NAME_LEN];
    int Encryption;
    UINT8 PassPhrase[MAX_PASS_PHRASE];
    int WPA_ON;
}wpaSupConfig;



typedef struct net_device
{
    VOID* priv;
    UINT32 flags;

    u8 dev_addr[ETH_ALEN];

    int mc_count;	//required for set_multicast function
    u8 *list[6];

    // WLAN interface functions
    int (*open)(struct net_device *dev);
    int (*stop)(struct net_device *dev);
    struct net_device_stats* (*get_stats)(struct net_device *dev);
    int (*hard_start_xmit)(struct sk_buff *skb, struct net_device *dev);
    int (*do_ioctl)(struct net_device *dev, struct ifreq *ifr, int cmd);

    int (*set_mac_address)(struct net_device *dev, void *addr);
    void (*set_multicast_list)(struct net_device *dev);
}net_device;

#endif  // _OS_NET_DEVICE_H

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -