diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2022-01-12 11:18:49 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2022-01-12 11:18:49 -0800 |
commit | 22ef12195e13c5ec58320dbf99ef85059a2c0820 (patch) | |
tree | 12f57c3a89d7784060b7a7665e1bf882a56376b2 /drivers/staging/vt6655/rf.c | |
parent | 6dc69d3d0d18d587ab9d809fe060ba4417cf0279 (diff) | |
parent | fa783154524a71ab74e293cd8251155e5971952b (diff) |
Merge tag 'staging-5.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging
Pull staging driver updates from Greg KH:
"Here's the big set of staging driver updates for 5.17-rc1
Nothing major in here at all, just lots and lots of tiny cleanups.
Overall more code was removed than added, which is always nice, but
not a huge change.
Majority of the work happened in the r8188eu driver, that had hundreds
of cleanups happen on it, but almost all other staging drivers had
cleanups as well. No new functionality was added, cleanups only.
All of these have been in linux-next for a while with no reported
problems"
* tag 'staging-5.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (308 commits)
staging: r8188eu: rename camelcase variable uintPeerChannel
staging: r8188eu: make BW20_24G_Diff a 1-D array
staging: r8188eu: make OFDM_24G_Diff a 1-D array
staging: r8188eu: BW40_24G_Diff is set but not used
staging: r8188eu: CCK_24G_Diff is set but not used
staging: r8188eu: make Index24G_BW40_Base a 1-D array
staging: r8188eu: make Index24G_CCK_Base a 1-D array
staging: r8188eu: rfPath is always 0
staging: r8188eu: remove unneeded parameter from rtl8188e_SetHalODMVar
staging: pi433: add comment to rx_lock mutex definition
staging: pi433: fix frequency deviation check
staging: vc04_services: rename BM2835 to BCM2835 in headers comments
staging: vc04_services: rename string literal containing bm2835_* to bcm2835*_
staging: vc04_services: rename variables containing bm2835_* to bcm2835_*
staging: vc04_services: rename functions containing bm2835_* to bcm2835_*
staging: vc04_services: rename structures bm2835_mmal_dev and bm2835_mmal_v4l2_ctrl
staging: greybus: audio: Check null pointer
staging: r8188eu: add spaces around P2P_AP_P2P_CH_SWITCH_PROCESS_WK
staging: r8188eu: turbo scan is always off for r8188eu
staging: r8188eu: cmd_issued_cnt is set but not used
...
Diffstat (limited to 'drivers/staging/vt6655/rf.c')
-rw-r--r-- | drivers/staging/vt6655/rf.c | 54 |
1 files changed, 23 insertions, 31 deletions
diff --git a/drivers/staging/vt6655/rf.c b/drivers/staging/vt6655/rf.c index bc4abe77db7b..ba7056f5a5da 100644 --- a/drivers/staging/vt6655/rf.c +++ b/drivers/staging/vt6655/rf.c @@ -609,11 +609,11 @@ bool RFbInit(struct vnt_private *priv) switch (priv->byRFType) { case RF_AIROHA: case RF_AL2230S: - priv->byMaxPwrLevel = AL2230_PWR_IDX_LEN; + priv->max_pwr_level = AL2230_PWR_IDX_LEN; ret = RFbAL2230Init(priv); break; case RF_AIROHA7230: - priv->byMaxPwrLevel = AL7230_PWR_IDX_LEN; + priv->max_pwr_level = AL7230_PWR_IDX_LEN; ret = s_bAL7230Init(priv); break; case RF_NOTHING: @@ -669,20 +669,22 @@ bool RFbSelectChannel(struct vnt_private *priv, unsigned char byRFType, * * Parameters: * In: - * iobase - I/O base address - * channel - channel number - * bySleepCnt - SleepProgSyn count + * priv - Device Structure + * rf_type - RF type + * channel - Channel number * - * Return Value: None. + * Return Value: true if succeeded; false if failed. * */ -bool RFvWriteWakeProgSyn(struct vnt_private *priv, unsigned char rf_type, - u16 channel) +bool rf_write_wake_prog_syn(struct vnt_private *priv, unsigned char rf_type, + u16 channel) { void __iomem *iobase = priv->port_offset; int i; unsigned char init_count = 0; unsigned char sleep_count = 0; + unsigned short idx = MISCFIFO_SYNDATA_IDX; + const unsigned long *init_table; VNSvOutPortW(iobase + MAC_REG_MISCFFNDEX, 0); switch (rf_type) { @@ -695,15 +697,12 @@ bool RFvWriteWakeProgSyn(struct vnt_private *priv, unsigned char rf_type, /* Init Reg + Channel Reg (2) */ init_count = CB_AL2230_INIT_SEQ + 2; sleep_count = 0; - if (init_count > (MISCFIFO_SYNDATASIZE - sleep_count)) - return false; for (i = 0; i < CB_AL2230_INIT_SEQ; i++) - MACvSetMISCFifo(priv, (unsigned short)(MISCFIFO_SYNDATA_IDX + i), al2230_init_table[i]); + MACvSetMISCFifo(priv, idx++, al2230_init_table[i]); - MACvSetMISCFifo(priv, (unsigned short)(MISCFIFO_SYNDATA_IDX + i), al2230_channel_table0[channel - 1]); - i++; - MACvSetMISCFifo(priv, (unsigned short)(MISCFIFO_SYNDATA_IDX + i), al2230_channel_table1[channel - 1]); + MACvSetMISCFifo(priv, idx++, al2230_channel_table0[channel - 1]); + MACvSetMISCFifo(priv, idx++, al2230_channel_table1[channel - 1]); break; /* Need to check, PLLON need to be low for channel setting */ @@ -711,22 +710,15 @@ bool RFvWriteWakeProgSyn(struct vnt_private *priv, unsigned char rf_type, /* Init Reg + Channel Reg (3) */ init_count = CB_AL7230_INIT_SEQ + 3; sleep_count = 0; - if (init_count > (MISCFIFO_SYNDATASIZE - sleep_count)) - return false; - if (channel <= CB_MAX_CHANNEL_24G) { - for (i = 0; i < CB_AL7230_INIT_SEQ; i++) - MACvSetMISCFifo(priv, (unsigned short)(MISCFIFO_SYNDATA_IDX + i), al7230_init_table[i]); - } else { - for (i = 0; i < CB_AL7230_INIT_SEQ; i++) - MACvSetMISCFifo(priv, (unsigned short)(MISCFIFO_SYNDATA_IDX + i), al7230_init_table_a_mode[i]); - } + init_table = (channel <= CB_MAX_CHANNEL_24G) ? + al7230_init_table : al7230_init_table_a_mode; + for (i = 0; i < CB_AL7230_INIT_SEQ; i++) + MACvSetMISCFifo(priv, idx++, init_table[i]); - MACvSetMISCFifo(priv, (unsigned short)(MISCFIFO_SYNDATA_IDX + i), al7230_channel_table0[channel - 1]); - i++; - MACvSetMISCFifo(priv, (unsigned short)(MISCFIFO_SYNDATA_IDX + i), al7230_channel_table1[channel - 1]); - i++; - MACvSetMISCFifo(priv, (unsigned short)(MISCFIFO_SYNDATA_IDX + i), al7230_channel_table2[channel - 1]); + MACvSetMISCFifo(priv, idx++, al7230_channel_table0[channel - 1]); + MACvSetMISCFifo(priv, idx++, al7230_channel_table1[channel - 1]); + MACvSetMISCFifo(priv, idx++, al7230_channel_table2[channel - 1]); break; case RF_NOTHING: @@ -786,8 +778,8 @@ bool RFbSetPower(struct vnt_private *priv, unsigned int rate, u16 uCH) else byDec = byPwr + 10; - if (byDec >= priv->byMaxPwrLevel) - byDec = priv->byMaxPwrLevel - 1; + if (byDec >= priv->max_pwr_level) + byDec = priv->max_pwr_level - 1; byPwr = byDec; break; @@ -829,7 +821,7 @@ bool RFbRawSetPower(struct vnt_private *priv, unsigned char byPwr, bool ret = true; unsigned long dwMax7230Pwr = 0; - if (byPwr >= priv->byMaxPwrLevel) + if (byPwr >= priv->max_pwr_level) return false; switch (priv->byRFType) { |