diff options
author | Bruno Randolf <br1@einfach.org> | 2008-03-05 04:35:23 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-03-07 16:07:49 -0500 |
commit | 19fd6e5510f6991148e2210753b58f0eab95e0f6 (patch) | |
tree | 1a71054afbc01d0db5f99fdc50a747eef38d1b54 /drivers/net/wireless/ath5k/hw.c | |
parent | b095d03a7d724db7379b73f64b6035f7be2e0a7c (diff) |
ath5k: struct ath5k_desc cleanups
* make struct ath5k_desc clearer by directly including unions of structures,
which correspond to the hardware descriptors of different HW versions (5210
and 5212). before they were casted at onto ath5k_desc at different points
(e.g. ds_hw[2]).
* rename some structures and variable names to make their use clearer, e.g.
struct ath5k_hw_4w_tx_desc to ath5k_hw_4w_tx_ctl.
* substitute "old" with "5210" and "new" with "5212" (eg. rename
ath5k_hw_proc_new_rx_status() to ath5k_hw_proc_5212_rx_status()) because old
and new are relative and we might have a newer structure at some point.
* unify structs ath5k_hw_old_rx_status and ath5k_hw_new_rx_status into one
ath5k_hw_rx_status, because they only differ in the flags and masks.
drivers/net/wireless/ath5k/ath5k.h: Changes-licensed-under: ISC
drivers/net/wireless/ath5k/debug.c: Changes-licensed-under: GPL
drivers/net/wireless/ath5k/hw.c: Changes-licensed-under: ISC
drivers/net/wireless/ath5k/hw.h: 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 | 212 |
1 files changed, 101 insertions, 111 deletions
diff --git a/drivers/net/wireless/ath5k/hw.c b/drivers/net/wireless/ath5k/hw.c index 3c399604f30e..f88adf52a1b2 100644 --- a/drivers/net/wireless/ath5k/hw.c +++ b/drivers/net/wireless/ath5k/hw.c | |||
@@ -54,8 +54,8 @@ static int ath5k_hw_setup_2word_tx_desc(struct ath5k_hw *, struct ath5k_desc *, | |||
54 | unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, | 54 | unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, |
55 | unsigned int, unsigned int); | 55 | unsigned int, unsigned int); |
56 | static int ath5k_hw_proc_2word_tx_status(struct ath5k_hw *, struct ath5k_desc *); | 56 | static int ath5k_hw_proc_2word_tx_status(struct ath5k_hw *, struct ath5k_desc *); |
57 | static int ath5k_hw_proc_new_rx_status(struct ath5k_hw *, struct ath5k_desc *); | 57 | static int ath5k_hw_proc_5212_rx_status(struct ath5k_hw *, struct ath5k_desc *); |
58 | static int ath5k_hw_proc_old_rx_status(struct ath5k_hw *, struct ath5k_desc *); | 58 | static int ath5k_hw_proc_5210_rx_status(struct ath5k_hw *, struct ath5k_desc *); |
59 | static int ath5k_hw_get_capabilities(struct ath5k_hw *); | 59 | static int ath5k_hw_get_capabilities(struct ath5k_hw *); |
60 | 60 | ||
61 | static int ath5k_eeprom_init(struct ath5k_hw *); | 61 | static int ath5k_eeprom_init(struct ath5k_hw *); |
@@ -174,9 +174,9 @@ struct ath5k_hw *ath5k_hw_attach(struct ath5k_softc *sc, u8 mac_version) | |||
174 | } | 174 | } |
175 | 175 | ||
176 | if (ah->ah_version == AR5K_AR5212) | 176 | if (ah->ah_version == AR5K_AR5212) |
177 | ah->ah_proc_rx_desc = ath5k_hw_proc_new_rx_status; | 177 | ah->ah_proc_rx_desc = ath5k_hw_proc_5212_rx_status; |
178 | else if (ah->ah_version <= AR5K_AR5211) | 178 | else if (ah->ah_version <= AR5K_AR5211) |
179 | ah->ah_proc_rx_desc = ath5k_hw_proc_old_rx_status; | 179 | ah->ah_proc_rx_desc = ath5k_hw_proc_5210_rx_status; |
180 | 180 | ||
181 | /* Bring device out of sleep and reset it's units */ | 181 | /* Bring device out of sleep and reset it's units */ |
182 | ret = ath5k_hw_nic_wakeup(ah, AR5K_INIT_MODE, true); | 182 | ret = ath5k_hw_nic_wakeup(ah, AR5K_INIT_MODE, true); |
@@ -3522,10 +3522,10 @@ ath5k_hw_setup_2word_tx_desc(struct ath5k_hw *ah, struct ath5k_desc *desc, | |||
3522 | unsigned int rtscts_rate, unsigned int rtscts_duration) | 3522 | unsigned int rtscts_rate, unsigned int rtscts_duration) |
3523 | { | 3523 | { |
3524 | u32 frame_type; | 3524 | u32 frame_type; |
3525 | struct ath5k_hw_2w_tx_desc *tx_desc; | 3525 | struct ath5k_hw_2w_tx_ctl *tx_ctl; |
3526 | unsigned int frame_len; | 3526 | unsigned int frame_len; |
3527 | 3527 | ||
3528 | tx_desc = (struct ath5k_hw_2w_tx_desc *)&desc->ds_ctl0; | 3528 | tx_ctl = &desc->ud.ds_tx5210.tx_ctl; |
3529 | 3529 | ||
3530 | /* | 3530 | /* |
3531 | * Validate input | 3531 | * Validate input |
@@ -3544,12 +3544,8 @@ ath5k_hw_setup_2word_tx_desc(struct ath5k_hw *ah, struct ath5k_desc *desc, | |||
3544 | return -EINVAL; | 3544 | return -EINVAL; |
3545 | } | 3545 | } |
3546 | 3546 | ||
3547 | /* Clear status descriptor */ | 3547 | /* Clear descriptor */ |
3548 | memset(desc->ds_hw, 0, sizeof(struct ath5k_hw_tx_status)); | 3548 | memset(&desc->ud.ds_tx5210, 0, sizeof(struct ath5k_hw_5210_tx_desc)); |
3549 | |||
3550 | /* Initialize control descriptor */ | ||
3551 | tx_desc->tx_control_0 = 0; | ||
3552 | tx_desc->tx_control_1 = 0; | ||
3553 | 3549 | ||
3554 | /* Setup control descriptor */ | 3550 | /* Setup control descriptor */ |
3555 | 3551 | ||
@@ -3561,7 +3557,7 @@ ath5k_hw_setup_2word_tx_desc(struct ath5k_hw *ah, struct ath5k_desc *desc, | |||
3561 | if (frame_len & ~AR5K_2W_TX_DESC_CTL0_FRAME_LEN) | 3557 | if (frame_len & ~AR5K_2W_TX_DESC_CTL0_FRAME_LEN) |
3562 | return -EINVAL; | 3558 | return -EINVAL; |
3563 | 3559 | ||
3564 | tx_desc->tx_control_0 = frame_len & AR5K_2W_TX_DESC_CTL0_FRAME_LEN; | 3560 | tx_ctl->tx_control_0 = frame_len & AR5K_2W_TX_DESC_CTL0_FRAME_LEN; |
3565 | 3561 | ||
3566 | /* Verify and set buffer length */ | 3562 | /* Verify and set buffer length */ |
3567 | 3563 | ||
@@ -3572,7 +3568,7 @@ ath5k_hw_setup_2word_tx_desc(struct ath5k_hw *ah, struct ath5k_desc *desc, | |||
3572 | if (pkt_len & ~AR5K_2W_TX_DESC_CTL1_BUF_LEN) | 3568 | if (pkt_len & ~AR5K_2W_TX_DESC_CTL1_BUF_LEN) |
3573 | return -EINVAL; | 3569 | return -EINVAL; |
3574 | 3570 | ||
3575 | tx_desc->tx_control_1 = pkt_len & AR5K_2W_TX_DESC_CTL1_BUF_LEN; | 3571 | tx_ctl->tx_control_1 = pkt_len & AR5K_2W_TX_DESC_CTL1_BUF_LEN; |
3576 | 3572 | ||
3577 | /* | 3573 | /* |
3578 | * Verify and set header length | 3574 | * Verify and set header length |
@@ -3581,7 +3577,7 @@ ath5k_hw_setup_2word_tx_desc(struct ath5k_hw *ah, struct ath5k_desc *desc, | |||
3581 | if (ah->ah_version == AR5K_AR5210) { | 3577 | if (ah->ah_version == AR5K_AR5210) { |
3582 | if (hdr_len & ~AR5K_2W_TX_DESC_CTL0_HEADER_LEN) | 3578 | if (hdr_len & ~AR5K_2W_TX_DESC_CTL0_HEADER_LEN) |
3583 | return -EINVAL; | 3579 | return -EINVAL; |
3584 | tx_desc->tx_control_0 |= | 3580 | tx_ctl->tx_control_0 |= |
3585 | AR5K_REG_SM(hdr_len, AR5K_2W_TX_DESC_CTL0_HEADER_LEN); | 3581 | AR5K_REG_SM(hdr_len, AR5K_2W_TX_DESC_CTL0_HEADER_LEN); |
3586 | } | 3582 | } |
3587 | 3583 | ||
@@ -3597,19 +3593,19 @@ ath5k_hw_setup_2word_tx_desc(struct ath5k_hw *ah, struct ath5k_desc *desc, | |||
3597 | frame_type = type /*<< 2 ?*/; | 3593 | frame_type = type /*<< 2 ?*/; |
3598 | } | 3594 | } |
3599 | 3595 | ||
3600 | tx_desc->tx_control_0 |= | 3596 | tx_ctl->tx_control_0 |= |
3601 | AR5K_REG_SM(frame_type, AR5K_2W_TX_DESC_CTL0_FRAME_TYPE) | | 3597 | AR5K_REG_SM(frame_type, AR5K_2W_TX_DESC_CTL0_FRAME_TYPE) | |
3602 | AR5K_REG_SM(tx_rate0, AR5K_2W_TX_DESC_CTL0_XMIT_RATE); | 3598 | AR5K_REG_SM(tx_rate0, AR5K_2W_TX_DESC_CTL0_XMIT_RATE); |
3603 | } else { | 3599 | } else { |
3604 | tx_desc->tx_control_0 |= | 3600 | tx_ctl->tx_control_0 |= |
3605 | AR5K_REG_SM(tx_rate0, AR5K_2W_TX_DESC_CTL0_XMIT_RATE) | | 3601 | AR5K_REG_SM(tx_rate0, AR5K_2W_TX_DESC_CTL0_XMIT_RATE) | |
3606 | AR5K_REG_SM(antenna_mode, AR5K_2W_TX_DESC_CTL0_ANT_MODE_XMIT); | 3602 | AR5K_REG_SM(antenna_mode, AR5K_2W_TX_DESC_CTL0_ANT_MODE_XMIT); |
3607 | tx_desc->tx_control_1 |= | 3603 | tx_ctl->tx_control_1 |= |
3608 | AR5K_REG_SM(type, AR5K_2W_TX_DESC_CTL1_FRAME_TYPE); | 3604 | AR5K_REG_SM(type, AR5K_2W_TX_DESC_CTL1_FRAME_TYPE); |
3609 | } | 3605 | } |
3610 | #define _TX_FLAGS(_c, _flag) \ | 3606 | #define _TX_FLAGS(_c, _flag) \ |
3611 | if (flags & AR5K_TXDESC_##_flag) \ | 3607 | if (flags & AR5K_TXDESC_##_flag) \ |
3612 | tx_desc->tx_control_##_c |= \ | 3608 | tx_ctl->tx_control_##_c |= \ |
3613 | AR5K_2W_TX_DESC_CTL##_c##_##_flag | 3609 | AR5K_2W_TX_DESC_CTL##_c##_##_flag |
3614 | 3610 | ||
3615 | _TX_FLAGS(0, CLRDMASK); | 3611 | _TX_FLAGS(0, CLRDMASK); |
@@ -3624,9 +3620,9 @@ ath5k_hw_setup_2word_tx_desc(struct ath5k_hw *ah, struct ath5k_desc *desc, | |||
3624 | * WEP crap | 3620 | * WEP crap |
3625 | */ | 3621 | */ |
3626 | if (key_index != AR5K_TXKEYIX_INVALID) { | 3622 | if (key_index != AR5K_TXKEYIX_INVALID) { |
3627 | tx_desc->tx_control_0 |= | 3623 | tx_ctl->tx_control_0 |= |
3628 | AR5K_2W_TX_DESC_CTL0_ENCRYPT_KEY_VALID; | 3624 | AR5K_2W_TX_DESC_CTL0_ENCRYPT_KEY_VALID; |
3629 | tx_desc->tx_control_1 |= | 3625 | tx_ctl->tx_control_1 |= |
3630 | AR5K_REG_SM(key_index, | 3626 | AR5K_REG_SM(key_index, |
3631 | AR5K_2W_TX_DESC_CTL1_ENCRYPT_KEY_INDEX); | 3627 | AR5K_2W_TX_DESC_CTL1_ENCRYPT_KEY_INDEX); |
3632 | } | 3628 | } |
@@ -3636,7 +3632,7 @@ ath5k_hw_setup_2word_tx_desc(struct ath5k_hw *ah, struct ath5k_desc *desc, | |||
3636 | */ | 3632 | */ |
3637 | if ((ah->ah_version == AR5K_AR5210) && | 3633 | if ((ah->ah_version == AR5K_AR5210) && |
3638 | (flags & (AR5K_TXDESC_RTSENA | AR5K_TXDESC_CTSENA))) | 3634 | (flags & (AR5K_TXDESC_RTSENA | AR5K_TXDESC_CTSENA))) |
3639 | tx_desc->tx_control_1 |= rtscts_duration & | 3635 | tx_ctl->tx_control_1 |= rtscts_duration & |
3640 | AR5K_2W_TX_DESC_CTL1_RTS_DURATION; | 3636 | AR5K_2W_TX_DESC_CTL1_RTS_DURATION; |
3641 | 3637 | ||
3642 | return 0; | 3638 | return 0; |
@@ -3652,13 +3648,11 @@ static int ath5k_hw_setup_4word_tx_desc(struct ath5k_hw *ah, | |||
3652 | unsigned int antenna_mode, unsigned int flags, unsigned int rtscts_rate, | 3648 | unsigned int antenna_mode, unsigned int flags, unsigned int rtscts_rate, |
3653 | unsigned int rtscts_duration) | 3649 | unsigned int rtscts_duration) |
3654 | { | 3650 | { |
3655 | struct ath5k_hw_4w_tx_desc *tx_desc; | 3651 | struct ath5k_hw_4w_tx_ctl *tx_ctl; |
3656 | struct ath5k_hw_tx_status *tx_status; | ||
3657 | unsigned int frame_len; | 3652 | unsigned int frame_len; |
3658 | 3653 | ||
3659 | ATH5K_TRACE(ah->ah_sc); | 3654 | ATH5K_TRACE(ah->ah_sc); |
3660 | tx_desc = (struct ath5k_hw_4w_tx_desc *)&desc->ds_ctl0; | 3655 | tx_ctl = &desc->ud.ds_tx5212.tx_ctl; |
3661 | tx_status = (struct ath5k_hw_tx_status *)&desc->ds_hw[2]; | ||
3662 | 3656 | ||
3663 | /* | 3657 | /* |
3664 | * Validate input | 3658 | * Validate input |
@@ -3677,14 +3671,8 @@ static int ath5k_hw_setup_4word_tx_desc(struct ath5k_hw *ah, | |||
3677 | return -EINVAL; | 3671 | return -EINVAL; |
3678 | } | 3672 | } |
3679 | 3673 | ||
3680 | /* Clear status descriptor */ | 3674 | /* Clear descriptor */ |
3681 | memset(tx_status, 0, sizeof(struct ath5k_hw_tx_status)); | 3675 | memset(&desc->ud.ds_tx5212, 0, sizeof(struct ath5k_hw_5212_tx_desc)); |
3682 | |||
3683 | /* Initialize control descriptor */ | ||
3684 | tx_desc->tx_control_0 = 0; | ||
3685 | tx_desc->tx_control_1 = 0; | ||
3686 | tx_desc->tx_control_2 = 0; | ||
3687 | tx_desc->tx_control_3 = 0; | ||
3688 | 3676 | ||
3689 | /* Setup control descriptor */ | 3677 | /* Setup control descriptor */ |
3690 | 3678 | ||
@@ -3696,7 +3684,7 @@ static int ath5k_hw_setup_4word_tx_desc(struct ath5k_hw *ah, | |||
3696 | if (frame_len & ~AR5K_4W_TX_DESC_CTL0_FRAME_LEN) | 3684 | if (frame_len & ~AR5K_4W_TX_DESC_CTL0_FRAME_LEN) |
3697 | return -EINVAL; | 3685 | return -EINVAL; |
3698 | 3686 | ||
3699 | tx_desc->tx_control_0 = frame_len & AR5K_4W_TX_DESC_CTL0_FRAME_LEN; | 3687 | tx_ctl->tx_control_0 = frame_len & AR5K_4W_TX_DESC_CTL0_FRAME_LEN; |
3700 | 3688 | ||
3701 | /* Verify and set buffer length */ | 3689 | /* Verify and set buffer length */ |
3702 | 3690 | ||
@@ -3707,20 +3695,20 @@ static int ath5k_hw_setup_4word_tx_desc(struct ath5k_hw *ah, | |||
3707 | if (pkt_len & ~AR5K_4W_TX_DESC_CTL1_BUF_LEN) | 3695 | if (pkt_len & ~AR5K_4W_TX_DESC_CTL1_BUF_LEN) |
3708 | return -EINVAL; | 3696 | return -EINVAL; |
3709 | 3697 | ||
3710 | tx_desc->tx_control_1 = pkt_len & AR5K_4W_TX_DESC_CTL1_BUF_LEN; | 3698 | tx_ctl->tx_control_1 = pkt_len & AR5K_4W_TX_DESC_CTL1_BUF_LEN; |
3711 | 3699 | ||
3712 | tx_desc->tx_control_0 |= | 3700 | tx_ctl->tx_control_0 |= |
3713 | AR5K_REG_SM(tx_power, AR5K_4W_TX_DESC_CTL0_XMIT_POWER) | | 3701 | AR5K_REG_SM(tx_power, AR5K_4W_TX_DESC_CTL0_XMIT_POWER) | |
3714 | AR5K_REG_SM(antenna_mode, AR5K_4W_TX_DESC_CTL0_ANT_MODE_XMIT); | 3702 | AR5K_REG_SM(antenna_mode, AR5K_4W_TX_DESC_CTL0_ANT_MODE_XMIT); |
3715 | tx_desc->tx_control_1 |= AR5K_REG_SM(type, | 3703 | tx_ctl->tx_control_1 |= AR5K_REG_SM(type, |
3716 | AR5K_4W_TX_DESC_CTL1_FRAME_TYPE); | 3704 | AR5K_4W_TX_DESC_CTL1_FRAME_TYPE); |
3717 | tx_desc->tx_control_2 = AR5K_REG_SM(tx_tries0 + AR5K_TUNE_HWTXTRIES, | 3705 | tx_ctl->tx_control_2 = AR5K_REG_SM(tx_tries0 + AR5K_TUNE_HWTXTRIES, |
3718 | AR5K_4W_TX_DESC_CTL2_XMIT_TRIES0); | 3706 | AR5K_4W_TX_DESC_CTL2_XMIT_TRIES0); |
3719 | tx_desc->tx_control_3 = tx_rate0 & AR5K_4W_TX_DESC_CTL3_XMIT_RATE0; | 3707 | tx_ctl->tx_control_3 = tx_rate0 & AR5K_4W_TX_DESC_CTL3_XMIT_RATE0; |
3720 | 3708 | ||
3721 | #define _TX_FLAGS(_c, _flag) \ | 3709 | #define _TX_FLAGS(_c, _flag) \ |
3722 | if (flags & AR5K_TXDESC_##_flag) \ | 3710 | if (flags & AR5K_TXDESC_##_flag) \ |
3723 | tx_desc->tx_control_##_c |= \ | 3711 | tx_ctl->tx_control_##_c |= \ |
3724 | AR5K_4W_TX_DESC_CTL##_c##_##_flag | 3712 | AR5K_4W_TX_DESC_CTL##_c##_##_flag |
3725 | 3713 | ||
3726 | _TX_FLAGS(0, CLRDMASK); | 3714 | _TX_FLAGS(0, CLRDMASK); |
@@ -3736,8 +3724,8 @@ static int ath5k_hw_setup_4word_tx_desc(struct ath5k_hw *ah, | |||
3736 | * WEP crap | 3724 | * WEP crap |
3737 | */ | 3725 | */ |
3738 | if (key_index != AR5K_TXKEYIX_INVALID) { | 3726 | if (key_index != AR5K_TXKEYIX_INVALID) { |
3739 | tx_desc->tx_control_0 |= AR5K_4W_TX_DESC_CTL0_ENCRYPT_KEY_VALID; | 3727 | tx_ctl->tx_control_0 |= AR5K_4W_TX_DESC_CTL0_ENCRYPT_KEY_VALID; |
3740 | tx_desc->tx_control_1 |= AR5K_REG_SM(key_index, | 3728 | tx_ctl->tx_control_1 |= AR5K_REG_SM(key_index, |
3741 | AR5K_4W_TX_DESC_CTL1_ENCRYPT_KEY_INDEX); | 3729 | AR5K_4W_TX_DESC_CTL1_ENCRYPT_KEY_INDEX); |
3742 | } | 3730 | } |
3743 | 3731 | ||
@@ -3748,9 +3736,9 @@ static int ath5k_hw_setup_4word_tx_desc(struct ath5k_hw *ah, | |||
3748 | if ((flags & AR5K_TXDESC_RTSENA) && | 3736 | if ((flags & AR5K_TXDESC_RTSENA) && |
3749 | (flags & AR5K_TXDESC_CTSENA)) | 3737 | (flags & AR5K_TXDESC_CTSENA)) |
3750 | return -EINVAL; | 3738 | return -EINVAL; |
3751 | tx_desc->tx_control_2 |= rtscts_duration & | 3739 | tx_ctl->tx_control_2 |= rtscts_duration & |
3752 | AR5K_4W_TX_DESC_CTL2_RTS_DURATION; | 3740 | AR5K_4W_TX_DESC_CTL2_RTS_DURATION; |
3753 | tx_desc->tx_control_3 |= AR5K_REG_SM(rtscts_rate, | 3741 | tx_ctl->tx_control_3 |= AR5K_REG_SM(rtscts_rate, |
3754 | AR5K_4W_TX_DESC_CTL3_RTS_CTS_RATE); | 3742 | AR5K_4W_TX_DESC_CTL3_RTS_CTS_RATE); |
3755 | } | 3743 | } |
3756 | 3744 | ||
@@ -3765,7 +3753,7 @@ ath5k_hw_setup_xr_tx_desc(struct ath5k_hw *ah, struct ath5k_desc *desc, | |||
3765 | unsigned int tx_rate1, u_int tx_tries1, u_int tx_rate2, u_int tx_tries2, | 3753 | unsigned int tx_rate1, u_int tx_tries1, u_int tx_rate2, u_int tx_tries2, |
3766 | unsigned int tx_rate3, u_int tx_tries3) | 3754 | unsigned int tx_rate3, u_int tx_tries3) |
3767 | { | 3755 | { |
3768 | struct ath5k_hw_4w_tx_desc *tx_desc; | 3756 | struct ath5k_hw_4w_tx_ctl *tx_ctl; |
3769 | 3757 | ||
3770 | /* | 3758 | /* |
3771 | * Rates can be 0 as long as the retry count is 0 too. | 3759 | * Rates can be 0 as long as the retry count is 0 too. |
@@ -3782,14 +3770,14 @@ ath5k_hw_setup_xr_tx_desc(struct ath5k_hw *ah, struct ath5k_desc *desc, | |||
3782 | } | 3770 | } |
3783 | 3771 | ||
3784 | if (ah->ah_version == AR5K_AR5212) { | 3772 | if (ah->ah_version == AR5K_AR5212) { |
3785 | tx_desc = (struct ath5k_hw_4w_tx_desc *)&desc->ds_ctl0; | 3773 | tx_ctl = &desc->ud.ds_tx5212.tx_ctl; |
3786 | 3774 | ||
3787 | #define _XTX_TRIES(_n) \ | 3775 | #define _XTX_TRIES(_n) \ |
3788 | if (tx_tries##_n) { \ | 3776 | if (tx_tries##_n) { \ |
3789 | tx_desc->tx_control_2 |= \ | 3777 | tx_ctl->tx_control_2 |= \ |
3790 | AR5K_REG_SM(tx_tries##_n, \ | 3778 | AR5K_REG_SM(tx_tries##_n, \ |
3791 | AR5K_4W_TX_DESC_CTL2_XMIT_TRIES##_n); \ | 3779 | AR5K_4W_TX_DESC_CTL2_XMIT_TRIES##_n); \ |
3792 | tx_desc->tx_control_3 |= \ | 3780 | tx_ctl->tx_control_3 |= \ |
3793 | AR5K_REG_SM(tx_rate##_n, \ | 3781 | AR5K_REG_SM(tx_rate##_n, \ |
3794 | AR5K_4W_TX_DESC_CTL3_XMIT_RATE##_n); \ | 3782 | AR5K_4W_TX_DESC_CTL3_XMIT_RATE##_n); \ |
3795 | } | 3783 | } |
@@ -3812,11 +3800,13 @@ ath5k_hw_setup_xr_tx_desc(struct ath5k_hw *ah, struct ath5k_desc *desc, | |||
3812 | static int ath5k_hw_proc_2word_tx_status(struct ath5k_hw *ah, | 3800 | static int ath5k_hw_proc_2word_tx_status(struct ath5k_hw *ah, |
3813 | struct ath5k_desc *desc) | 3801 | struct ath5k_desc *desc) |
3814 | { | 3802 | { |
3803 | struct ath5k_hw_2w_tx_ctl *tx_ctl; | ||
3815 | struct ath5k_hw_tx_status *tx_status; | 3804 | struct ath5k_hw_tx_status *tx_status; |
3816 | struct ath5k_hw_2w_tx_desc *tx_desc; | ||
3817 | 3805 | ||
3818 | tx_desc = (struct ath5k_hw_2w_tx_desc *)&desc->ds_ctl0; | 3806 | ATH5K_TRACE(ah->ah_sc); |
3819 | tx_status = (struct ath5k_hw_tx_status *)&desc->ds_hw[0]; | 3807 | |
3808 | tx_ctl = &desc->ud.ds_tx5210.tx_ctl; | ||
3809 | tx_status = &desc->ud.ds_tx5210.tx_stat; | ||
3820 | 3810 | ||
3821 | /* No frame has been send or error */ | 3811 | /* No frame has been send or error */ |
3822 | if (unlikely((tx_status->tx_status_1 & AR5K_DESC_TX_STATUS1_DONE) == 0)) | 3812 | if (unlikely((tx_status->tx_status_1 & AR5K_DESC_TX_STATUS1_DONE) == 0)) |
@@ -3838,7 +3828,7 @@ static int ath5k_hw_proc_2word_tx_status(struct ath5k_hw *ah, | |||
3838 | AR5K_DESC_TX_STATUS1_ACK_SIG_STRENGTH); | 3828 | AR5K_DESC_TX_STATUS1_ACK_SIG_STRENGTH); |
3839 | desc->ds_us.tx.ts_antenna = 1; | 3829 | desc->ds_us.tx.ts_antenna = 1; |
3840 | desc->ds_us.tx.ts_status = 0; | 3830 | desc->ds_us.tx.ts_status = 0; |
3841 | desc->ds_us.tx.ts_rate = AR5K_REG_MS(tx_desc->tx_control_0, | 3831 | desc->ds_us.tx.ts_rate = AR5K_REG_MS(tx_ctl->tx_control_0, |
3842 | AR5K_2W_TX_DESC_CTL0_XMIT_RATE); | 3832 | AR5K_2W_TX_DESC_CTL0_XMIT_RATE); |
3843 | 3833 | ||
3844 | if ((tx_status->tx_status_0 & AR5K_DESC_TX_STATUS0_FRAME_XMIT_OK) == 0){ | 3834 | if ((tx_status->tx_status_0 & AR5K_DESC_TX_STATUS0_FRAME_XMIT_OK) == 0){ |
@@ -3862,12 +3852,13 @@ static int ath5k_hw_proc_2word_tx_status(struct ath5k_hw *ah, | |||
3862 | static int ath5k_hw_proc_4word_tx_status(struct ath5k_hw *ah, | 3852 | static int ath5k_hw_proc_4word_tx_status(struct ath5k_hw *ah, |
3863 | struct ath5k_desc *desc) | 3853 | struct ath5k_desc *desc) |
3864 | { | 3854 | { |
3855 | struct ath5k_hw_4w_tx_ctl *tx_ctl; | ||
3865 | struct ath5k_hw_tx_status *tx_status; | 3856 | struct ath5k_hw_tx_status *tx_status; |
3866 | struct ath5k_hw_4w_tx_desc *tx_desc; | ||
3867 | 3857 | ||
3868 | ATH5K_TRACE(ah->ah_sc); | 3858 | ATH5K_TRACE(ah->ah_sc); |
3869 | tx_desc = (struct ath5k_hw_4w_tx_desc *)&desc->ds_ctl0; | 3859 | |
3870 | tx_status = (struct ath5k_hw_tx_status *)&desc->ds_hw[2]; | 3860 | tx_ctl = &desc->ud.ds_tx5212.tx_ctl; |
3861 | tx_status = &desc->ud.ds_tx5212.tx_stat; | ||
3871 | 3862 | ||
3872 | /* No frame has been send or error */ | 3863 | /* No frame has been send or error */ |
3873 | if (unlikely((tx_status->tx_status_1 & AR5K_DESC_TX_STATUS1_DONE) == 0)) | 3864 | if (unlikely((tx_status->tx_status_1 & AR5K_DESC_TX_STATUS1_DONE) == 0)) |
@@ -3893,25 +3884,25 @@ static int ath5k_hw_proc_4word_tx_status(struct ath5k_hw *ah, | |||
3893 | switch (AR5K_REG_MS(tx_status->tx_status_1, | 3884 | switch (AR5K_REG_MS(tx_status->tx_status_1, |
3894 | AR5K_DESC_TX_STATUS1_FINAL_TS_INDEX)) { | 3885 | AR5K_DESC_TX_STATUS1_FINAL_TS_INDEX)) { |
3895 | case 0: | 3886 | case 0: |
3896 | desc->ds_us.tx.ts_rate = tx_desc->tx_control_3 & | 3887 | desc->ds_us.tx.ts_rate = tx_ctl->tx_control_3 & |
3897 | AR5K_4W_TX_DESC_CTL3_XMIT_RATE0; | 3888 | AR5K_4W_TX_DESC_CTL3_XMIT_RATE0; |
3898 | break; | 3889 | break; |
3899 | case 1: | 3890 | case 1: |
3900 | desc->ds_us.tx.ts_rate = AR5K_REG_MS(tx_desc->tx_control_3, | 3891 | desc->ds_us.tx.ts_rate = AR5K_REG_MS(tx_ctl->tx_control_3, |
3901 | AR5K_4W_TX_DESC_CTL3_XMIT_RATE1); | 3892 | AR5K_4W_TX_DESC_CTL3_XMIT_RATE1); |
3902 | desc->ds_us.tx.ts_longretry +=AR5K_REG_MS(tx_desc->tx_control_2, | 3893 | desc->ds_us.tx.ts_longretry += AR5K_REG_MS(tx_ctl->tx_control_2, |
3903 | AR5K_4W_TX_DESC_CTL2_XMIT_TRIES1); | 3894 | AR5K_4W_TX_DESC_CTL2_XMIT_TRIES1); |
3904 | break; | 3895 | break; |
3905 | case 2: | 3896 | case 2: |
3906 | desc->ds_us.tx.ts_rate = AR5K_REG_MS(tx_desc->tx_control_3, | 3897 | desc->ds_us.tx.ts_rate = AR5K_REG_MS(tx_ctl->tx_control_3, |
3907 | AR5K_4W_TX_DESC_CTL3_XMIT_RATE2); | 3898 | AR5K_4W_TX_DESC_CTL3_XMIT_RATE2); |
3908 | desc->ds_us.tx.ts_longretry +=AR5K_REG_MS(tx_desc->tx_control_2, | 3899 | desc->ds_us.tx.ts_longretry += AR5K_REG_MS(tx_ctl->tx_control_2, |
3909 | AR5K_4W_TX_DESC_CTL2_XMIT_TRIES2); | 3900 | AR5K_4W_TX_DESC_CTL2_XMIT_TRIES2); |
3910 | break; | 3901 | break; |
3911 | case 3: | 3902 | case 3: |
3912 | desc->ds_us.tx.ts_rate = AR5K_REG_MS(tx_desc->tx_control_3, | 3903 | desc->ds_us.tx.ts_rate = AR5K_REG_MS(tx_ctl->tx_control_3, |
3913 | AR5K_4W_TX_DESC_CTL3_XMIT_RATE3); | 3904 | AR5K_4W_TX_DESC_CTL3_XMIT_RATE3); |
3914 | desc->ds_us.tx.ts_longretry +=AR5K_REG_MS(tx_desc->tx_control_2, | 3905 | desc->ds_us.tx.ts_longretry += AR5K_REG_MS(tx_ctl->tx_control_2, |
3915 | AR5K_4W_TX_DESC_CTL2_XMIT_TRIES3); | 3906 | AR5K_4W_TX_DESC_CTL2_XMIT_TRIES3); |
3916 | break; | 3907 | break; |
3917 | } | 3908 | } |
@@ -3941,31 +3932,27 @@ static int ath5k_hw_proc_4word_tx_status(struct ath5k_hw *ah, | |||
3941 | int ath5k_hw_setup_rx_desc(struct ath5k_hw *ah, struct ath5k_desc *desc, | 3932 | int ath5k_hw_setup_rx_desc(struct ath5k_hw *ah, struct ath5k_desc *desc, |
3942 | u32 size, unsigned int flags) | 3933 | u32 size, unsigned int flags) |
3943 | { | 3934 | { |
3944 | struct ath5k_rx_desc *rx_desc; | 3935 | struct ath5k_hw_rx_ctl *rx_ctl; |
3945 | 3936 | ||
3946 | ATH5K_TRACE(ah->ah_sc); | 3937 | ATH5K_TRACE(ah->ah_sc); |
3947 | rx_desc = (struct ath5k_rx_desc *)&desc->ds_ctl0; | 3938 | rx_ctl = &desc->ud.ds_rx.rx_ctl; |
3948 | 3939 | ||
3949 | /* | 3940 | /* |
3950 | *Clear ds_hw | 3941 | * Clear the descriptor |
3951 | * If we don't clean the status descriptor, | 3942 | * If we don't clean the status descriptor, |
3952 | * while scanning we get too many results, | 3943 | * while scanning we get too many results, |
3953 | * most of them virtual, after some secs | 3944 | * most of them virtual, after some secs |
3954 | * of scanning system hangs. M.F. | 3945 | * of scanning system hangs. M.F. |
3955 | */ | 3946 | */ |
3956 | memset(desc->ds_hw, 0, sizeof(desc->ds_hw)); | 3947 | memset(&desc->ud.ds_rx, 0, sizeof(struct ath5k_hw_all_rx_desc)); |
3957 | |||
3958 | /*Initialize rx descriptor*/ | ||
3959 | rx_desc->rx_control_0 = 0; | ||
3960 | rx_desc->rx_control_1 = 0; | ||
3961 | 3948 | ||
3962 | /* Setup descriptor */ | 3949 | /* Setup descriptor */ |
3963 | rx_desc->rx_control_1 = size & AR5K_DESC_RX_CTL1_BUF_LEN; | 3950 | rx_ctl->rx_control_1 = size & AR5K_DESC_RX_CTL1_BUF_LEN; |
3964 | if (unlikely(rx_desc->rx_control_1 != size)) | 3951 | if (unlikely(rx_ctl->rx_control_1 != size)) |
3965 | return -EINVAL; | 3952 | return -EINVAL; |
3966 | 3953 | ||
3967 | if (flags & AR5K_RXDESC_INTREQ) | 3954 | if (flags & AR5K_RXDESC_INTREQ) |
3968 | rx_desc->rx_control_1 |= AR5K_DESC_RX_CTL1_INTREQ; | 3955 | rx_ctl->rx_control_1 |= AR5K_DESC_RX_CTL1_INTREQ; |
3969 | 3956 | ||
3970 | return 0; | 3957 | return 0; |
3971 | } | 3958 | } |
@@ -3973,15 +3960,15 @@ int ath5k_hw_setup_rx_desc(struct ath5k_hw *ah, struct ath5k_desc *desc, | |||
3973 | /* | 3960 | /* |
3974 | * Proccess the rx status descriptor on 5210/5211 | 3961 | * Proccess the rx status descriptor on 5210/5211 |
3975 | */ | 3962 | */ |
3976 | static int ath5k_hw_proc_old_rx_status(struct ath5k_hw *ah, | 3963 | static int ath5k_hw_proc_5210_rx_status(struct ath5k_hw *ah, |
3977 | struct ath5k_desc *desc) | 3964 | struct ath5k_desc *desc) |
3978 | { | 3965 | { |
3979 | struct ath5k_hw_old_rx_status *rx_status; | 3966 | struct ath5k_hw_rx_status *rx_status; |
3980 | 3967 | ||
3981 | rx_status = (struct ath5k_hw_old_rx_status *)&desc->ds_hw[0]; | 3968 | rx_status = &desc->ud.ds_rx.u.rx_stat; |
3982 | 3969 | ||
3983 | /* No frame received / not ready */ | 3970 | /* No frame received / not ready */ |
3984 | if (unlikely((rx_status->rx_status_1 & AR5K_OLD_RX_DESC_STATUS1_DONE) | 3971 | if (unlikely((rx_status->rx_status_1 & AR5K_5210_RX_DESC_STATUS1_DONE) |
3985 | == 0)) | 3972 | == 0)) |
3986 | return -EINPROGRESS; | 3973 | return -EINPROGRESS; |
3987 | 3974 | ||
@@ -3989,50 +3976,51 @@ static int ath5k_hw_proc_old_rx_status(struct ath5k_hw *ah, | |||
3989 | * Frame receive status | 3976 | * Frame receive status |
3990 | */ | 3977 | */ |
3991 | desc->ds_us.rx.rs_datalen = rx_status->rx_status_0 & | 3978 | desc->ds_us.rx.rs_datalen = rx_status->rx_status_0 & |
3992 | AR5K_OLD_RX_DESC_STATUS0_DATA_LEN; | 3979 | AR5K_5210_RX_DESC_STATUS0_DATA_LEN; |
3993 | desc->ds_us.rx.rs_rssi = AR5K_REG_MS(rx_status->rx_status_0, | 3980 | desc->ds_us.rx.rs_rssi = AR5K_REG_MS(rx_status->rx_status_0, |
3994 | AR5K_OLD_RX_DESC_STATUS0_RECEIVE_SIGNAL); | 3981 | AR5K_5210_RX_DESC_STATUS0_RECEIVE_SIGNAL); |
3995 | desc->ds_us.rx.rs_rate = AR5K_REG_MS(rx_status->rx_status_0, | 3982 | desc->ds_us.rx.rs_rate = AR5K_REG_MS(rx_status->rx_status_0, |
3996 | AR5K_OLD_RX_DESC_STATUS0_RECEIVE_RATE); | 3983 | AR5K_5210_RX_DESC_STATUS0_RECEIVE_RATE); |
3997 | desc->ds_us.rx.rs_antenna = rx_status->rx_status_0 & | 3984 | desc->ds_us.rx.rs_antenna = rx_status->rx_status_0 & |
3998 | AR5K_OLD_RX_DESC_STATUS0_RECEIVE_ANTENNA; | 3985 | AR5K_5210_RX_DESC_STATUS0_RECEIVE_ANTENNA; |
3999 | desc->ds_us.rx.rs_more = rx_status->rx_status_0 & | 3986 | desc->ds_us.rx.rs_more = rx_status->rx_status_0 & |
4000 | AR5K_OLD_RX_DESC_STATUS0_MORE; | 3987 | AR5K_5210_RX_DESC_STATUS0_MORE; |
4001 | desc->ds_us.rx.rs_tstamp = AR5K_REG_MS(rx_status->rx_status_1, | 3988 | desc->ds_us.rx.rs_tstamp = AR5K_REG_MS(rx_status->rx_status_1, |
4002 | AR5K_OLD_RX_DESC_STATUS1_RECEIVE_TIMESTAMP); | 3989 | AR5K_5210_RX_DESC_STATUS1_RECEIVE_TIMESTAMP); |
4003 | desc->ds_us.rx.rs_status = 0; | 3990 | desc->ds_us.rx.rs_status = 0; |
4004 | 3991 | ||
4005 | /* | 3992 | /* |
4006 | * Key table status | 3993 | * Key table status |
4007 | */ | 3994 | */ |
4008 | if (rx_status->rx_status_1 & AR5K_OLD_RX_DESC_STATUS1_KEY_INDEX_VALID) | 3995 | if (rx_status->rx_status_1 & AR5K_5210_RX_DESC_STATUS1_KEY_INDEX_VALID) |
4009 | desc->ds_us.rx.rs_keyix = AR5K_REG_MS(rx_status->rx_status_1, | 3996 | desc->ds_us.rx.rs_keyix = AR5K_REG_MS(rx_status->rx_status_1, |
4010 | AR5K_OLD_RX_DESC_STATUS1_KEY_INDEX); | 3997 | AR5K_5210_RX_DESC_STATUS1_KEY_INDEX); |
4011 | else | 3998 | else |
4012 | desc->ds_us.rx.rs_keyix = AR5K_RXKEYIX_INVALID; | 3999 | desc->ds_us.rx.rs_keyix = AR5K_RXKEYIX_INVALID; |
4013 | 4000 | ||
4014 | /* | 4001 | /* |
4015 | * Receive/descriptor errors | 4002 | * Receive/descriptor errors |
4016 | */ | 4003 | */ |
4017 | if ((rx_status->rx_status_1 & AR5K_OLD_RX_DESC_STATUS1_FRAME_RECEIVE_OK) | 4004 | if ((rx_status->rx_status_1 & |
4018 | == 0) { | 4005 | AR5K_5210_RX_DESC_STATUS1_FRAME_RECEIVE_OK) == 0) { |
4019 | if (rx_status->rx_status_1 & AR5K_OLD_RX_DESC_STATUS1_CRC_ERROR) | 4006 | if (rx_status->rx_status_1 & |
4007 | AR5K_5210_RX_DESC_STATUS1_CRC_ERROR) | ||
4020 | desc->ds_us.rx.rs_status |= AR5K_RXERR_CRC; | 4008 | desc->ds_us.rx.rs_status |= AR5K_RXERR_CRC; |
4021 | 4009 | ||
4022 | if (rx_status->rx_status_1 & | 4010 | if (rx_status->rx_status_1 & |
4023 | AR5K_OLD_RX_DESC_STATUS1_FIFO_OVERRUN) | 4011 | AR5K_5210_RX_DESC_STATUS1_FIFO_OVERRUN) |
4024 | desc->ds_us.rx.rs_status |= AR5K_RXERR_FIFO; | 4012 | desc->ds_us.rx.rs_status |= AR5K_RXERR_FIFO; |
4025 | 4013 | ||
4026 | if (rx_status->rx_status_1 & | 4014 | if (rx_status->rx_status_1 & |
4027 | AR5K_OLD_RX_DESC_STATUS1_PHY_ERROR) { | 4015 | AR5K_5210_RX_DESC_STATUS1_PHY_ERROR) { |
4028 | desc->ds_us.rx.rs_status |= AR5K_RXERR_PHY; | 4016 | desc->ds_us.rx.rs_status |= AR5K_RXERR_PHY; |
4029 | desc->ds_us.rx.rs_phyerr = | 4017 | desc->ds_us.rx.rs_phyerr = |
4030 | AR5K_REG_MS(rx_status->rx_status_1, | 4018 | AR5K_REG_MS(rx_status->rx_status_1, |
4031 | AR5K_OLD_RX_DESC_STATUS1_PHY_ERROR); | 4019 | AR5K_5210_RX_DESC_STATUS1_PHY_ERROR); |
4032 | } | 4020 | } |
4033 | 4021 | ||
4034 | if (rx_status->rx_status_1 & | 4022 | if (rx_status->rx_status_1 & |
4035 | AR5K_OLD_RX_DESC_STATUS1_DECRYPT_CRC_ERROR) | 4023 | AR5K_5210_RX_DESC_STATUS1_DECRYPT_CRC_ERROR) |
4036 | desc->ds_us.rx.rs_status |= AR5K_RXERR_DECRYPT; | 4024 | desc->ds_us.rx.rs_status |= AR5K_RXERR_DECRYPT; |
4037 | } | 4025 | } |
4038 | 4026 | ||
@@ -4042,20 +4030,20 @@ static int ath5k_hw_proc_old_rx_status(struct ath5k_hw *ah, | |||
4042 | /* | 4030 | /* |
4043 | * Proccess the rx status descriptor on 5212 | 4031 | * Proccess the rx status descriptor on 5212 |
4044 | */ | 4032 | */ |
4045 | static int ath5k_hw_proc_new_rx_status(struct ath5k_hw *ah, | 4033 | static int ath5k_hw_proc_5212_rx_status(struct ath5k_hw *ah, |
4046 | struct ath5k_desc *desc) | 4034 | struct ath5k_desc *desc) |
4047 | { | 4035 | { |
4048 | struct ath5k_hw_new_rx_status *rx_status; | 4036 | struct ath5k_hw_rx_status *rx_status; |
4049 | struct ath5k_hw_rx_error *rx_err; | 4037 | struct ath5k_hw_rx_error *rx_err; |
4050 | 4038 | ||
4051 | ATH5K_TRACE(ah->ah_sc); | 4039 | ATH5K_TRACE(ah->ah_sc); |
4052 | rx_status = (struct ath5k_hw_new_rx_status *)&desc->ds_hw[0]; | 4040 | rx_status = &desc->ud.ds_rx.u.rx_stat; |
4053 | 4041 | ||
4054 | /* Overlay on error */ | 4042 | /* Overlay on error */ |
4055 | rx_err = (struct ath5k_hw_rx_error *)&desc->ds_hw[0]; | 4043 | rx_err = &desc->ud.ds_rx.u.rx_err; |
4056 | 4044 | ||
4057 | /* No frame received / not ready */ | 4045 | /* No frame received / not ready */ |
4058 | if (unlikely((rx_status->rx_status_1 & AR5K_NEW_RX_DESC_STATUS1_DONE) | 4046 | if (unlikely((rx_status->rx_status_1 & AR5K_5212_RX_DESC_STATUS1_DONE) |
4059 | == 0)) | 4047 | == 0)) |
4060 | return -EINPROGRESS; | 4048 | return -EINPROGRESS; |
4061 | 4049 | ||
@@ -4063,25 +4051,25 @@ static int ath5k_hw_proc_new_rx_status(struct ath5k_hw *ah, | |||
4063 | * Frame receive status | 4051 | * Frame receive status |
4064 | */ | 4052 | */ |
4065 | desc->ds_us.rx.rs_datalen = rx_status->rx_status_0 & | 4053 | desc->ds_us.rx.rs_datalen = rx_status->rx_status_0 & |
4066 | AR5K_NEW_RX_DESC_STATUS0_DATA_LEN; | 4054 | AR5K_5212_RX_DESC_STATUS0_DATA_LEN; |
4067 | desc->ds_us.rx.rs_rssi = AR5K_REG_MS(rx_status->rx_status_0, | 4055 | desc->ds_us.rx.rs_rssi = AR5K_REG_MS(rx_status->rx_status_0, |
4068 | AR5K_NEW_RX_DESC_STATUS0_RECEIVE_SIGNAL); | 4056 | AR5K_5212_RX_DESC_STATUS0_RECEIVE_SIGNAL); |
4069 | desc->ds_us.rx.rs_rate = AR5K_REG_MS(rx_status->rx_status_0, | 4057 | desc->ds_us.rx.rs_rate = AR5K_REG_MS(rx_status->rx_status_0, |
4070 | AR5K_NEW_RX_DESC_STATUS0_RECEIVE_RATE); | 4058 | AR5K_5212_RX_DESC_STATUS0_RECEIVE_RATE); |
4071 | desc->ds_us.rx.rs_antenna = rx_status->rx_status_0 & | 4059 | desc->ds_us.rx.rs_antenna = rx_status->rx_status_0 & |
4072 | AR5K_NEW_RX_DESC_STATUS0_RECEIVE_ANTENNA; | 4060 | AR5K_5212_RX_DESC_STATUS0_RECEIVE_ANTENNA; |
4073 | desc->ds_us.rx.rs_more = rx_status->rx_status_0 & | 4061 | desc->ds_us.rx.rs_more = rx_status->rx_status_0 & |
4074 | AR5K_NEW_RX_DESC_STATUS0_MORE; | 4062 | AR5K_5212_RX_DESC_STATUS0_MORE; |
4075 | desc->ds_us.rx.rs_tstamp = AR5K_REG_MS(rx_status->rx_status_1, | 4063 | desc->ds_us.rx.rs_tstamp = AR5K_REG_MS(rx_status->rx_status_1, |
4076 | AR5K_NEW_RX_DESC_STATUS1_RECEIVE_TIMESTAMP); | 4064 | AR5K_5212_RX_DESC_STATUS1_RECEIVE_TIMESTAMP); |
4077 | desc->ds_us.rx.rs_status = 0; | 4065 | desc->ds_us.rx.rs_status = 0; |
4078 | 4066 | ||
4079 | /* | 4067 | /* |
4080 | * Key table status | 4068 | * Key table status |
4081 | */ | 4069 | */ |
4082 | if (rx_status->rx_status_1 & AR5K_NEW_RX_DESC_STATUS1_KEY_INDEX_VALID) | 4070 | if (rx_status->rx_status_1 & AR5K_5212_RX_DESC_STATUS1_KEY_INDEX_VALID) |
4083 | desc->ds_us.rx.rs_keyix = AR5K_REG_MS(rx_status->rx_status_1, | 4071 | desc->ds_us.rx.rs_keyix = AR5K_REG_MS(rx_status->rx_status_1, |
4084 | AR5K_NEW_RX_DESC_STATUS1_KEY_INDEX); | 4072 | AR5K_5212_RX_DESC_STATUS1_KEY_INDEX); |
4085 | else | 4073 | else |
4086 | desc->ds_us.rx.rs_keyix = AR5K_RXKEYIX_INVALID; | 4074 | desc->ds_us.rx.rs_keyix = AR5K_RXKEYIX_INVALID; |
4087 | 4075 | ||
@@ -4089,12 +4077,13 @@ static int ath5k_hw_proc_new_rx_status(struct ath5k_hw *ah, | |||
4089 | * Receive/descriptor errors | 4077 | * Receive/descriptor errors |
4090 | */ | 4078 | */ |
4091 | if ((rx_status->rx_status_1 & | 4079 | if ((rx_status->rx_status_1 & |
4092 | AR5K_NEW_RX_DESC_STATUS1_FRAME_RECEIVE_OK) == 0) { | 4080 | AR5K_5212_RX_DESC_STATUS1_FRAME_RECEIVE_OK) == 0) { |
4093 | if (rx_status->rx_status_1 & AR5K_NEW_RX_DESC_STATUS1_CRC_ERROR) | 4081 | if (rx_status->rx_status_1 & |
4082 | AR5K_5212_RX_DESC_STATUS1_CRC_ERROR) | ||
4094 | desc->ds_us.rx.rs_status |= AR5K_RXERR_CRC; | 4083 | desc->ds_us.rx.rs_status |= AR5K_RXERR_CRC; |
4095 | 4084 | ||
4096 | if (rx_status->rx_status_1 & | 4085 | if (rx_status->rx_status_1 & |
4097 | AR5K_NEW_RX_DESC_STATUS1_PHY_ERROR) { | 4086 | AR5K_5212_RX_DESC_STATUS1_PHY_ERROR) { |
4098 | desc->ds_us.rx.rs_status |= AR5K_RXERR_PHY; | 4087 | desc->ds_us.rx.rs_status |= AR5K_RXERR_PHY; |
4099 | desc->ds_us.rx.rs_phyerr = | 4088 | desc->ds_us.rx.rs_phyerr = |
4100 | AR5K_REG_MS(rx_err->rx_error_1, | 4089 | AR5K_REG_MS(rx_err->rx_error_1, |
@@ -4102,10 +4091,11 @@ static int ath5k_hw_proc_new_rx_status(struct ath5k_hw *ah, | |||
4102 | } | 4091 | } |
4103 | 4092 | ||
4104 | if (rx_status->rx_status_1 & | 4093 | if (rx_status->rx_status_1 & |
4105 | AR5K_NEW_RX_DESC_STATUS1_DECRYPT_CRC_ERROR) | 4094 | AR5K_5212_RX_DESC_STATUS1_DECRYPT_CRC_ERROR) |
4106 | desc->ds_us.rx.rs_status |= AR5K_RXERR_DECRYPT; | 4095 | desc->ds_us.rx.rs_status |= AR5K_RXERR_DECRYPT; |
4107 | 4096 | ||
4108 | if (rx_status->rx_status_1 & AR5K_NEW_RX_DESC_STATUS1_MIC_ERROR) | 4097 | if (rx_status->rx_status_1 & |
4098 | AR5K_5212_RX_DESC_STATUS1_MIC_ERROR) | ||
4109 | desc->ds_us.rx.rs_status |= AR5K_RXERR_MIC; | 4099 | desc->ds_us.rx.rs_status |= AR5K_RXERR_MIC; |
4110 | } | 4100 | } |
4111 | 4101 | ||