This source file includes following definitions.
- wi_usb_usbin
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31 #define WI_USB_CONFIG_NO 1
32
33 #define WI_USB_ENDPT_TX 1
34 #define WI_USB_ENDPT_RX 2
35 #define WI_USB_ENDPT_INTR 3
36 #define WI_USB_ENDPT_MAX 4
37
38 #define WI_USB_IFACE_IDX 0
39
40
41
42 #define WI_USB_DATA_MAXLEN WI_DEFAULT_DATALEN
43 #define WI_USB_BUFSZ 2368
44 #define WI_USB_INTR_INTERVAL 100
45
46 struct wi_usb_softc;
47
48 struct wi_usb_chain {
49 struct wi_usb_softc *wi_usb_sc;
50 struct usbd_xfer *wi_usb_xfer;
51 void *wi_usb_buf;
52 struct mbuf *wi_usb_mbuf;
53 int wi_usb_idx;
54 };
55 #define WI_USB_TX_LIST_CNT 1
56 #define WI_USB_RX_LIST_CNT 1
57
58 struct wi_rridreq {
59 u_int16_t type;
60 u_int16_t frmlen;
61 u_int16_t rid;
62 u_int8_t pad[58];
63 };
64 struct wi_rridresp {
65 u_int16_t type;
66 u_int16_t frmlen;
67 u_int16_t rid;
68 u_int8_t data[1658];
69
70 };
71 struct wi_wridreq {
72 u_int16_t type;
73 u_int16_t frmlen;
74 u_int16_t rid;
75 u_int8_t data[2048];
76 };
77 struct wi_wridresp {
78 u_int16_t type;
79 u_int16_t status;
80 u_int16_t resp0;
81 u_int16_t resp1;
82 u_int16_t resp2;
83 };
84 struct wi_info {
85 u_int16_t type;
86 u_int16_t info;
87 };
88
89
90 #define WI_USB_CMD_INIT 0x0
91 #define WI_USB_CMD_ENABLE 0x1
92 #define WI_USB_CMD_DISABLE 0x2
93 #define WI_USB_CMD_DIAG 0x3
94
95 struct wi_cmdreq {
96 u_int16_t type;
97 u_int16_t cmd;
98 u_int16_t param0;
99 u_int16_t param1;
100 u_int16_t param2;
101 u_int8_t pad[54];
102 };
103 struct wi_cmdresp {
104 u_int16_t type;
105 u_int16_t status;
106 u_int16_t resp0;
107 u_int16_t resp1;
108 u_int16_t resp2;
109 };
110
111 typedef union {
112 u_int16_t type;
113 struct wi_rridreq rridreq;
114 struct wi_rridresp rridresp;
115 struct wi_cmdreq cmdreq;
116 struct wi_cmdresp cmdresp;
117 } wi_usb_usbin;
118 #define WI_USB_INTR_PKTLEN 8
119
120 #define WI_USB_TX_TIMEOUT 10000
121
122
123
124 #define WI_USB_TXFRM 0
125 #define WI_USB_CMDREQ 1
126 #define WI_USB_WRIDREQ 2
127 #define WI_USB_RRIDREQ 3
128 #define WI_USB_WMEMREQ 4
129 #define WI_USB_RMEMREQ 5
130
131
132 #define WI_USB_ISTXFRM(a) (((a) & 0xf000) == 0x0000)
133 #define WI_USB_ISRXFRM(a) (((a) & 0xf000) == 0x2000)
134
135 #define WI_USB_INFOFRM 0x8000
136 #define WI_USB_CMDRESP 0x8001
137 #define WI_USB_WRIDRESP 0x8002
138 #define WI_USB_RRIDRESP 0x8003
139 #define WI_USB_WMEMRESP 0x8004
140 #define WI_USB_RMEMRESP 0x8005
141 #define WI_USB_BUFAVAIL 0x8006
142 #define WI_USB_ERROR 0x8007
143
144 #define WI_GET_IFP(sc) &(sc)->sc_wi.sc_ic.ic_if
145
146
147 int wi_cmd_usb(struct wi_softc *sc, int cmd, int val0, int val1, int val2);
148 int wi_read_record_usb(struct wi_softc *sc, struct wi_ltv_gen *ltv);
149 int wi_write_record_usb(struct wi_softc *sc, struct wi_ltv_gen *ltv);
150 int wi_read_data_usb(struct wi_softc *sc, int id, int off, caddr_t buf,
151 int len);
152 int wi_write_data_usb(struct wi_softc *sc, int id, int off, caddr_t buf,
153 int len);
154 int wi_alloc_nicmem_usb(struct wi_softc *sc, int len, int *id);
155 int wi_get_fid_usb(struct wi_softc *sc, int fid);
156 void wi_init_usb(struct wi_softc *sc);
157
158 void wi_start_usb(struct ifnet *ifp);
159 int wi_ioctl_usb(struct ifnet *, u_long, caddr_t);
160 void wi_inquire_usb(void *xsc);
161 void wi_watchdog_usb(struct ifnet *ifp);