Loading drivers/bcma/main.c +1 −0 Original line number Original line Diff line number Diff line Loading @@ -7,6 +7,7 @@ #include "bcma_private.h" #include "bcma_private.h" #include <linux/bcma/bcma.h> #include <linux/bcma/bcma.h> #include <linux/slab.h> MODULE_DESCRIPTION("Broadcom's specific AMBA driver"); MODULE_DESCRIPTION("Broadcom's specific AMBA driver"); MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL"); Loading drivers/net/wireless/ath/ath9k/ar9003_mac.c +6 −2 Original line number Original line Diff line number Diff line Loading @@ -229,6 +229,7 @@ static void ar9003_hw_fill_txdesc(struct ath_hw *ah, void *ds, u32 seglen, static int ar9003_hw_proc_txdesc(struct ath_hw *ah, void *ds, static int ar9003_hw_proc_txdesc(struct ath_hw *ah, void *ds, struct ath_tx_status *ts) struct ath_tx_status *ts) { { struct ar9003_txc *txc = (struct ar9003_txc *) ds; struct ar9003_txs *ads; struct ar9003_txs *ads; u32 status; u32 status; Loading @@ -238,7 +239,11 @@ static int ar9003_hw_proc_txdesc(struct ath_hw *ah, void *ds, if ((status & AR_TxDone) == 0) if ((status & AR_TxDone) == 0) return -EINPROGRESS; return -EINPROGRESS; ts->qid = MS(ads->ds_info, AR_TxQcuNum); if (!txc || (MS(txc->info, AR_TxQcuNum) == ts->qid)) ah->ts_tail = (ah->ts_tail + 1) % ah->ts_size; ah->ts_tail = (ah->ts_tail + 1) % ah->ts_size; else return -ENOENT; if ((MS(ads->ds_info, AR_DescId) != ATHEROS_VENDOR_ID) || if ((MS(ads->ds_info, AR_DescId) != ATHEROS_VENDOR_ID) || (MS(ads->ds_info, AR_TxRxDesc) != 1)) { (MS(ads->ds_info, AR_TxRxDesc) != 1)) { Loading @@ -254,7 +259,6 @@ static int ar9003_hw_proc_txdesc(struct ath_hw *ah, void *ds, ts->ts_seqnum = MS(status, AR_SeqNum); ts->ts_seqnum = MS(status, AR_SeqNum); ts->tid = MS(status, AR_TxTid); ts->tid = MS(status, AR_TxTid); ts->qid = MS(ads->ds_info, AR_TxQcuNum); ts->desc_id = MS(ads->status1, AR_TxDescId); ts->desc_id = MS(ads->status1, AR_TxDescId); ts->ts_tstamp = ads->status4; ts->ts_tstamp = ads->status4; ts->ts_status = 0; ts->ts_status = 0; Loading drivers/net/wireless/ath/ath9k/ar9003_paprd.c +26 −12 Original line number Original line Diff line number Diff line Loading @@ -236,7 +236,7 @@ static void ar9003_paprd_get_gain_table(struct ath_hw *ah) memset(entry, 0, sizeof(ah->paprd_gain_table_entries)); memset(entry, 0, sizeof(ah->paprd_gain_table_entries)); memset(index, 0, sizeof(ah->paprd_gain_table_index)); memset(index, 0, sizeof(ah->paprd_gain_table_index)); for (i = 0; i < 32; i++) { for (i = 0; i < PAPRD_GAIN_TABLE_ENTRIES; i++) { entry[i] = REG_READ(ah, reg); entry[i] = REG_READ(ah, reg); index[i] = (entry[i] >> 24) & 0xff; index[i] = (entry[i] >> 24) & 0xff; reg += 4; reg += 4; Loading @@ -246,13 +246,13 @@ static void ar9003_paprd_get_gain_table(struct ath_hw *ah) static unsigned int ar9003_get_desired_gain(struct ath_hw *ah, int chain, static unsigned int ar9003_get_desired_gain(struct ath_hw *ah, int chain, int target_power) int target_power) { { int olpc_gain_delta = 0; int olpc_gain_delta = 0, cl_gain_mod; int alpha_therm, alpha_volt; int alpha_therm, alpha_volt; int therm_cal_value, volt_cal_value; int therm_cal_value, volt_cal_value; int therm_value, volt_value; int therm_value, volt_value; int thermal_gain_corr, voltage_gain_corr; int thermal_gain_corr, voltage_gain_corr; int desired_scale, desired_gain = 0; int desired_scale, desired_gain = 0; u32 reg; u32 reg_olpc = 0, reg_cl_gain = 0; REG_CLR_BIT(ah, AR_PHY_PAPRD_TRAINER_STAT1, REG_CLR_BIT(ah, AR_PHY_PAPRD_TRAINER_STAT1, AR_PHY_PAPRD_TRAINER_STAT1_PAPRD_TRAIN_DONE); AR_PHY_PAPRD_TRAINER_STAT1_PAPRD_TRAIN_DONE); Loading @@ -271,15 +271,29 @@ static unsigned int ar9003_get_desired_gain(struct ath_hw *ah, int chain, volt_value = REG_READ_FIELD(ah, AR_PHY_BB_THERM_ADC_4, volt_value = REG_READ_FIELD(ah, AR_PHY_BB_THERM_ADC_4, AR_PHY_BB_THERM_ADC_4_LATEST_VOLT_VALUE); AR_PHY_BB_THERM_ADC_4_LATEST_VOLT_VALUE); if (chain == 0) switch (chain) { reg = AR_PHY_TPC_11_B0; case 0: else if (chain == 1) reg_olpc = AR_PHY_TPC_11_B0; reg = AR_PHY_TPC_11_B1; reg_cl_gain = AR_PHY_CL_TAB_0; else break; reg = AR_PHY_TPC_11_B2; case 1: reg_olpc = AR_PHY_TPC_11_B1; reg_cl_gain = AR_PHY_CL_TAB_1; break; case 2: reg_olpc = AR_PHY_TPC_11_B2; reg_cl_gain = AR_PHY_CL_TAB_2; break; default: ath_dbg(ath9k_hw_common(ah), ATH_DBG_CALIBRATE, "Invalid chainmask: %d\n", chain); break; } olpc_gain_delta = REG_READ_FIELD(ah, reg, olpc_gain_delta = REG_READ_FIELD(ah, reg_olpc, AR_PHY_TPC_11_OLPC_GAIN_DELTA); AR_PHY_TPC_11_OLPC_GAIN_DELTA); cl_gain_mod = REG_READ_FIELD(ah, reg_cl_gain, AR_PHY_CL_TAB_CL_GAIN_MOD); if (olpc_gain_delta >= 128) if (olpc_gain_delta >= 128) olpc_gain_delta = olpc_gain_delta - 256; olpc_gain_delta = olpc_gain_delta - 256; Loading @@ -289,7 +303,7 @@ static unsigned int ar9003_get_desired_gain(struct ath_hw *ah, int chain, voltage_gain_corr = (alpha_volt * (volt_value - volt_cal_value) + voltage_gain_corr = (alpha_volt * (volt_value - volt_cal_value) + (128 / 2)) / 128; (128 / 2)) / 128; desired_gain = target_power - olpc_gain_delta - thermal_gain_corr - desired_gain = target_power - olpc_gain_delta - thermal_gain_corr - voltage_gain_corr + desired_scale; voltage_gain_corr + desired_scale + cl_gain_mod; return desired_gain; return desired_gain; } } Loading Loading @@ -727,7 +741,7 @@ int ar9003_paprd_setup_gain_table(struct ath_hw *ah, int chain) desired_gain = ar9003_get_desired_gain(ah, chain, train_power); desired_gain = ar9003_get_desired_gain(ah, chain, train_power); gain_index = 0; gain_index = 0; for (i = 0; i < 32; i++) { for (i = 0; i < PAPRD_GAIN_TABLE_ENTRIES; i++) { if (ah->paprd_gain_table_index[i] >= desired_gain) if (ah->paprd_gain_table_index[i] >= desired_gain) break; break; gain_index++; gain_index++; Loading drivers/net/wireless/ath/ath9k/ar9003_phy.h +3 −0 Original line number Original line Diff line number Diff line Loading @@ -1121,6 +1121,9 @@ #define AR_PHY_POWERTX_RATE8_POWERTXHT40_5 0x3F00 #define AR_PHY_POWERTX_RATE8_POWERTXHT40_5 0x3F00 #define AR_PHY_POWERTX_RATE8_POWERTXHT40_5_S 8 #define AR_PHY_POWERTX_RATE8_POWERTXHT40_5_S 8 #define AR_PHY_CL_TAB_CL_GAIN_MOD 0x1f #define AR_PHY_CL_TAB_CL_GAIN_MOD_S 0 void ar9003_hw_set_chain_masks(struct ath_hw *ah, u8 rx, u8 tx); void ar9003_hw_set_chain_masks(struct ath_hw *ah, u8 rx, u8 tx); #endif /* AR9003_PHY_H */ #endif /* AR9003_PHY_H */ drivers/net/wireless/ath/ath9k/ath9k.h +5 −0 Original line number Original line Diff line number Diff line Loading @@ -101,6 +101,11 @@ enum buffer_type { #define ATH_TXSTATUS_RING_SIZE 64 #define ATH_TXSTATUS_RING_SIZE 64 #define DS2PHYS(_dd, _ds) \ ((_dd)->dd_desc_paddr + ((caddr_t)(_ds) - (caddr_t)(_dd)->dd_desc)) #define ATH_DESC_4KB_BOUND_CHECK(_daddr) ((((_daddr) & 0xFFF) > 0xF7F) ? 1 : 0) #define ATH_DESC_4KB_BOUND_NUM_SKIPPED(_len) ((_len) / 4096) struct ath_descdma { struct ath_descdma { void *dd_desc; void *dd_desc; dma_addr_t dd_desc_paddr; dma_addr_t dd_desc_paddr; Loading Loading
drivers/bcma/main.c +1 −0 Original line number Original line Diff line number Diff line Loading @@ -7,6 +7,7 @@ #include "bcma_private.h" #include "bcma_private.h" #include <linux/bcma/bcma.h> #include <linux/bcma/bcma.h> #include <linux/slab.h> MODULE_DESCRIPTION("Broadcom's specific AMBA driver"); MODULE_DESCRIPTION("Broadcom's specific AMBA driver"); MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL"); Loading
drivers/net/wireless/ath/ath9k/ar9003_mac.c +6 −2 Original line number Original line Diff line number Diff line Loading @@ -229,6 +229,7 @@ static void ar9003_hw_fill_txdesc(struct ath_hw *ah, void *ds, u32 seglen, static int ar9003_hw_proc_txdesc(struct ath_hw *ah, void *ds, static int ar9003_hw_proc_txdesc(struct ath_hw *ah, void *ds, struct ath_tx_status *ts) struct ath_tx_status *ts) { { struct ar9003_txc *txc = (struct ar9003_txc *) ds; struct ar9003_txs *ads; struct ar9003_txs *ads; u32 status; u32 status; Loading @@ -238,7 +239,11 @@ static int ar9003_hw_proc_txdesc(struct ath_hw *ah, void *ds, if ((status & AR_TxDone) == 0) if ((status & AR_TxDone) == 0) return -EINPROGRESS; return -EINPROGRESS; ts->qid = MS(ads->ds_info, AR_TxQcuNum); if (!txc || (MS(txc->info, AR_TxQcuNum) == ts->qid)) ah->ts_tail = (ah->ts_tail + 1) % ah->ts_size; ah->ts_tail = (ah->ts_tail + 1) % ah->ts_size; else return -ENOENT; if ((MS(ads->ds_info, AR_DescId) != ATHEROS_VENDOR_ID) || if ((MS(ads->ds_info, AR_DescId) != ATHEROS_VENDOR_ID) || (MS(ads->ds_info, AR_TxRxDesc) != 1)) { (MS(ads->ds_info, AR_TxRxDesc) != 1)) { Loading @@ -254,7 +259,6 @@ static int ar9003_hw_proc_txdesc(struct ath_hw *ah, void *ds, ts->ts_seqnum = MS(status, AR_SeqNum); ts->ts_seqnum = MS(status, AR_SeqNum); ts->tid = MS(status, AR_TxTid); ts->tid = MS(status, AR_TxTid); ts->qid = MS(ads->ds_info, AR_TxQcuNum); ts->desc_id = MS(ads->status1, AR_TxDescId); ts->desc_id = MS(ads->status1, AR_TxDescId); ts->ts_tstamp = ads->status4; ts->ts_tstamp = ads->status4; ts->ts_status = 0; ts->ts_status = 0; Loading
drivers/net/wireless/ath/ath9k/ar9003_paprd.c +26 −12 Original line number Original line Diff line number Diff line Loading @@ -236,7 +236,7 @@ static void ar9003_paprd_get_gain_table(struct ath_hw *ah) memset(entry, 0, sizeof(ah->paprd_gain_table_entries)); memset(entry, 0, sizeof(ah->paprd_gain_table_entries)); memset(index, 0, sizeof(ah->paprd_gain_table_index)); memset(index, 0, sizeof(ah->paprd_gain_table_index)); for (i = 0; i < 32; i++) { for (i = 0; i < PAPRD_GAIN_TABLE_ENTRIES; i++) { entry[i] = REG_READ(ah, reg); entry[i] = REG_READ(ah, reg); index[i] = (entry[i] >> 24) & 0xff; index[i] = (entry[i] >> 24) & 0xff; reg += 4; reg += 4; Loading @@ -246,13 +246,13 @@ static void ar9003_paprd_get_gain_table(struct ath_hw *ah) static unsigned int ar9003_get_desired_gain(struct ath_hw *ah, int chain, static unsigned int ar9003_get_desired_gain(struct ath_hw *ah, int chain, int target_power) int target_power) { { int olpc_gain_delta = 0; int olpc_gain_delta = 0, cl_gain_mod; int alpha_therm, alpha_volt; int alpha_therm, alpha_volt; int therm_cal_value, volt_cal_value; int therm_cal_value, volt_cal_value; int therm_value, volt_value; int therm_value, volt_value; int thermal_gain_corr, voltage_gain_corr; int thermal_gain_corr, voltage_gain_corr; int desired_scale, desired_gain = 0; int desired_scale, desired_gain = 0; u32 reg; u32 reg_olpc = 0, reg_cl_gain = 0; REG_CLR_BIT(ah, AR_PHY_PAPRD_TRAINER_STAT1, REG_CLR_BIT(ah, AR_PHY_PAPRD_TRAINER_STAT1, AR_PHY_PAPRD_TRAINER_STAT1_PAPRD_TRAIN_DONE); AR_PHY_PAPRD_TRAINER_STAT1_PAPRD_TRAIN_DONE); Loading @@ -271,15 +271,29 @@ static unsigned int ar9003_get_desired_gain(struct ath_hw *ah, int chain, volt_value = REG_READ_FIELD(ah, AR_PHY_BB_THERM_ADC_4, volt_value = REG_READ_FIELD(ah, AR_PHY_BB_THERM_ADC_4, AR_PHY_BB_THERM_ADC_4_LATEST_VOLT_VALUE); AR_PHY_BB_THERM_ADC_4_LATEST_VOLT_VALUE); if (chain == 0) switch (chain) { reg = AR_PHY_TPC_11_B0; case 0: else if (chain == 1) reg_olpc = AR_PHY_TPC_11_B0; reg = AR_PHY_TPC_11_B1; reg_cl_gain = AR_PHY_CL_TAB_0; else break; reg = AR_PHY_TPC_11_B2; case 1: reg_olpc = AR_PHY_TPC_11_B1; reg_cl_gain = AR_PHY_CL_TAB_1; break; case 2: reg_olpc = AR_PHY_TPC_11_B2; reg_cl_gain = AR_PHY_CL_TAB_2; break; default: ath_dbg(ath9k_hw_common(ah), ATH_DBG_CALIBRATE, "Invalid chainmask: %d\n", chain); break; } olpc_gain_delta = REG_READ_FIELD(ah, reg, olpc_gain_delta = REG_READ_FIELD(ah, reg_olpc, AR_PHY_TPC_11_OLPC_GAIN_DELTA); AR_PHY_TPC_11_OLPC_GAIN_DELTA); cl_gain_mod = REG_READ_FIELD(ah, reg_cl_gain, AR_PHY_CL_TAB_CL_GAIN_MOD); if (olpc_gain_delta >= 128) if (olpc_gain_delta >= 128) olpc_gain_delta = olpc_gain_delta - 256; olpc_gain_delta = olpc_gain_delta - 256; Loading @@ -289,7 +303,7 @@ static unsigned int ar9003_get_desired_gain(struct ath_hw *ah, int chain, voltage_gain_corr = (alpha_volt * (volt_value - volt_cal_value) + voltage_gain_corr = (alpha_volt * (volt_value - volt_cal_value) + (128 / 2)) / 128; (128 / 2)) / 128; desired_gain = target_power - olpc_gain_delta - thermal_gain_corr - desired_gain = target_power - olpc_gain_delta - thermal_gain_corr - voltage_gain_corr + desired_scale; voltage_gain_corr + desired_scale + cl_gain_mod; return desired_gain; return desired_gain; } } Loading Loading @@ -727,7 +741,7 @@ int ar9003_paprd_setup_gain_table(struct ath_hw *ah, int chain) desired_gain = ar9003_get_desired_gain(ah, chain, train_power); desired_gain = ar9003_get_desired_gain(ah, chain, train_power); gain_index = 0; gain_index = 0; for (i = 0; i < 32; i++) { for (i = 0; i < PAPRD_GAIN_TABLE_ENTRIES; i++) { if (ah->paprd_gain_table_index[i] >= desired_gain) if (ah->paprd_gain_table_index[i] >= desired_gain) break; break; gain_index++; gain_index++; Loading
drivers/net/wireless/ath/ath9k/ar9003_phy.h +3 −0 Original line number Original line Diff line number Diff line Loading @@ -1121,6 +1121,9 @@ #define AR_PHY_POWERTX_RATE8_POWERTXHT40_5 0x3F00 #define AR_PHY_POWERTX_RATE8_POWERTXHT40_5 0x3F00 #define AR_PHY_POWERTX_RATE8_POWERTXHT40_5_S 8 #define AR_PHY_POWERTX_RATE8_POWERTXHT40_5_S 8 #define AR_PHY_CL_TAB_CL_GAIN_MOD 0x1f #define AR_PHY_CL_TAB_CL_GAIN_MOD_S 0 void ar9003_hw_set_chain_masks(struct ath_hw *ah, u8 rx, u8 tx); void ar9003_hw_set_chain_masks(struct ath_hw *ah, u8 rx, u8 tx); #endif /* AR9003_PHY_H */ #endif /* AR9003_PHY_H */
drivers/net/wireless/ath/ath9k/ath9k.h +5 −0 Original line number Original line Diff line number Diff line Loading @@ -101,6 +101,11 @@ enum buffer_type { #define ATH_TXSTATUS_RING_SIZE 64 #define ATH_TXSTATUS_RING_SIZE 64 #define DS2PHYS(_dd, _ds) \ ((_dd)->dd_desc_paddr + ((caddr_t)(_ds) - (caddr_t)(_dd)->dd_desc)) #define ATH_DESC_4KB_BOUND_CHECK(_daddr) ((((_daddr) & 0xFFF) > 0xF7F) ? 1 : 0) #define ATH_DESC_4KB_BOUND_NUM_SKIPPED(_len) ((_len) / 4096) struct ath_descdma { struct ath_descdma { void *dd_desc; void *dd_desc; dma_addr_t dd_desc_paddr; dma_addr_t dd_desc_paddr; Loading