diff options
Diffstat (limited to 'drivers/staging/vt6655')
-rw-r--r-- | drivers/staging/vt6655/channel.c | 2 | ||||
-rw-r--r-- | drivers/staging/vt6655/device_main.c | 25 | ||||
-rw-r--r-- | drivers/staging/vt6655/key.c | 6 | ||||
-rw-r--r-- | drivers/staging/vt6655/rxtx.c | 80 |
4 files changed, 49 insertions, 64 deletions
diff --git a/drivers/staging/vt6655/channel.c b/drivers/staging/vt6655/channel.c index 62a85c1ca6c4..889fc22f19bd 100644 --- a/drivers/staging/vt6655/channel.c +++ b/drivers/staging/vt6655/channel.c @@ -133,7 +133,7 @@ void vnt_init_bands(struct vnt_private *priv) priv->hw->wiphy->bands[NL80211_BAND_5GHZ] = &vnt_supported_5ghz_band; - /* fallthrough */ + fallthrough; case RF_RFMD2959: case RF_AIROHA: case RF_AL2230S: diff --git a/drivers/staging/vt6655/device_main.c b/drivers/staging/vt6655/device_main.c index 41cbec4134b0..76de1fd568eb 100644 --- a/drivers/staging/vt6655/device_main.c +++ b/drivers/staging/vt6655/device_main.c @@ -1766,48 +1766,37 @@ vt6655_probe(struct pci_dev *pcid, const struct pci_device_id *ent) /*------------------------------------------------------------------*/ -#ifdef CONFIG_PM -static int vt6655_suspend(struct pci_dev *pcid, pm_message_t state) +static int __maybe_unused vt6655_suspend(struct device *dev_d) { - struct vnt_private *priv = pci_get_drvdata(pcid); + struct vnt_private *priv = dev_get_drvdata(dev_d); unsigned long flags; spin_lock_irqsave(&priv->lock, flags); - pci_save_state(pcid); - MACbShutdown(priv); - pci_disable_device(pcid); - spin_unlock_irqrestore(&priv->lock, flags); - pci_set_power_state(pcid, pci_choose_state(pcid, state)); - return 0; } -static int vt6655_resume(struct pci_dev *pcid) +static int __maybe_unused vt6655_resume(struct device *dev_d) { - pci_set_power_state(pcid, PCI_D0); - pci_enable_wake(pcid, PCI_D0, 0); - pci_restore_state(pcid); + device_wakeup_disable(dev_d); return 0; } -#endif MODULE_DEVICE_TABLE(pci, vt6655_pci_id_table); +static SIMPLE_DEV_PM_OPS(vt6655_pm_ops, vt6655_suspend, vt6655_resume); + static struct pci_driver device_driver = { .name = DEVICE_NAME, .id_table = vt6655_pci_id_table, .probe = vt6655_probe, .remove = vt6655_remove, -#ifdef CONFIG_PM - .suspend = vt6655_suspend, - .resume = vt6655_resume, -#endif + .driver.pm = &vt6655_pm_ops, }; module_pci_driver(device_driver); diff --git a/drivers/staging/vt6655/key.c b/drivers/staging/vt6655/key.c index 4d6b48fd119d..94665ddc36a5 100644 --- a/drivers/staging/vt6655/key.c +++ b/drivers/staging/vt6655/key.c @@ -51,15 +51,15 @@ static int vnt_set_keymode(struct ieee80211_hw *hw, u8 *mac_addr, /* default key last entry */ entry = MAX_KEY_TABLE - 1; key->hw_key_idx = entry; - /* fall through */ + fallthrough; case VNT_KEY_ALLGROUP: key_mode |= VNT_KEY_ALLGROUP; if (onfly_latch) key_mode |= VNT_KEY_ONFLY_ALL; - /* fall through */ + fallthrough; case VNT_KEY_GROUP_ADDRESS: key_mode |= mode; - /* fall through */ + fallthrough; case VNT_KEY_GROUP: key_mode |= (mode << 4); key_mode |= VNT_KEY_GROUP; diff --git a/drivers/staging/vt6655/rxtx.c b/drivers/staging/vt6655/rxtx.c index cfab64d2b312..4778439e8757 100644 --- a/drivers/staging/vt6655/rxtx.c +++ b/drivers/staging/vt6655/rxtx.c @@ -21,7 +21,7 @@ * s_uGetDataDuration - get tx data required duration * s_uFillDataHead- fulfill tx data duration header * s_uGetRTSCTSDuration- get rtx/cts required duration - * s_uGetRTSCTSRsvTime- get rts/cts reserved time + * get_rtscts_time- get rts/cts reserved time * s_uGetTxRsvTime- get frame reserved time * s_vFillCTSHead- fulfill CTS ctl header * s_vFillFragParameter- Set fragment ctl parameter. @@ -190,45 +190,41 @@ static __le16 vnt_rxtx_rsvtime_le16(struct vnt_private *priv, u8 pkt_type, } /* byFreqType: 0=>5GHZ 1=>2.4GHZ */ -static -__le16 -s_uGetRTSCTSRsvTime( - struct vnt_private *pDevice, - unsigned char byRTSRsvType, - unsigned char byPktType, - unsigned int cbFrameLength, - unsigned short wCurrentRate -) +static __le16 get_rtscts_time(struct vnt_private *priv, + unsigned char rts_rsvtype, + unsigned char pkt_type, + unsigned int frame_length, + unsigned short current_rate) { - unsigned int uRrvTime = 0; - unsigned int uRTSTime = 0; - unsigned int uCTSTime = 0; - unsigned int uAckTime = 0; - unsigned int uDataTime = 0; - - uDataTime = bb_get_frame_time(pDevice->byPreambleType, byPktType, cbFrameLength, wCurrentRate); - if (byRTSRsvType == 0) { /* RTSTxRrvTime_bb */ - uRTSTime = bb_get_frame_time(pDevice->byPreambleType, byPktType, 20, pDevice->byTopCCKBasicRate); - uAckTime = bb_get_frame_time(pDevice->byPreambleType, byPktType, 14, pDevice->byTopCCKBasicRate); - uCTSTime = uAckTime; - } else if (byRTSRsvType == 1) { /* RTSTxRrvTime_ba, only in 2.4GHZ */ - uRTSTime = bb_get_frame_time(pDevice->byPreambleType, byPktType, 20, pDevice->byTopCCKBasicRate); - uCTSTime = bb_get_frame_time(pDevice->byPreambleType, byPktType, 14, pDevice->byTopCCKBasicRate); - uAckTime = bb_get_frame_time(pDevice->byPreambleType, byPktType, 14, pDevice->byTopOFDMBasicRate); - } else if (byRTSRsvType == 2) { /* RTSTxRrvTime_aa */ - uRTSTime = bb_get_frame_time(pDevice->byPreambleType, byPktType, 20, pDevice->byTopOFDMBasicRate); - uAckTime = bb_get_frame_time(pDevice->byPreambleType, byPktType, 14, pDevice->byTopOFDMBasicRate); - uCTSTime = uAckTime; - } else if (byRTSRsvType == 3) { /* CTSTxRrvTime_ba, only in 2.4GHZ */ - uCTSTime = bb_get_frame_time(pDevice->byPreambleType, byPktType, 14, pDevice->byTopCCKBasicRate); - uAckTime = bb_get_frame_time(pDevice->byPreambleType, byPktType, 14, pDevice->byTopOFDMBasicRate); - uRrvTime = uCTSTime + uAckTime + uDataTime + 2 * pDevice->uSIFS; - return cpu_to_le16((u16)uRrvTime); + unsigned int rrv_time = 0; + unsigned int rts_time = 0; + unsigned int cts_time = 0; + unsigned int ack_time = 0; + unsigned int data_time = 0; + + data_time = bb_get_frame_time(priv->byPreambleType, pkt_type, frame_length, current_rate); + if (rts_rsvtype == 0) { /* RTSTxRrvTime_bb */ + rts_time = bb_get_frame_time(priv->byPreambleType, pkt_type, 20, priv->byTopCCKBasicRate); + ack_time = bb_get_frame_time(priv->byPreambleType, pkt_type, 14, priv->byTopCCKBasicRate); + cts_time = ack_time; + } else if (rts_rsvtype == 1) { /* RTSTxRrvTime_ba, only in 2.4GHZ */ + rts_time = bb_get_frame_time(priv->byPreambleType, pkt_type, 20, priv->byTopCCKBasicRate); + cts_time = bb_get_frame_time(priv->byPreambleType, pkt_type, 14, priv->byTopCCKBasicRate); + ack_time = bb_get_frame_time(priv->byPreambleType, pkt_type, 14, priv->byTopOFDMBasicRate); + } else if (rts_rsvtype == 2) { /* RTSTxRrvTime_aa */ + rts_time = bb_get_frame_time(priv->byPreambleType, pkt_type, 20, priv->byTopOFDMBasicRate); + ack_time = bb_get_frame_time(priv->byPreambleType, pkt_type, 14, priv->byTopOFDMBasicRate); + cts_time = ack_time; + } else if (rts_rsvtype == 3) { /* CTSTxRrvTime_ba, only in 2.4GHZ */ + cts_time = bb_get_frame_time(priv->byPreambleType, pkt_type, 14, priv->byTopCCKBasicRate); + ack_time = bb_get_frame_time(priv->byPreambleType, pkt_type, 14, priv->byTopOFDMBasicRate); + rrv_time = cts_time + ack_time + data_time + 2 * priv->uSIFS; + return cpu_to_le16((u16)rrv_time); } /* RTSRrvTime */ - uRrvTime = uRTSTime + uCTSTime + uAckTime + uDataTime + 3 * pDevice->uSIFS; - return cpu_to_le16((u16)uRrvTime); + rrv_time = rts_time + cts_time + ack_time + data_time + 3 * priv->uSIFS; + return cpu_to_le16((u16)rrv_time); } /* byFreqType 0: 5GHz, 1:2.4Ghz */ @@ -921,9 +917,9 @@ s_vGenerateTxParameter( /* Fill RsvTime */ struct vnt_rrv_time_rts *buf = pvRrvTime; - buf->rts_rrv_time_aa = s_uGetRTSCTSRsvTime(pDevice, 2, byPktType, cbFrameSize, wCurrentRate); - buf->rts_rrv_time_ba = s_uGetRTSCTSRsvTime(pDevice, 1, byPktType, cbFrameSize, wCurrentRate); - buf->rts_rrv_time_bb = s_uGetRTSCTSRsvTime(pDevice, 0, byPktType, cbFrameSize, wCurrentRate); + buf->rts_rrv_time_aa = get_rtscts_time(pDevice, 2, byPktType, cbFrameSize, wCurrentRate); + buf->rts_rrv_time_ba = get_rtscts_time(pDevice, 1, byPktType, cbFrameSize, wCurrentRate); + buf->rts_rrv_time_bb = get_rtscts_time(pDevice, 0, byPktType, cbFrameSize, wCurrentRate); buf->rrv_time_a = vnt_rxtx_rsvtime_le16(pDevice, byPktType, cbFrameSize, wCurrentRate, bNeedACK); buf->rrv_time_b = vnt_rxtx_rsvtime_le16(pDevice, PK_TYPE_11B, cbFrameSize, pDevice->byTopCCKBasicRate, bNeedACK); @@ -933,7 +929,7 @@ s_vGenerateTxParameter( buf->rrv_time_a = vnt_rxtx_rsvtime_le16(pDevice, byPktType, cbFrameSize, wCurrentRate, bNeedACK); buf->rrv_time_b = vnt_rxtx_rsvtime_le16(pDevice, PK_TYPE_11B, cbFrameSize, pDevice->byTopCCKBasicRate, bNeedACK); - buf->cts_rrv_time_ba = s_uGetRTSCTSRsvTime(pDevice, 3, byPktType, cbFrameSize, wCurrentRate); + buf->cts_rrv_time_ba = get_rtscts_time(pDevice, 3, byPktType, cbFrameSize, wCurrentRate); /* Fill CTS */ s_vFillCTSHead(pDevice, uDMAIdx, byPktType, pvCTS, cbFrameSize, bNeedACK, bDisCRC, wCurrentRate, byFBOption); @@ -942,7 +938,7 @@ s_vGenerateTxParameter( if (pvRTS) {/* RTS_need, non PCF mode */ struct vnt_rrv_time_ab *buf = pvRrvTime; - buf->rts_rrv_time = s_uGetRTSCTSRsvTime(pDevice, 2, byPktType, cbFrameSize, wCurrentRate); + buf->rts_rrv_time = get_rtscts_time(pDevice, 2, byPktType, cbFrameSize, wCurrentRate); buf->rrv_time = vnt_rxtx_rsvtime_le16(pDevice, byPktType, cbFrameSize, wCurrentRate, bNeedACK); /* Fill RTS */ @@ -956,7 +952,7 @@ s_vGenerateTxParameter( if (pvRTS) {/* RTS_need, non PCF mode */ struct vnt_rrv_time_ab *buf = pvRrvTime; - buf->rts_rrv_time = s_uGetRTSCTSRsvTime(pDevice, 0, byPktType, cbFrameSize, wCurrentRate); + buf->rts_rrv_time = get_rtscts_time(pDevice, 0, byPktType, cbFrameSize, wCurrentRate); buf->rrv_time = vnt_rxtx_rsvtime_le16(pDevice, PK_TYPE_11B, cbFrameSize, wCurrentRate, bNeedACK); /* Fill RTS */ |