X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fnet%2Fwireless%2Frt2x00%2Frt2x00usb.h;h=15b404aa714da8ceb9863f475fbc41140d65c19b;hb=b8be63ffa5dc44324e7f507997870fa3e4b17619;hp=275b089a2a4d969a910cc90b8dbb194388d69cf5;hpb=3b640f21af4b6b36b546fecbd3fe5109981360da;p=linux-2.6 diff --git a/drivers/net/wireless/rt2x00/rt2x00usb.h b/drivers/net/wireless/rt2x00/rt2x00usb.h index 275b089a2a..15b404aa71 100644 --- a/drivers/net/wireless/rt2x00/rt2x00usb.h +++ b/drivers/net/wireless/rt2x00/rt2x00usb.h @@ -47,6 +47,20 @@ #define REGISTER_TIMEOUT 500 #define REGISTER_TIMEOUT_FIRMWARE 1000 +/** + * REGISTER_TIMEOUT16 - Determine the timeout for 16bit register access + * @__datalen: Data length + */ +#define REGISTER_TIMEOUT16(__datalen) \ + ( REGISTER_TIMEOUT * ((__datalen) / sizeof(u16)) ) + +/** + * REGISTER_TIMEOUT32 - Determine the timeout for 32bit register access + * @__datalen: Data length + */ +#define REGISTER_TIMEOUT32(__datalen) \ + ( REGISTER_TIMEOUT * ((__datalen) / sizeof(u32)) ) + /* * Cache size */ @@ -185,33 +199,14 @@ static inline int rt2x00usb_vendor_request_sw(struct rt2x00_dev *rt2x00dev, * kmalloc for correct handling inside the kernel USB layer. */ static inline int rt2x00usb_eeprom_read(struct rt2x00_dev *rt2x00dev, - __le16 *eeprom, const u16 lenght) + __le16 *eeprom, const u16 length) { - int timeout = REGISTER_TIMEOUT * (lenght / sizeof(u16)); - return rt2x00usb_vendor_request(rt2x00dev, USB_EEPROM_READ, USB_VENDOR_REQUEST_IN, 0, 0, - eeprom, lenght, timeout); + eeprom, length, + REGISTER_TIMEOUT16(length)); } -/** - * rt2x00usb_vendor_request_async - Send register command to device (async) - * @rt2x00dev: Pointer to &struct rt2x00_dev - * @request: USB vendor command (See &enum rt2x00usb_vendor_request) - * @offset: Register offset to perform action on - * @value: Value to write to device - * - * Asynchroneous version of &rt2x00usb_vendor_request this is required - * for some routines where the driver cannot sleep because it is in - * irq context. Note that with this function the driver will not be - * notified on failure or timeout of the command. It will only be notified - * if the start of the command succeeded or not. This means it should not be - * used when the command must succeed. - */ -int rt2x00usb_vendor_request_async(struct rt2x00_dev *rt2x00dev, - const u8 request, const u16 offset, - const u16 value); - /* * Radio handlers */ @@ -225,30 +220,21 @@ int rt2x00usb_write_tx_data(struct rt2x00_dev *rt2x00dev, struct ieee80211_tx_control *control); /** - * struct queue_entry_priv_usb_rx: Per RX entry USB specific information - * - * @urb: Urb structure used for device communication. - */ -struct queue_entry_priv_usb_rx { - struct urb *urb; -}; - -/** - * struct queue_entry_priv_usb_tx: Per TX entry USB specific information + * struct queue_entry_priv_usb: Per entry USB specific information * * @urb: Urb structure used for device communication. * @control: mac80211 control structure used to transmit data. */ -struct queue_entry_priv_usb_tx { +struct queue_entry_priv_usb { struct urb *urb; struct ieee80211_tx_control control; }; /** - * struct queue_entry_priv_usb_tx: Per TX entry USB specific information + * struct queue_entry_priv_usb_bcn: Per TX entry USB specific information * - * The first section should match &struct queue_entry_priv_usb_tx exactly. + * The first section should match &struct queue_entry_priv_usb exactly. * rt2500usb can use this structure to send a guardian byte when working * with beacons. *