?? rndisdev.h
字號:
#ifndef _usb_rndis_dev_h
#define _usb_rndis_dev_h
#include "rndis.h"
#include "usb_ch9.h"
#include "dsp_tcpip.h"
#include "usbdefs.h"
#include "loopbuff.h"
#define USB_TSK_PRI 2
#define ETH_ALEN 6 /* Octets in one ethernet addr */
#define ETH_HLEN 14 /* Total octets in header. */
#define USB_RNDIS_MTU 1600 //mtu
enum ep_status
{
EP_STATUS_STALL = 0,
EP_STATUS_IDLE, /*no operation on endpoint*/
EP_STATUS_IN, /*data is writing by slave*/
EP_STATUS_OUT /*data is being reading by slave*/
};
struct control_trans
{
struct usb_ctrlrequest DeviceRequest;
u8 dataBuffer[MAX_SETUP_BUFFER_SIZE];
u16 dataLength;
u16 transmitLength;
};
struct generic_trans
{
u8 dataBuffer[MAX_PACKET_BUFFER_SIZE];
u16 dataLength;
u16 transmitLength;
};
/*bulk and endpoint*/
struct usb_ep_general
{
enum ep_status status;
struct generic_trans * trans;
u8 index;
};
struct usb_ep_control
{
enum ep_status status;
struct control_trans * trans;
u8 index;
};
struct net_device_stats1
{
unsigned long rx_packets; /* total packets received */
unsigned long tx_packets; /* total packets transmitted */
unsigned long rx_bytes; /* total bytes received */
unsigned long tx_bytes; /* total bytes transmitted */
unsigned long rx_errors; /* bad packets received */
unsigned long tx_errors; /* packet transmit problems */
unsigned long rx_dropped; /* no space in linux buffers */
unsigned long tx_dropped; /* no space available in linux */
unsigned long rx_frame_errors; /* recv'd frame alignment error */
};
struct rndis_dev{
enum usb_device_state usbstate;
struct usb_ep_general in_ep, out_ep, status_ep;
struct usb_ep_control ctrl_ep;
u16 config;
struct LoopBuffCtl tx_queue;
usb_lock_t lock;
struct ei_device * net;
struct net_device_stats1 stats;
u16 cdc_filter;
u8 mac[6]; //host side mac address
u16 mtu;
};
#endif
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -