From d635711daa98be86d4c7fd01499c34f566b54ccb Mon Sep 17 00:00:00 2001 From: André Fabian Silva Delgado Date: Fri, 10 Jun 2016 05:30:17 -0300 Subject: Linux-libre 4.6.2-gnu --- drivers/staging/vt6656/device.h | 4 ++-- drivers/staging/vt6656/main_usb.c | 30 ++++++++++++++++-------------- drivers/staging/vt6656/power.c | 2 +- drivers/staging/vt6656/rf.c | 4 ++-- drivers/staging/vt6656/rxtx.c | 12 ++++++++---- drivers/staging/vt6656/usbpipe.c | 21 ++++++++------------- 6 files changed, 37 insertions(+), 36 deletions(-) (limited to 'drivers/staging/vt6656') diff --git a/drivers/staging/vt6656/device.h b/drivers/staging/vt6656/device.h index 76b5f4127..4832666cc 100644 --- a/drivers/staging/vt6656/device.h +++ b/drivers/staging/vt6656/device.h @@ -259,8 +259,8 @@ enum { }; /* flags for options */ -#define DEVICE_FLAGS_UNPLUG BIT(0) -#define DEVICE_FLAGS_DISCONNECTED BIT(1) +#define DEVICE_FLAGS_UNPLUG 0 +#define DEVICE_FLAGS_DISCONNECTED 1 struct vnt_private { /* mac80211 */ diff --git a/drivers/staging/vt6656/main_usb.c b/drivers/staging/vt6656/main_usb.c index ee8d1e1a2..f9afab77b 100644 --- a/drivers/staging/vt6656/main_usb.c +++ b/drivers/staging/vt6656/main_usb.c @@ -74,10 +74,10 @@ MODULE_PARM_DESC(tx_buffers, "Number of receive usb tx buffers"); #define LONG_RETRY_DEF 4 /* BasebandType[] baseband type selected - 0: indicate 802.11a type - 1: indicate 802.11b type - 2: indicate 802.11g type -*/ + * 0: indicate 802.11a type + * 1: indicate 802.11b type + * 2: indicate 802.11g type + */ #define BBP_TYPE_DEF 2 @@ -284,7 +284,8 @@ static int vnt_init_registers(struct vnt_private *priv) calib_rx_iq = priv->eeprom[EEP_OFS_CALIB_RX_IQ]; if (calib_tx_iq || calib_tx_dc || calib_rx_iq) { /* CR255, enable TX/RX IQ and - DC compensation mode */ + * DC compensation mode + */ vnt_control_out_u8(priv, MESSAGE_REQUEST_BBREG, 0xff, @@ -306,7 +307,8 @@ static int vnt_init_registers(struct vnt_private *priv) calib_rx_iq); } else { /* CR255, turn off - BB Calibration compensation */ + * BB Calibration compensation + */ vnt_control_out_u8(priv, MESSAGE_REQUEST_BBREG, 0xff, @@ -429,7 +431,7 @@ static bool vnt_alloc_bufs(struct vnt_private *priv) for (ii = 0; ii < priv->num_tx_context; ii++) { tx_context = kmalloc(sizeof(struct vnt_usb_send_context), GFP_KERNEL); - if (tx_context == NULL) + if (!tx_context) goto free_tx; priv->tx_context[ii] = tx_context; @@ -437,7 +439,7 @@ static bool vnt_alloc_bufs(struct vnt_private *priv) tx_context->pkt_no = ii; /* allocate URBs */ - tx_context->urb = usb_alloc_urb(0, GFP_ATOMIC); + tx_context->urb = usb_alloc_urb(0, GFP_KERNEL); if (!tx_context->urb) { dev_err(&priv->usb->dev, "alloc tx urb failed\n"); goto free_tx; @@ -459,14 +461,14 @@ static bool vnt_alloc_bufs(struct vnt_private *priv) rcb->priv = priv; /* allocate URBs */ - rcb->urb = usb_alloc_urb(0, GFP_ATOMIC); - if (rcb->urb == NULL) { + rcb->urb = usb_alloc_urb(0, GFP_KERNEL); + if (!rcb->urb) { dev_err(&priv->usb->dev, "Failed to alloc rx urb\n"); goto free_rx_tx; } rcb->skb = dev_alloc_skb(priv->rx_buf_sz); - if (rcb->skb == NULL) + if (!rcb->skb) goto free_rx_tx; rcb->in_use = false; @@ -476,14 +478,14 @@ static bool vnt_alloc_bufs(struct vnt_private *priv) goto free_rx_tx; } - priv->interrupt_urb = usb_alloc_urb(0, GFP_ATOMIC); - if (priv->interrupt_urb == NULL) { + priv->interrupt_urb = usb_alloc_urb(0, GFP_KERNEL); + if (!priv->interrupt_urb) { dev_err(&priv->usb->dev, "Failed to alloc int urb\n"); goto free_rx_tx; } priv->int_buf.data_buf = kmalloc(MAX_INTERRUPT_SIZE, GFP_KERNEL); - if (priv->int_buf.data_buf == NULL) { + if (!priv->int_buf.data_buf) { usb_free_urb(priv->interrupt_urb); goto free_rx_tx; } diff --git a/drivers/staging/vt6656/power.c b/drivers/staging/vt6656/power.c index c025dab0f..e322b7d8c 100644 --- a/drivers/staging/vt6656/power.c +++ b/drivers/staging/vt6656/power.c @@ -103,7 +103,7 @@ void vnt_disable_power_saving(struct vnt_private *priv) /* disable power saving hw function */ vnt_control_out(priv, MESSAGE_TYPE_DISABLE_PS, 0, - 0, 0, NULL); + 0, 0, NULL); /* clear AutoSleep */ vnt_mac_reg_bits_off(priv, MAC_REG_PSCFG, PSCFG_AUTOSLEEP); diff --git a/drivers/staging/vt6656/rf.c b/drivers/staging/vt6656/rf.c index 816206c92..79a310871 100644 --- a/drivers/staging/vt6656/rf.c +++ b/drivers/staging/vt6656/rf.c @@ -917,8 +917,8 @@ void vnt_rf_table_download(struct vnt_private *priv) if (priv->rf_type == RF_AIROHA7230) { length1 = CB_AL7230_INIT_SEQ * 3; length2 = CB_MAX_CHANNEL * 3; - addr1 = &(al7230_init_table_amode[0][0]); - addr2 = &(al7230_channel_table2[0][0]); + addr1 = &al7230_init_table_amode[0][0]; + addr2 = &al7230_channel_table2[0][0]; memcpy(array, addr1, length1); diff --git a/drivers/staging/vt6656/rxtx.c b/drivers/staging/vt6656/rxtx.c index a0c69b697..b74e32001 100644 --- a/drivers/staging/vt6656/rxtx.c +++ b/drivers/staging/vt6656/rxtx.c @@ -716,7 +716,7 @@ static void vnt_fill_txkey(struct vnt_usb_send_context *tx_context, u16 payload_len, struct vnt_mic_hdr *mic_hdr) { struct ieee80211_hdr *hdr = tx_context->hdr; - struct ieee80211_key_seq seq; + u64 pn64; u8 *iv = ((u8 *)hdr + ieee80211_get_hdrlen_from_skb(skb)); /* strip header and icv len from payload */ @@ -749,9 +749,13 @@ static void vnt_fill_txkey(struct vnt_usb_send_context *tx_context, mic_hdr->payload_len = cpu_to_be16(payload_len); ether_addr_copy(mic_hdr->mic_addr2, hdr->addr2); - ieee80211_get_key_tx_seq(tx_key, &seq); - - memcpy(mic_hdr->ccmp_pn, seq.ccmp.pn, IEEE80211_CCMP_PN_LEN); + pn64 = atomic64_read(&tx_key->tx_pn); + mic_hdr->ccmp_pn[5] = pn64; + mic_hdr->ccmp_pn[4] = pn64 >> 8; + mic_hdr->ccmp_pn[3] = pn64 >> 16; + mic_hdr->ccmp_pn[2] = pn64 >> 24; + mic_hdr->ccmp_pn[1] = pn64 >> 32; + mic_hdr->ccmp_pn[0] = pn64 >> 40; if (ieee80211_has_a4(hdr->frame_control)) mic_hdr->hlen = cpu_to_be16(28); diff --git a/drivers/staging/vt6656/usbpipe.c b/drivers/staging/vt6656/usbpipe.c index 351a99f3d..f546553de 100644 --- a/drivers/staging/vt6656/usbpipe.c +++ b/drivers/staging/vt6656/usbpipe.c @@ -101,9 +101,9 @@ void vnt_control_in_u8(struct vnt_private *priv, u8 reg, u8 reg_off, u8 *data) static void vnt_start_interrupt_urb_complete(struct urb *urb) { struct vnt_private *priv = urb->context; - int status; + int status = urb->status; - switch (urb->status) { + switch (status) { case 0: case -ETIMEDOUT: break; @@ -116,9 +116,7 @@ static void vnt_start_interrupt_urb_complete(struct urb *urb) break; } - status = urb->status; - - if (status != STATUS_SUCCESS) { + if (status) { priv->int_buf.in_use = false; dev_dbg(&priv->usb->dev, "%s status = %d\n", __func__, status); @@ -207,10 +205,9 @@ static void vnt_submit_rx_urb_complete(struct urb *urb) int vnt_submit_rx_urb(struct vnt_private *priv, struct vnt_rcb *rcb) { int status = 0; - struct urb *urb; + struct urb *urb = rcb->urb; - urb = rcb->urb; - if (rcb->skb == NULL) { + if (!rcb->skb) { dev_dbg(&priv->usb->dev, "rcb->skb is null\n"); return status; } @@ -224,7 +221,7 @@ int vnt_submit_rx_urb(struct vnt_private *priv, struct vnt_rcb *rcb) rcb); status = usb_submit_urb(urb, GFP_ATOMIC); - if (status != 0) { + if (status) { dev_dbg(&priv->usb->dev, "Submit Rx URB failed %d\n", status); return STATUS_FAILURE; } @@ -269,15 +266,13 @@ int vnt_tx_context(struct vnt_private *priv, struct vnt_usb_send_context *context) { int status; - struct urb *urb; + struct urb *urb = context->urb; if (test_bit(DEVICE_FLAGS_DISCONNECTED, &priv->flags)) { context->in_use = false; return STATUS_RESOURCES; } - urb = context->urb; - usb_fill_bulk_urb(urb, priv->usb, usb_sndbulkpipe(priv->usb, 3), @@ -287,7 +282,7 @@ int vnt_tx_context(struct vnt_private *priv, context); status = usb_submit_urb(urb, GFP_ATOMIC); - if (status != 0) { + if (status) { dev_dbg(&priv->usb->dev, "Submit Tx URB failed %d\n", status); context->in_use = false; -- cgit v1.2.3-54-g00ecf