rt2x00: wireless CLI ID and packet ID must not be 0
[pandora-kernel.git] / drivers / net / wireless / rt2x00 / rt2800usb.c
index 9efb417..3633e58 100644 (file)
@@ -518,7 +518,7 @@ static void rt2800usb_config_filter(struct rt2x00_dev *rt2x00dev,
        rt2x00_set_field32(&reg, RX_FILTER_CFG_DROP_RTS,
                           !(filter_flags & FIF_CONTROL));
        rt2x00_set_field32(&reg, RX_FILTER_CFG_DROP_PSPOLL,
-                          !(filter_flags & FIF_CONTROL));
+                          !(filter_flags & FIF_PSPOLL));
        rt2x00_set_field32(&reg, RX_FILTER_CFG_DROP_BA, 1);
        rt2x00_set_field32(&reg, RX_FILTER_CFG_DROP_BAR, 0);
        rt2x00_set_field32(&reg, RX_FILTER_CFG_DROP_CNTL,
@@ -1463,6 +1463,10 @@ static int rt2800usb_init_registers(struct rt2x00_dev *rt2x00dev)
        /*
         * ASIC will keep garbage value after boot, clear encryption keys.
         */
+       for (i = 0; i < 4; i++)
+               rt2x00usb_register_write(rt2x00dev,
+                                        SHARED_KEY_MODE_ENTRY(i), 0);
+
        for (i = 0; i < 256; i++) {
                u32 wcid[2] = { 0xffffffff, 0x00ffffff };
                rt2x00usb_register_multiwrite(rt2x00dev, MAC_WCID_ENTRY(i),
@@ -1472,10 +1476,6 @@ static int rt2800usb_init_registers(struct rt2x00_dev *rt2x00dev)
                rt2x00usb_register_write(rt2x00dev, MAC_IVEIV_ENTRY(i), 0);
        }
 
-       for (i = 0; i < 16; i++)
-               rt2x00usb_register_write(rt2x00dev,
-                                        SHARED_KEY_MODE_ENTRY(i), 0);
-
        /*
         * Clear all beacons
         * For the Beacon base registers we only need to clear
@@ -1995,11 +1995,11 @@ static void rt2800usb_write_tx_desc(struct rt2x00_dev *rt2x00dev,
        rt2x00_set_field32(&word, TXWI_W1_BW_WIN_SIZE, txdesc->ba_size);
        rt2x00_set_field32(&word, TXWI_W1_WIRELESS_CLI_ID,
                           test_bit(ENTRY_TXD_ENCRYPT, &txdesc->flags) ?
-                              txdesc->key_idx : 0xff);
+                              (skbdesc->entry->entry_idx + 1) : 0xff);
        rt2x00_set_field32(&word, TXWI_W1_MPDU_TOTAL_BYTE_COUNT,
                           skb->len - txdesc->l2pad);
        rt2x00_set_field32(&word, TXWI_W1_PACKETID,
-                          skbdesc->entry->entry_idx);
+                          skbdesc->entry->queue->qid + 1);
        rt2x00_desc_write(txwi, 1, word);
 
        /*
@@ -2050,8 +2050,6 @@ static void rt2800usb_write_beacon(struct queue_entry *entry)
         * otherwise we might be sending out invalid data.
         */
        rt2x00usb_register_read(rt2x00dev, BCN_TIME_CFG, &reg);
-       rt2x00_set_field32(&reg, BCN_TIME_CFG_TSF_TICKING, 0);
-       rt2x00_set_field32(&reg, BCN_TIME_CFG_TBTT_ENABLE, 0);
        rt2x00_set_field32(&reg, BCN_TIME_CFG_BEACON_GEN, 0);
        rt2x00usb_register_write(rt2x00dev, BCN_TIME_CFG, reg);
 
@@ -2165,8 +2163,10 @@ static void rt2800usb_fill_rxdone(struct queue_entry *entry,
        if (rt2x00_get_field32(rxd0, RXD_W0_MY_BSS))
                rxdesc->dev_flags |= RXDONE_MY_BSS;
 
-       if (rt2x00_get_field32(rxd0, RXD_W0_L2PAD))
+       if (rt2x00_get_field32(rxd0, RXD_W0_L2PAD)) {
                rxdesc->dev_flags |= RXDONE_L2PAD;
+               skbdesc->flags |= SKBDESC_L2_PADDED;
+       }
 
        if (rt2x00_get_field32(rxwi1, RXWI_W1_SHORT_GI))
                rxdesc->flags |= RX_FLAG_SHORT_GI;
@@ -2623,6 +2623,13 @@ static int rt2800usb_probe_hw(struct rt2x00_dev *rt2x00dev)
        if (retval)
                return retval;
 
+       /*
+        * This device has multiple filters for control frames
+        * and has a separate filter for PS Poll frames.
+        */
+       __set_bit(DRIVER_SUPPORT_CONTROL_FILTERS, &rt2x00dev->flags);
+       __set_bit(DRIVER_SUPPORT_CONTROL_FILTER_PSPOLL, &rt2x00dev->flags);
+
        /*
         * This device requires firmware.
         */