2 Copyright (C) 2004 - 2007 rt2x00 SourceForge Project
3 <http://rt2x00.serialmonkey.com>
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the
17 Free Software Foundation, Inc.,
18 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23 Abstract: Data structures for the rt2x00usb module.
24 Supported chipsets: rt2570, rt2571W & rt2671.
31 * This variable should be used with the
32 * usb_driver structure initialization.
34 #define USB_DEVICE_DATA(__ops) .driver_info = (kernel_ulong_t)(__ops)
38 * When register access attempts should be repeated
39 * only REGISTER_BUSY_COUNT attempts with a delay
40 * of REGISTER_BUSY_DELAY us should be taken.
41 * For USB vendor requests we need to pass a timeout
42 * time in ms, for this we use the REGISTER_TIMEOUT,
43 * however when loading firmware a higher value is
44 * required. For that we use the REGISTER_TIMEOUT_FIRMWARE.
46 #define REGISTER_BUSY_COUNT 5
47 #define REGISTER_BUSY_DELAY 100
48 #define REGISTER_TIMEOUT 20
49 #define REGISTER_TIMEOUT_FIRMWARE 1000
54 #define USB_VENDOR_REQUEST ( USB_TYPE_VENDOR | USB_RECIP_DEVICE )
55 #define USB_VENDOR_REQUEST_IN ( USB_DIR_IN | USB_VENDOR_REQUEST )
56 #define USB_VENDOR_REQUEST_OUT ( USB_DIR_OUT | USB_VENDOR_REQUEST )
59 * USB vendor commands.
61 #define USB_DEVICE_MODE 0x01
62 #define USB_SINGLE_WRITE 0x02
63 #define USB_SINGLE_READ 0x03
64 #define USB_MULTI_WRITE 0x06
65 #define USB_MULTI_READ 0x07
66 #define USB_EEPROM_WRITE 0x08
67 #define USB_EEPROM_READ 0x09
68 #define USB_LED_CONTROL 0x0a /* RT73USB */
69 #define USB_RX_CONTROL 0x0c
74 #define USB_MODE_RESET 0x01
75 #define USB_MODE_UNPLUG 0x02
76 #define USB_MODE_FUNCTION 0x03
77 #define USB_MODE_TEST 0x04
78 #define USB_MODE_SLEEP 0x07 /* RT73USB */
79 #define USB_MODE_FIRMWARE 0x08 /* RT73USB */
80 #define USB_MODE_WAKEUP 0x09 /* RT73USB */
83 * USB devices need an additional Beacon (guardian beacon) to be generated.
86 #define BEACON_ENTRIES 2
89 * Interfacing with the HW.
91 int rt2x00usb_vendor_request(const struct rt2x00_dev
*rt2x00dev
,
92 const u8 request
, const u8 type
, const u16 offset
,
93 u32 value
, void *buffer
, const u16 buffer_length
, const u16 timeout
);
98 void rt2x00usb_enable_radio(struct rt2x00_dev
*rt2x00dev
);
99 void rt2x00usb_disable_radio(struct rt2x00_dev
*rt2x00dev
);
104 int rt2x00usb_beacon_update(struct ieee80211_hw
*hw
, struct sk_buff
*skb
,
105 struct ieee80211_tx_control
*control
);
106 void rt2x00usb_beacondone(struct urb
*urb
);
111 int rt2x00usb_write_tx_data(struct rt2x00_dev
*rt2x00dev
,
112 struct data_ring
*ring
, struct sk_buff
*skb
,
113 struct ieee80211_tx_control
*control
);
116 * Device initialization handlers.
118 int rt2x00usb_initialize(struct rt2x00_dev
*rt2x00dev
);
119 void rt2x00usb_uninitialize(struct rt2x00_dev
*rt2x00dev
);
122 * USB driver handlers.
124 int rt2x00usb_probe(struct usb_interface
*usb_intf
,
125 const struct usb_device_id
*id
);
126 void rt2x00usb_disconnect(struct usb_interface
*usb_intf
);
128 int rt2x00usb_suspend(struct usb_interface
*usb_intf
, pm_message_t state
);
129 int rt2x00usb_resume(struct usb_interface
*usb_intf
);
130 #endif /* CONFIG_PM */
132 #endif /* RT2X00USB_H */
This page took 0.047075 seconds and 5 git commands to generate.