diff options
author | Alban Browaeys <prahal@yahoo.com> | 2010-02-26 17:19:59 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-03-16 14:51:18 -0400 |
commit | 632dd959d13d7b96b8eeb2af77b4511053c04633 (patch) | |
tree | b036638499a8a5bb12901b4a54fa601631de177f /drivers/net/wireless/rt2x00 | |
parent | d6e36ec1d04edec73fedeea89ec8027e3d215dcb (diff) |
rt2x00: txdone implementation supporting hw encryption.
This is an implementation that support WCID being the encryption key.
Wireless Cli Id was set to be the encryption key in rt2800pci_write_tx_desc
and read (TX_STA_FIFO_WCID) as the current queue entry index.
Signed-off-by: Benoit Papillault <benoit.papillault@free.fr>
Signed-off-by: Alban Browaeys <prahal@yahoo.com>
Acked-by: Ivo van Doorn <ivdoorn@gmail.com>
Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/rt2x00')
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2800pci.c | 57 |
1 files changed, 25 insertions, 32 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2800pci.c b/drivers/net/wireless/rt2x00/rt2800pci.c index 549a60ab3b64..2f42e01eb99d 100644 --- a/drivers/net/wireless/rt2x00/rt2800pci.c +++ b/drivers/net/wireless/rt2x00/rt2800pci.c | |||
@@ -907,14 +907,12 @@ static void rt2800pci_txdone(struct rt2x00_dev *rt2x00dev) | |||
907 | { | 907 | { |
908 | struct data_queue *queue; | 908 | struct data_queue *queue; |
909 | struct queue_entry *entry; | 909 | struct queue_entry *entry; |
910 | struct queue_entry *entry_done; | 910 | __le32 *txwi; |
911 | struct queue_entry_priv_pci *entry_priv; | ||
912 | struct txdone_entry_desc txdesc; | 911 | struct txdone_entry_desc txdesc; |
913 | u32 word; | 912 | u32 word; |
914 | u32 reg; | 913 | u32 reg; |
915 | u32 old_reg; | 914 | u32 old_reg; |
916 | unsigned int type; | 915 | int wcid, ack, pid, tx_wcid, tx_ack, tx_pid; |
917 | unsigned int index; | ||
918 | u16 mcs, real_mcs; | 916 | u16 mcs, real_mcs; |
919 | 917 | ||
920 | /* | 918 | /* |
@@ -936,47 +934,41 @@ static void rt2800pci_txdone(struct rt2x00_dev *rt2x00dev) | |||
936 | break; | 934 | break; |
937 | old_reg = reg; | 935 | old_reg = reg; |
938 | 936 | ||
937 | wcid = rt2x00_get_field32(reg, TX_STA_FIFO_WCID); | ||
938 | ack = rt2x00_get_field32(reg, TX_STA_FIFO_TX_ACK_REQUIRED); | ||
939 | pid = rt2x00_get_field32(reg, TX_STA_FIFO_PID_TYPE); | ||
940 | |||
939 | /* | 941 | /* |
940 | * Skip this entry when it contains an invalid | 942 | * Skip this entry when it contains an invalid |
941 | * queue identication number. | 943 | * queue identication number. |
942 | */ | 944 | */ |
943 | type = rt2x00_get_field32(reg, TX_STA_FIFO_PID_TYPE) - 1; | 945 | if (pid <= 0 || pid > QID_RX) |
944 | if (type >= QID_RX) | ||
945 | continue; | 946 | continue; |
946 | 947 | ||
947 | queue = rt2x00queue_get_queue(rt2x00dev, type); | 948 | queue = rt2x00queue_get_queue(rt2x00dev, pid - 1); |
948 | if (unlikely(!queue)) | 949 | if (unlikely(!queue)) |
949 | continue; | 950 | continue; |
950 | 951 | ||
951 | /* | 952 | /* |
952 | * Skip this entry when it contains an invalid | 953 | * Inside each queue, we process each entry in a chronological |
953 | * index number. | 954 | * order. We first check that the queue is not empty. |
954 | */ | 955 | */ |
955 | index = rt2x00_get_field32(reg, TX_STA_FIFO_WCID) - 1; | 956 | if (rt2x00queue_empty(queue)) |
956 | if (unlikely(index >= queue->limit)) | ||
957 | continue; | 957 | continue; |
958 | entry = rt2x00queue_get_entry(queue, Q_INDEX_DONE); | ||
958 | 959 | ||
959 | entry = &queue->entries[index]; | 960 | /* Check if we got a match by looking at WCID/ACK/PID |
960 | entry_priv = entry->priv_data; | 961 | * fields */ |
961 | rt2x00_desc_read((__le32 *)entry->skb->data, 0, &word); | 962 | txwi = (__le32 *)(entry->skb->data - |
962 | 963 | rt2x00dev->ops->extra_tx_headroom); | |
963 | entry_done = rt2x00queue_get_entry(queue, Q_INDEX_DONE); | 964 | |
964 | while (entry != entry_done) { | 965 | rt2x00_desc_read(txwi, 1, &word); |
965 | /* | 966 | tx_wcid = rt2x00_get_field32(word, TXWI_W1_WIRELESS_CLI_ID); |
966 | * Catch up. | 967 | tx_ack = rt2x00_get_field32(word, TXWI_W1_ACK); |
967 | * Just report any entries we missed as failed. | 968 | tx_pid = rt2x00_get_field32(word, TXWI_W1_PACKETID); |
968 | */ | 969 | |
969 | WARNING(rt2x00dev, | 970 | if ((wcid != tx_wcid) || (ack != tx_ack) || (pid != tx_pid)) |
970 | "TX status report missed for entry %d\n", | 971 | WARNING(rt2x00dev, "invalid TX_STA_FIFO content\n"); |
971 | entry_done->entry_idx); | ||
972 | |||
973 | txdesc.flags = 0; | ||
974 | __set_bit(TXDONE_UNKNOWN, &txdesc.flags); | ||
975 | txdesc.retry = 0; | ||
976 | |||
977 | rt2x00lib_txdone(entry_done, &txdesc); | ||
978 | entry_done = rt2x00queue_get_entry(queue, Q_INDEX_DONE); | ||
979 | } | ||
980 | 972 | ||
981 | /* | 973 | /* |
982 | * Obtain the status about this packet. | 974 | * Obtain the status about this packet. |
@@ -997,6 +989,7 @@ static void rt2800pci_txdone(struct rt2x00_dev *rt2x00dev) | |||
997 | * we have mcs = tx_mcs - 1. So the number of | 989 | * we have mcs = tx_mcs - 1. So the number of |
998 | * retry is (tx_mcs - mcs). | 990 | * retry is (tx_mcs - mcs). |
999 | */ | 991 | */ |
992 | rt2x00_desc_read(txwi, 0, &word); | ||
1000 | mcs = rt2x00_get_field32(word, TXWI_W0_MCS); | 993 | mcs = rt2x00_get_field32(word, TXWI_W0_MCS); |
1001 | real_mcs = rt2x00_get_field32(reg, TX_STA_FIFO_MCS); | 994 | real_mcs = rt2x00_get_field32(reg, TX_STA_FIFO_MCS); |
1002 | __set_bit(TXDONE_FALLBACK, &txdesc.flags); | 995 | __set_bit(TXDONE_FALLBACK, &txdesc.flags); |