diff options
author | Vasanthakumar Thiagarajan <vasanth@atheros.com> | 2010-04-15 17:39:35 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-04-16 15:43:47 -0400 |
commit | eb8232535bbeaf51f7c4826265ad96bf966829f3 (patch) | |
tree | c1dce435fca304a95bd57f7f592cb04ef5776563 /drivers/net/wireless/ath/ath9k | |
parent | 5088c2f1a2475546d9a79b515bde6d65b8681e51 (diff) |
ath9k_hw: Compute pointer checksum over the link descriptor
Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath9k')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/ar9003_mac.c | 36 |
1 files changed, 21 insertions, 15 deletions
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_mac.c b/drivers/net/wireless/ath/ath9k/ar9003_mac.c index 1a8c1ba538b4..582c88050664 100644 --- a/drivers/net/wireless/ath/ath9k/ar9003_mac.c +++ b/drivers/net/wireless/ath/ath9k/ar9003_mac.c | |||
@@ -21,14 +21,33 @@ static void ar9003_hw_rx_enable(struct ath_hw *hw) | |||
21 | REG_WRITE(hw, AR_CR, 0); | 21 | REG_WRITE(hw, AR_CR, 0); |
22 | } | 22 | } |
23 | 23 | ||
24 | static u16 ar9003_calc_ptr_chksum(struct ar9003_txc *ads) | ||
25 | { | ||
26 | int checksum; | ||
27 | |||
28 | checksum = ads->info + ads->link | ||
29 | + ads->data0 + ads->ctl3 | ||
30 | + ads->data1 + ads->ctl5 | ||
31 | + ads->data2 + ads->ctl7 | ||
32 | + ads->data3 + ads->ctl9; | ||
33 | |||
34 | return ((checksum & 0xffff) + (checksum >> 16)) & AR_TxPtrChkSum; | ||
35 | } | ||
36 | |||
24 | static void ar9003_hw_set_desc_link(void *ds, u32 ds_link) | 37 | static void ar9003_hw_set_desc_link(void *ds, u32 ds_link) |
25 | { | 38 | { |
26 | ((struct ar9003_txc *) ds)->link = ds_link; | 39 | struct ar9003_txc *ads = ds; |
40 | |||
41 | ads->link = ds_link; | ||
42 | ads->ctl10 &= ~AR_TxPtrChkSum; | ||
43 | ads->ctl10 |= ar9003_calc_ptr_chksum(ads); | ||
27 | } | 44 | } |
28 | 45 | ||
29 | static void ar9003_hw_get_desc_link(void *ds, u32 **ds_link) | 46 | static void ar9003_hw_get_desc_link(void *ds, u32 **ds_link) |
30 | { | 47 | { |
31 | *ds_link = &((struct ar9003_txc *) ds)->link; | 48 | struct ar9003_txc *ads = ds; |
49 | |||
50 | *ds_link = &ads->link; | ||
32 | } | 51 | } |
33 | 52 | ||
34 | static bool ar9003_hw_get_isr(struct ath_hw *ah, enum ath9k_int *masked) | 53 | static bool ar9003_hw_get_isr(struct ath_hw *ah, enum ath9k_int *masked) |
@@ -168,19 +187,6 @@ static bool ar9003_hw_get_isr(struct ath_hw *ah, enum ath9k_int *masked) | |||
168 | return true; | 187 | return true; |
169 | } | 188 | } |
170 | 189 | ||
171 | static u16 ar9003_calc_ptr_chksum(struct ar9003_txc *ads) | ||
172 | { | ||
173 | int checksum; | ||
174 | |||
175 | checksum = ads->info + ads->link | ||
176 | + ads->data0 + ads->ctl3 | ||
177 | + ads->data1 + ads->ctl5 | ||
178 | + ads->data2 + ads->ctl7 | ||
179 | + ads->data3 + ads->ctl9; | ||
180 | |||
181 | return ((checksum & 0xffff) + (checksum >> 16)) & AR_TxPtrChkSum; | ||
182 | } | ||
183 | |||
184 | static void ar9003_hw_fill_txdesc(struct ath_hw *ah, void *ds, u32 seglen, | 190 | static void ar9003_hw_fill_txdesc(struct ath_hw *ah, void *ds, u32 seglen, |
185 | bool is_firstseg, bool is_lastseg, | 191 | bool is_firstseg, bool is_lastseg, |
186 | const void *ds0, dma_addr_t buf_addr, | 192 | const void *ds0, dma_addr_t buf_addr, |