]> err.no Git - linux-2.6/blobdiff - drivers/net/wireless/rt2x00/rt2x00usb.h
rt2x00: Merge RX and TX entry private data
[linux-2.6] / drivers / net / wireless / rt2x00 / rt2x00usb.h
index 11e55180cbaf61c95eaa6138bba8fae42fa695e6..15b404aa714da8ceb9863f475fbc41140d65c19b 100644 (file)
 #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,13 +199,12 @@ 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));
 }
 
 /*
@@ -207,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.
  *