diff options
author | Bruno Randolf <bruno@thinktube.com> | 2008-03-05 04:35:45 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-03-07 16:07:49 -0500 |
commit | b47f407bef0d5349dacf65cd3560a976609d4b45 (patch) | |
tree | 894d65eb0d7eb0d0498de342044645f02df0edc7 /drivers/net/wireless/ath5k/hw.c | |
parent | 19fd6e5510f6991148e2210753b58f0eab95e0f6 (diff) |
ath5k: move rx and tx status structures out of hardware descriptor
move ath5k_tx_status and ath5k_rx_status structures out of the hardware
descriptor since they are not accessed by the hardware at all. they just
contain converted information from the hardware descriptor. since they are only
used in the rx and tx tasklets there is also no use to keep them for each
descriptor.
drivers/net/wireless/ath5k/ath5k.h: Changes-licensed-under: ISC
drivers/net/wireless/ath5k/base.c: Changes-licensed-under: 3-Clause-BSD
drivers/net/wireless/ath5k/debug.c: Changes-licensed-under: GPL
drivers/net/wireless/ath5k/debug.h: Changes-licensed-under: GPL
drivers/net/wireless/ath5k/hw.c: Changes-licensed-under: ISC
Signed-off-by: Bruno Randolf <bruno@thinktube.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath5k/hw.c')
-rw-r--r-- | drivers/net/wireless/ath5k/hw.c | 141 |
1 files changed, 72 insertions, 69 deletions
diff --git a/drivers/net/wireless/ath5k/hw.c b/drivers/net/wireless/ath5k/hw.c index f88adf52a1b2..a4e312d4226e 100644 --- a/drivers/net/wireless/ath5k/hw.c +++ b/drivers/net/wireless/ath5k/hw.c | |||
@@ -48,14 +48,18 @@ static int ath5k_hw_setup_4word_tx_desc(struct ath5k_hw *, struct ath5k_desc *, | |||
48 | static int ath5k_hw_setup_xr_tx_desc(struct ath5k_hw *, struct ath5k_desc *, | 48 | static int ath5k_hw_setup_xr_tx_desc(struct ath5k_hw *, struct ath5k_desc *, |
49 | unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, | 49 | unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, |
50 | unsigned int); | 50 | unsigned int); |
51 | static int ath5k_hw_proc_4word_tx_status(struct ath5k_hw *, struct ath5k_desc *); | 51 | static int ath5k_hw_proc_4word_tx_status(struct ath5k_hw *, struct ath5k_desc *, |
52 | struct ath5k_tx_status *); | ||
52 | static int ath5k_hw_setup_2word_tx_desc(struct ath5k_hw *, struct ath5k_desc *, | 53 | static int ath5k_hw_setup_2word_tx_desc(struct ath5k_hw *, struct ath5k_desc *, |
53 | unsigned int, unsigned int, enum ath5k_pkt_type, unsigned int, | 54 | unsigned int, unsigned int, enum ath5k_pkt_type, unsigned int, |
54 | unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, | 55 | unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, |
55 | unsigned int, unsigned int); | 56 | unsigned int, unsigned int); |
56 | static int ath5k_hw_proc_2word_tx_status(struct ath5k_hw *, struct ath5k_desc *); | 57 | static int ath5k_hw_proc_2word_tx_status(struct ath5k_hw *, struct ath5k_desc *, |
57 | static int ath5k_hw_proc_5212_rx_status(struct ath5k_hw *, struct ath5k_desc *); | 58 | struct ath5k_tx_status *); |
58 | static int ath5k_hw_proc_5210_rx_status(struct ath5k_hw *, struct ath5k_desc *); | 59 | static int ath5k_hw_proc_5212_rx_status(struct ath5k_hw *, struct ath5k_desc *, |
60 | struct ath5k_rx_status *); | ||
61 | static int ath5k_hw_proc_5210_rx_status(struct ath5k_hw *, struct ath5k_desc *, | ||
62 | struct ath5k_rx_status *); | ||
59 | static int ath5k_hw_get_capabilities(struct ath5k_hw *); | 63 | static int ath5k_hw_get_capabilities(struct ath5k_hw *); |
60 | 64 | ||
61 | static int ath5k_eeprom_init(struct ath5k_hw *); | 65 | static int ath5k_eeprom_init(struct ath5k_hw *); |
@@ -3798,7 +3802,7 @@ ath5k_hw_setup_xr_tx_desc(struct ath5k_hw *ah, struct ath5k_desc *desc, | |||
3798 | * Proccess the tx status descriptor on 5210/5211 | 3802 | * Proccess the tx status descriptor on 5210/5211 |
3799 | */ | 3803 | */ |
3800 | static int ath5k_hw_proc_2word_tx_status(struct ath5k_hw *ah, | 3804 | static int ath5k_hw_proc_2word_tx_status(struct ath5k_hw *ah, |
3801 | struct ath5k_desc *desc) | 3805 | struct ath5k_desc *desc, struct ath5k_tx_status *ts) |
3802 | { | 3806 | { |
3803 | struct ath5k_hw_2w_tx_ctl *tx_ctl; | 3807 | struct ath5k_hw_2w_tx_ctl *tx_ctl; |
3804 | struct ath5k_hw_tx_status *tx_status; | 3808 | struct ath5k_hw_tx_status *tx_status; |
@@ -3815,32 +3819,32 @@ static int ath5k_hw_proc_2word_tx_status(struct ath5k_hw *ah, | |||
3815 | /* | 3819 | /* |
3816 | * Get descriptor status | 3820 | * Get descriptor status |
3817 | */ | 3821 | */ |
3818 | desc->ds_us.tx.ts_tstamp = AR5K_REG_MS(tx_status->tx_status_0, | 3822 | ts->ts_tstamp = AR5K_REG_MS(tx_status->tx_status_0, |
3819 | AR5K_DESC_TX_STATUS0_SEND_TIMESTAMP); | 3823 | AR5K_DESC_TX_STATUS0_SEND_TIMESTAMP); |
3820 | desc->ds_us.tx.ts_shortretry = AR5K_REG_MS(tx_status->tx_status_0, | 3824 | ts->ts_shortretry = AR5K_REG_MS(tx_status->tx_status_0, |
3821 | AR5K_DESC_TX_STATUS0_SHORT_RETRY_COUNT); | 3825 | AR5K_DESC_TX_STATUS0_SHORT_RETRY_COUNT); |
3822 | desc->ds_us.tx.ts_longretry = AR5K_REG_MS(tx_status->tx_status_0, | 3826 | ts->ts_longretry = AR5K_REG_MS(tx_status->tx_status_0, |
3823 | AR5K_DESC_TX_STATUS0_LONG_RETRY_COUNT); | 3827 | AR5K_DESC_TX_STATUS0_LONG_RETRY_COUNT); |
3824 | /*TODO: desc->ds_us.tx.ts_virtcol + test*/ | 3828 | /*TODO: ts->ts_virtcol + test*/ |
3825 | desc->ds_us.tx.ts_seqnum = AR5K_REG_MS(tx_status->tx_status_1, | 3829 | ts->ts_seqnum = AR5K_REG_MS(tx_status->tx_status_1, |
3826 | AR5K_DESC_TX_STATUS1_SEQ_NUM); | 3830 | AR5K_DESC_TX_STATUS1_SEQ_NUM); |
3827 | desc->ds_us.tx.ts_rssi = AR5K_REG_MS(tx_status->tx_status_1, | 3831 | ts->ts_rssi = AR5K_REG_MS(tx_status->tx_status_1, |
3828 | AR5K_DESC_TX_STATUS1_ACK_SIG_STRENGTH); | 3832 | AR5K_DESC_TX_STATUS1_ACK_SIG_STRENGTH); |
3829 | desc->ds_us.tx.ts_antenna = 1; | 3833 | ts->ts_antenna = 1; |
3830 | desc->ds_us.tx.ts_status = 0; | 3834 | ts->ts_status = 0; |
3831 | desc->ds_us.tx.ts_rate = AR5K_REG_MS(tx_ctl->tx_control_0, | 3835 | ts->ts_rate = AR5K_REG_MS(tx_ctl->tx_control_0, |
3832 | AR5K_2W_TX_DESC_CTL0_XMIT_RATE); | 3836 | AR5K_2W_TX_DESC_CTL0_XMIT_RATE); |
3833 | 3837 | ||
3834 | if ((tx_status->tx_status_0 & AR5K_DESC_TX_STATUS0_FRAME_XMIT_OK) == 0){ | 3838 | if ((tx_status->tx_status_0 & AR5K_DESC_TX_STATUS0_FRAME_XMIT_OK) == 0){ |
3835 | if (tx_status->tx_status_0 & | 3839 | if (tx_status->tx_status_0 & |
3836 | AR5K_DESC_TX_STATUS0_EXCESSIVE_RETRIES) | 3840 | AR5K_DESC_TX_STATUS0_EXCESSIVE_RETRIES) |
3837 | desc->ds_us.tx.ts_status |= AR5K_TXERR_XRETRY; | 3841 | ts->ts_status |= AR5K_TXERR_XRETRY; |
3838 | 3842 | ||
3839 | if (tx_status->tx_status_0 & AR5K_DESC_TX_STATUS0_FIFO_UNDERRUN) | 3843 | if (tx_status->tx_status_0 & AR5K_DESC_TX_STATUS0_FIFO_UNDERRUN) |
3840 | desc->ds_us.tx.ts_status |= AR5K_TXERR_FIFO; | 3844 | ts->ts_status |= AR5K_TXERR_FIFO; |
3841 | 3845 | ||
3842 | if (tx_status->tx_status_0 & AR5K_DESC_TX_STATUS0_FILTERED) | 3846 | if (tx_status->tx_status_0 & AR5K_DESC_TX_STATUS0_FILTERED) |
3843 | desc->ds_us.tx.ts_status |= AR5K_TXERR_FILT; | 3847 | ts->ts_status |= AR5K_TXERR_FILT; |
3844 | } | 3848 | } |
3845 | 3849 | ||
3846 | return 0; | 3850 | return 0; |
@@ -3850,7 +3854,7 @@ static int ath5k_hw_proc_2word_tx_status(struct ath5k_hw *ah, | |||
3850 | * Proccess a tx descriptor on 5212 | 3854 | * Proccess a tx descriptor on 5212 |
3851 | */ | 3855 | */ |
3852 | static int ath5k_hw_proc_4word_tx_status(struct ath5k_hw *ah, | 3856 | static int ath5k_hw_proc_4word_tx_status(struct ath5k_hw *ah, |
3853 | struct ath5k_desc *desc) | 3857 | struct ath5k_desc *desc, struct ath5k_tx_status *ts) |
3854 | { | 3858 | { |
3855 | struct ath5k_hw_4w_tx_ctl *tx_ctl; | 3859 | struct ath5k_hw_4w_tx_ctl *tx_ctl; |
3856 | struct ath5k_hw_tx_status *tx_status; | 3860 | struct ath5k_hw_tx_status *tx_status; |
@@ -3867,42 +3871,42 @@ static int ath5k_hw_proc_4word_tx_status(struct ath5k_hw *ah, | |||
3867 | /* | 3871 | /* |
3868 | * Get descriptor status | 3872 | * Get descriptor status |
3869 | */ | 3873 | */ |
3870 | desc->ds_us.tx.ts_tstamp = AR5K_REG_MS(tx_status->tx_status_0, | 3874 | ts->ts_tstamp = AR5K_REG_MS(tx_status->tx_status_0, |
3871 | AR5K_DESC_TX_STATUS0_SEND_TIMESTAMP); | 3875 | AR5K_DESC_TX_STATUS0_SEND_TIMESTAMP); |
3872 | desc->ds_us.tx.ts_shortretry = AR5K_REG_MS(tx_status->tx_status_0, | 3876 | ts->ts_shortretry = AR5K_REG_MS(tx_status->tx_status_0, |
3873 | AR5K_DESC_TX_STATUS0_SHORT_RETRY_COUNT); | 3877 | AR5K_DESC_TX_STATUS0_SHORT_RETRY_COUNT); |
3874 | desc->ds_us.tx.ts_longretry = AR5K_REG_MS(tx_status->tx_status_0, | 3878 | ts->ts_longretry = AR5K_REG_MS(tx_status->tx_status_0, |
3875 | AR5K_DESC_TX_STATUS0_LONG_RETRY_COUNT); | 3879 | AR5K_DESC_TX_STATUS0_LONG_RETRY_COUNT); |
3876 | desc->ds_us.tx.ts_seqnum = AR5K_REG_MS(tx_status->tx_status_1, | 3880 | ts->ts_seqnum = AR5K_REG_MS(tx_status->tx_status_1, |
3877 | AR5K_DESC_TX_STATUS1_SEQ_NUM); | 3881 | AR5K_DESC_TX_STATUS1_SEQ_NUM); |
3878 | desc->ds_us.tx.ts_rssi = AR5K_REG_MS(tx_status->tx_status_1, | 3882 | ts->ts_rssi = AR5K_REG_MS(tx_status->tx_status_1, |
3879 | AR5K_DESC_TX_STATUS1_ACK_SIG_STRENGTH); | 3883 | AR5K_DESC_TX_STATUS1_ACK_SIG_STRENGTH); |
3880 | desc->ds_us.tx.ts_antenna = (tx_status->tx_status_1 & | 3884 | ts->ts_antenna = (tx_status->tx_status_1 & |
3881 | AR5K_DESC_TX_STATUS1_XMIT_ANTENNA) ? 2 : 1; | 3885 | AR5K_DESC_TX_STATUS1_XMIT_ANTENNA) ? 2 : 1; |
3882 | desc->ds_us.tx.ts_status = 0; | 3886 | ts->ts_status = 0; |
3883 | 3887 | ||
3884 | switch (AR5K_REG_MS(tx_status->tx_status_1, | 3888 | switch (AR5K_REG_MS(tx_status->tx_status_1, |
3885 | AR5K_DESC_TX_STATUS1_FINAL_TS_INDEX)) { | 3889 | AR5K_DESC_TX_STATUS1_FINAL_TS_INDEX)) { |
3886 | case 0: | 3890 | case 0: |
3887 | desc->ds_us.tx.ts_rate = tx_ctl->tx_control_3 & | 3891 | ts->ts_rate = tx_ctl->tx_control_3 & |
3888 | AR5K_4W_TX_DESC_CTL3_XMIT_RATE0; | 3892 | AR5K_4W_TX_DESC_CTL3_XMIT_RATE0; |
3889 | break; | 3893 | break; |
3890 | case 1: | 3894 | case 1: |
3891 | desc->ds_us.tx.ts_rate = AR5K_REG_MS(tx_ctl->tx_control_3, | 3895 | ts->ts_rate = AR5K_REG_MS(tx_ctl->tx_control_3, |
3892 | AR5K_4W_TX_DESC_CTL3_XMIT_RATE1); | 3896 | AR5K_4W_TX_DESC_CTL3_XMIT_RATE1); |
3893 | desc->ds_us.tx.ts_longretry += AR5K_REG_MS(tx_ctl->tx_control_2, | 3897 | ts->ts_longretry += AR5K_REG_MS(tx_ctl->tx_control_2, |
3894 | AR5K_4W_TX_DESC_CTL2_XMIT_TRIES1); | 3898 | AR5K_4W_TX_DESC_CTL2_XMIT_TRIES1); |
3895 | break; | 3899 | break; |
3896 | case 2: | 3900 | case 2: |
3897 | desc->ds_us.tx.ts_rate = AR5K_REG_MS(tx_ctl->tx_control_3, | 3901 | ts->ts_rate = AR5K_REG_MS(tx_ctl->tx_control_3, |
3898 | AR5K_4W_TX_DESC_CTL3_XMIT_RATE2); | 3902 | AR5K_4W_TX_DESC_CTL3_XMIT_RATE2); |
3899 | desc->ds_us.tx.ts_longretry += AR5K_REG_MS(tx_ctl->tx_control_2, | 3903 | ts->ts_longretry += AR5K_REG_MS(tx_ctl->tx_control_2, |
3900 | AR5K_4W_TX_DESC_CTL2_XMIT_TRIES2); | 3904 | AR5K_4W_TX_DESC_CTL2_XMIT_TRIES2); |
3901 | break; | 3905 | break; |
3902 | case 3: | 3906 | case 3: |
3903 | desc->ds_us.tx.ts_rate = AR5K_REG_MS(tx_ctl->tx_control_3, | 3907 | ts->ts_rate = AR5K_REG_MS(tx_ctl->tx_control_3, |
3904 | AR5K_4W_TX_DESC_CTL3_XMIT_RATE3); | 3908 | AR5K_4W_TX_DESC_CTL3_XMIT_RATE3); |
3905 | desc->ds_us.tx.ts_longretry += AR5K_REG_MS(tx_ctl->tx_control_2, | 3909 | ts->ts_longretry += AR5K_REG_MS(tx_ctl->tx_control_2, |
3906 | AR5K_4W_TX_DESC_CTL2_XMIT_TRIES3); | 3910 | AR5K_4W_TX_DESC_CTL2_XMIT_TRIES3); |
3907 | break; | 3911 | break; |
3908 | } | 3912 | } |
@@ -3910,13 +3914,13 @@ static int ath5k_hw_proc_4word_tx_status(struct ath5k_hw *ah, | |||
3910 | if ((tx_status->tx_status_0 & AR5K_DESC_TX_STATUS0_FRAME_XMIT_OK) == 0){ | 3914 | if ((tx_status->tx_status_0 & AR5K_DESC_TX_STATUS0_FRAME_XMIT_OK) == 0){ |
3911 | if (tx_status->tx_status_0 & | 3915 | if (tx_status->tx_status_0 & |
3912 | AR5K_DESC_TX_STATUS0_EXCESSIVE_RETRIES) | 3916 | AR5K_DESC_TX_STATUS0_EXCESSIVE_RETRIES) |
3913 | desc->ds_us.tx.ts_status |= AR5K_TXERR_XRETRY; | 3917 | ts->ts_status |= AR5K_TXERR_XRETRY; |
3914 | 3918 | ||
3915 | if (tx_status->tx_status_0 & AR5K_DESC_TX_STATUS0_FIFO_UNDERRUN) | 3919 | if (tx_status->tx_status_0 & AR5K_DESC_TX_STATUS0_FIFO_UNDERRUN) |
3916 | desc->ds_us.tx.ts_status |= AR5K_TXERR_FIFO; | 3920 | ts->ts_status |= AR5K_TXERR_FIFO; |
3917 | 3921 | ||
3918 | if (tx_status->tx_status_0 & AR5K_DESC_TX_STATUS0_FILTERED) | 3922 | if (tx_status->tx_status_0 & AR5K_DESC_TX_STATUS0_FILTERED) |
3919 | desc->ds_us.tx.ts_status |= AR5K_TXERR_FILT; | 3923 | ts->ts_status |= AR5K_TXERR_FILT; |
3920 | } | 3924 | } |
3921 | 3925 | ||
3922 | return 0; | 3926 | return 0; |
@@ -3961,7 +3965,7 @@ int ath5k_hw_setup_rx_desc(struct ath5k_hw *ah, struct ath5k_desc *desc, | |||
3961 | * Proccess the rx status descriptor on 5210/5211 | 3965 | * Proccess the rx status descriptor on 5210/5211 |
3962 | */ | 3966 | */ |
3963 | static int ath5k_hw_proc_5210_rx_status(struct ath5k_hw *ah, | 3967 | static int ath5k_hw_proc_5210_rx_status(struct ath5k_hw *ah, |
3964 | struct ath5k_desc *desc) | 3968 | struct ath5k_desc *desc, struct ath5k_rx_status *rs) |
3965 | { | 3969 | { |
3966 | struct ath5k_hw_rx_status *rx_status; | 3970 | struct ath5k_hw_rx_status *rx_status; |
3967 | 3971 | ||
@@ -3975,28 +3979,29 @@ static int ath5k_hw_proc_5210_rx_status(struct ath5k_hw *ah, | |||
3975 | /* | 3979 | /* |
3976 | * Frame receive status | 3980 | * Frame receive status |
3977 | */ | 3981 | */ |
3978 | desc->ds_us.rx.rs_datalen = rx_status->rx_status_0 & | 3982 | rs->rs_datalen = rx_status->rx_status_0 & |
3979 | AR5K_5210_RX_DESC_STATUS0_DATA_LEN; | 3983 | AR5K_5210_RX_DESC_STATUS0_DATA_LEN; |
3980 | desc->ds_us.rx.rs_rssi = AR5K_REG_MS(rx_status->rx_status_0, | 3984 | rs->rs_rssi = AR5K_REG_MS(rx_status->rx_status_0, |
3981 | AR5K_5210_RX_DESC_STATUS0_RECEIVE_SIGNAL); | 3985 | AR5K_5210_RX_DESC_STATUS0_RECEIVE_SIGNAL); |
3982 | desc->ds_us.rx.rs_rate = AR5K_REG_MS(rx_status->rx_status_0, | 3986 | rs->rs_rate = AR5K_REG_MS(rx_status->rx_status_0, |
3983 | AR5K_5210_RX_DESC_STATUS0_RECEIVE_RATE); | 3987 | AR5K_5210_RX_DESC_STATUS0_RECEIVE_RATE); |
3984 | desc->ds_us.rx.rs_antenna = rx_status->rx_status_0 & | 3988 | rs->rs_antenna = rx_status->rx_status_0 & |
3985 | AR5K_5210_RX_DESC_STATUS0_RECEIVE_ANTENNA; | 3989 | AR5K_5210_RX_DESC_STATUS0_RECEIVE_ANTENNA; |
3986 | desc->ds_us.rx.rs_more = rx_status->rx_status_0 & | 3990 | rs->rs_more = rx_status->rx_status_0 & |
3987 | AR5K_5210_RX_DESC_STATUS0_MORE; | 3991 | AR5K_5210_RX_DESC_STATUS0_MORE; |
3988 | desc->ds_us.rx.rs_tstamp = AR5K_REG_MS(rx_status->rx_status_1, | 3992 | /* TODO: this timestamp is 13 bit, later on we assume 15 bit */ |
3993 | rs->rs_tstamp = AR5K_REG_MS(rx_status->rx_status_1, | ||
3989 | AR5K_5210_RX_DESC_STATUS1_RECEIVE_TIMESTAMP); | 3994 | AR5K_5210_RX_DESC_STATUS1_RECEIVE_TIMESTAMP); |
3990 | desc->ds_us.rx.rs_status = 0; | 3995 | rs->rs_status = 0; |
3991 | 3996 | ||
3992 | /* | 3997 | /* |
3993 | * Key table status | 3998 | * Key table status |
3994 | */ | 3999 | */ |
3995 | if (rx_status->rx_status_1 & AR5K_5210_RX_DESC_STATUS1_KEY_INDEX_VALID) | 4000 | if (rx_status->rx_status_1 & AR5K_5210_RX_DESC_STATUS1_KEY_INDEX_VALID) |
3996 | desc->ds_us.rx.rs_keyix = AR5K_REG_MS(rx_status->rx_status_1, | 4001 | rs->rs_keyix = AR5K_REG_MS(rx_status->rx_status_1, |
3997 | AR5K_5210_RX_DESC_STATUS1_KEY_INDEX); | 4002 | AR5K_5210_RX_DESC_STATUS1_KEY_INDEX); |
3998 | else | 4003 | else |
3999 | desc->ds_us.rx.rs_keyix = AR5K_RXKEYIX_INVALID; | 4004 | rs->rs_keyix = AR5K_RXKEYIX_INVALID; |
4000 | 4005 | ||
4001 | /* | 4006 | /* |
4002 | * Receive/descriptor errors | 4007 | * Receive/descriptor errors |
@@ -4005,23 +4010,22 @@ static int ath5k_hw_proc_5210_rx_status(struct ath5k_hw *ah, | |||
4005 | AR5K_5210_RX_DESC_STATUS1_FRAME_RECEIVE_OK) == 0) { | 4010 | AR5K_5210_RX_DESC_STATUS1_FRAME_RECEIVE_OK) == 0) { |
4006 | if (rx_status->rx_status_1 & | 4011 | if (rx_status->rx_status_1 & |
4007 | AR5K_5210_RX_DESC_STATUS1_CRC_ERROR) | 4012 | AR5K_5210_RX_DESC_STATUS1_CRC_ERROR) |
4008 | desc->ds_us.rx.rs_status |= AR5K_RXERR_CRC; | 4013 | rs->rs_status |= AR5K_RXERR_CRC; |
4009 | 4014 | ||
4010 | if (rx_status->rx_status_1 & | 4015 | if (rx_status->rx_status_1 & |
4011 | AR5K_5210_RX_DESC_STATUS1_FIFO_OVERRUN) | 4016 | AR5K_5210_RX_DESC_STATUS1_FIFO_OVERRUN) |
4012 | desc->ds_us.rx.rs_status |= AR5K_RXERR_FIFO; | 4017 | rs->rs_status |= AR5K_RXERR_FIFO; |
4013 | 4018 | ||
4014 | if (rx_status->rx_status_1 & | 4019 | if (rx_status->rx_status_1 & |
4015 | AR5K_5210_RX_DESC_STATUS1_PHY_ERROR) { | 4020 | AR5K_5210_RX_DESC_STATUS1_PHY_ERROR) { |
4016 | desc->ds_us.rx.rs_status |= AR5K_RXERR_PHY; | 4021 | rs->rs_status |= AR5K_RXERR_PHY; |
4017 | desc->ds_us.rx.rs_phyerr = | 4022 | rs->rs_phyerr = AR5K_REG_MS(rx_status->rx_status_1, |
4018 | AR5K_REG_MS(rx_status->rx_status_1, | 4023 | AR5K_5210_RX_DESC_STATUS1_PHY_ERROR); |
4019 | AR5K_5210_RX_DESC_STATUS1_PHY_ERROR); | ||
4020 | } | 4024 | } |
4021 | 4025 | ||
4022 | if (rx_status->rx_status_1 & | 4026 | if (rx_status->rx_status_1 & |
4023 | AR5K_5210_RX_DESC_STATUS1_DECRYPT_CRC_ERROR) | 4027 | AR5K_5210_RX_DESC_STATUS1_DECRYPT_CRC_ERROR) |
4024 | desc->ds_us.rx.rs_status |= AR5K_RXERR_DECRYPT; | 4028 | rs->rs_status |= AR5K_RXERR_DECRYPT; |
4025 | } | 4029 | } |
4026 | 4030 | ||
4027 | return 0; | 4031 | return 0; |
@@ -4031,7 +4035,7 @@ static int ath5k_hw_proc_5210_rx_status(struct ath5k_hw *ah, | |||
4031 | * Proccess the rx status descriptor on 5212 | 4035 | * Proccess the rx status descriptor on 5212 |
4032 | */ | 4036 | */ |
4033 | static int ath5k_hw_proc_5212_rx_status(struct ath5k_hw *ah, | 4037 | static int ath5k_hw_proc_5212_rx_status(struct ath5k_hw *ah, |
4034 | struct ath5k_desc *desc) | 4038 | struct ath5k_desc *desc, struct ath5k_rx_status *rs) |
4035 | { | 4039 | { |
4036 | struct ath5k_hw_rx_status *rx_status; | 4040 | struct ath5k_hw_rx_status *rx_status; |
4037 | struct ath5k_hw_rx_error *rx_err; | 4041 | struct ath5k_hw_rx_error *rx_err; |
@@ -4050,28 +4054,28 @@ static int ath5k_hw_proc_5212_rx_status(struct ath5k_hw *ah, | |||
4050 | /* | 4054 | /* |
4051 | * Frame receive status | 4055 | * Frame receive status |
4052 | */ | 4056 | */ |
4053 | desc->ds_us.rx.rs_datalen = rx_status->rx_status_0 & | 4057 | rs->rs_datalen = rx_status->rx_status_0 & |
4054 | AR5K_5212_RX_DESC_STATUS0_DATA_LEN; | 4058 | AR5K_5212_RX_DESC_STATUS0_DATA_LEN; |
4055 | desc->ds_us.rx.rs_rssi = AR5K_REG_MS(rx_status->rx_status_0, | 4059 | rs->rs_rssi = AR5K_REG_MS(rx_status->rx_status_0, |
4056 | AR5K_5212_RX_DESC_STATUS0_RECEIVE_SIGNAL); | 4060 | AR5K_5212_RX_DESC_STATUS0_RECEIVE_SIGNAL); |
4057 | desc->ds_us.rx.rs_rate = AR5K_REG_MS(rx_status->rx_status_0, | 4061 | rs->rs_rate = AR5K_REG_MS(rx_status->rx_status_0, |
4058 | AR5K_5212_RX_DESC_STATUS0_RECEIVE_RATE); | 4062 | AR5K_5212_RX_DESC_STATUS0_RECEIVE_RATE); |
4059 | desc->ds_us.rx.rs_antenna = rx_status->rx_status_0 & | 4063 | rs->rs_antenna = rx_status->rx_status_0 & |
4060 | AR5K_5212_RX_DESC_STATUS0_RECEIVE_ANTENNA; | 4064 | AR5K_5212_RX_DESC_STATUS0_RECEIVE_ANTENNA; |
4061 | desc->ds_us.rx.rs_more = rx_status->rx_status_0 & | 4065 | rs->rs_more = rx_status->rx_status_0 & |
4062 | AR5K_5212_RX_DESC_STATUS0_MORE; | 4066 | AR5K_5212_RX_DESC_STATUS0_MORE; |
4063 | desc->ds_us.rx.rs_tstamp = AR5K_REG_MS(rx_status->rx_status_1, | 4067 | rs->rs_tstamp = AR5K_REG_MS(rx_status->rx_status_1, |
4064 | AR5K_5212_RX_DESC_STATUS1_RECEIVE_TIMESTAMP); | 4068 | AR5K_5212_RX_DESC_STATUS1_RECEIVE_TIMESTAMP); |
4065 | desc->ds_us.rx.rs_status = 0; | 4069 | rs->rs_status = 0; |
4066 | 4070 | ||
4067 | /* | 4071 | /* |
4068 | * Key table status | 4072 | * Key table status |
4069 | */ | 4073 | */ |
4070 | if (rx_status->rx_status_1 & AR5K_5212_RX_DESC_STATUS1_KEY_INDEX_VALID) | 4074 | if (rx_status->rx_status_1 & AR5K_5212_RX_DESC_STATUS1_KEY_INDEX_VALID) |
4071 | desc->ds_us.rx.rs_keyix = AR5K_REG_MS(rx_status->rx_status_1, | 4075 | rs->rs_keyix = AR5K_REG_MS(rx_status->rx_status_1, |
4072 | AR5K_5212_RX_DESC_STATUS1_KEY_INDEX); | 4076 | AR5K_5212_RX_DESC_STATUS1_KEY_INDEX); |
4073 | else | 4077 | else |
4074 | desc->ds_us.rx.rs_keyix = AR5K_RXKEYIX_INVALID; | 4078 | rs->rs_keyix = AR5K_RXKEYIX_INVALID; |
4075 | 4079 | ||
4076 | /* | 4080 | /* |
4077 | * Receive/descriptor errors | 4081 | * Receive/descriptor errors |
@@ -4080,23 +4084,22 @@ static int ath5k_hw_proc_5212_rx_status(struct ath5k_hw *ah, | |||
4080 | AR5K_5212_RX_DESC_STATUS1_FRAME_RECEIVE_OK) == 0) { | 4084 | AR5K_5212_RX_DESC_STATUS1_FRAME_RECEIVE_OK) == 0) { |
4081 | if (rx_status->rx_status_1 & | 4085 | if (rx_status->rx_status_1 & |
4082 | AR5K_5212_RX_DESC_STATUS1_CRC_ERROR) | 4086 | AR5K_5212_RX_DESC_STATUS1_CRC_ERROR) |
4083 | desc->ds_us.rx.rs_status |= AR5K_RXERR_CRC; | 4087 | rs->rs_status |= AR5K_RXERR_CRC; |
4084 | 4088 | ||
4085 | if (rx_status->rx_status_1 & | 4089 | if (rx_status->rx_status_1 & |
4086 | AR5K_5212_RX_DESC_STATUS1_PHY_ERROR) { | 4090 | AR5K_5212_RX_DESC_STATUS1_PHY_ERROR) { |
4087 | desc->ds_us.rx.rs_status |= AR5K_RXERR_PHY; | 4091 | rs->rs_status |= AR5K_RXERR_PHY; |
4088 | desc->ds_us.rx.rs_phyerr = | 4092 | rs->rs_phyerr = AR5K_REG_MS(rx_err->rx_error_1, |
4089 | AR5K_REG_MS(rx_err->rx_error_1, | 4093 | AR5K_RX_DESC_ERROR1_PHY_ERROR_CODE); |
4090 | AR5K_RX_DESC_ERROR1_PHY_ERROR_CODE); | ||
4091 | } | 4094 | } |
4092 | 4095 | ||
4093 | if (rx_status->rx_status_1 & | 4096 | if (rx_status->rx_status_1 & |
4094 | AR5K_5212_RX_DESC_STATUS1_DECRYPT_CRC_ERROR) | 4097 | AR5K_5212_RX_DESC_STATUS1_DECRYPT_CRC_ERROR) |
4095 | desc->ds_us.rx.rs_status |= AR5K_RXERR_DECRYPT; | 4098 | rs->rs_status |= AR5K_RXERR_DECRYPT; |
4096 | 4099 | ||
4097 | if (rx_status->rx_status_1 & | 4100 | if (rx_status->rx_status_1 & |
4098 | AR5K_5212_RX_DESC_STATUS1_MIC_ERROR) | 4101 | AR5K_5212_RX_DESC_STATUS1_MIC_ERROR) |
4099 | desc->ds_us.rx.rs_status |= AR5K_RXERR_MIC; | 4102 | rs->rs_status |= AR5K_RXERR_MIC; |
4100 | } | 4103 | } |
4101 | 4104 | ||
4102 | return 0; | 4105 | return 0; |