diff options
| author | Manikandan Mohan <manikand@codeaurora.org> | 2017-04-10 12:08:48 -0700 |
|---|---|---|
| committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2017-04-19 16:05:18 -0700 |
| commit | 07a0bb27eb7a3a6247da9642b49e16fa985ea8dd (patch) | |
| tree | 5492a3a76d1da198fe0f227d92f140f13403d4f6 | |
| parent | d44061f4792668912d08348116f8db939d60a31c (diff) | |
qcacmn: Fix kernel module check patch warnings in HIF USB files
Fix kernel module check patch warnings in HIF USB files
Change-Id: Ia9a76aedcef83bb582e44fc76a486137bd22362b
CRs-fixed: 2033001
| -rw-r--r-- | hif/inc/target_reg_init.h | 4 | ||||
| -rw-r--r-- | hif/src/hif_main.h | 2 | ||||
| -rw-r--r-- | hif/src/usb/hif_usb.c | 10 | ||||
| -rw-r--r-- | hif/src/usb/hif_usb_internal.h | 50 | ||||
| -rw-r--r-- | hif/src/usb/if_usb.c | 20 | ||||
| -rw-r--r-- | hif/src/usb/if_usb.h | 17 | ||||
| -rw-r--r-- | hif/src/usb/regtable_usb.h | 8 | ||||
| -rw-r--r-- | hif/src/usb/usbdrv.c | 157 |
8 files changed, 136 insertions, 132 deletions
diff --git a/hif/inc/target_reg_init.h b/hif/inc/target_reg_init.h index a776678d9038..effc05e04109 100644 --- a/hif/inc/target_reg_init.h +++ b/hif/inc/target_reg_init.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016 The Linux Foundation. All rights reserved. + * Copyright (c) 2016-2017 The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -21,7 +21,7 @@ #include "reg_struct.h" #include "targaddrs.h" /*** WARNING : Add to the end of the TABLE! do not change the order ****/ -typedef struct targetdef_s TARGET_REGISTER_TABLE; +struct targetdef_s; diff --git a/hif/src/hif_main.h b/hif/src/hif_main.h index aa5cdaad8e98..33a07e0282bf 100644 --- a/hif/src/hif_main.h +++ b/hif/src/hif_main.h @@ -96,7 +96,7 @@ #define HIF_GET_CE_STATE(scn) ((struct HIF_CE_state *)scn) #define HIF_GET_SDIO_SOFTC(scn) ((struct hif_sdio_softc *)scn) #define HIF_GET_USB_SOFTC(scn) ((struct hif_usb_softc *)scn) -#define HIF_GET_USB_DEVICE(scn) ((HIF_DEVICE_USB *)scn) +#define HIF_GET_USB_DEVICE(scn) ((struct HIF_DEVICE_USB *)scn) #define HIF_GET_SOFTC(scn) ((struct hif_softc *)scn) #define GET_HIF_OPAQUE_HDL(scn) ((struct hif_opaque_softc *)scn) diff --git a/hif/src/usb/hif_usb.c b/hif/src/usb/hif_usb.c index c4035a12eef1..e184da824229 100644 --- a/hif/src/usb/hif_usb.c +++ b/hif/src/usb/hif_usb.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013-2016 The Linux Foundation. All rights reserved. + * Copyright (c) 2013-2017 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -191,6 +191,7 @@ static QDF_STATUS hif_send_internal(HIF_DEVICE_USB *hif_usb_device, i < (send_context->new_alloc ? frag_count : frag_count - 1); i++) { int frag_len = qdf_nbuf_get_frag_len(buf, i); unsigned char *frag_addr = qdf_nbuf_get_frag_vaddr(buf, i); + qdf_mem_copy(data_ptr, frag_addr, frag_len); data_ptr += frag_len; } @@ -275,6 +276,7 @@ QDF_STATUS hif_send_head(struct hif_opaque_softc *scn, uint8_t pipe_id, { QDF_STATUS status = QDF_STATUS_SUCCESS; HIF_DEVICE_USB *device = HIF_GET_USB_DEVICE(scn); + HIF_TRACE("+%s", __func__); status = hif_send_internal(device, pipe_id, NULL, wbuf, nbytes); HIF_TRACE("-%s", __func__); @@ -288,7 +290,8 @@ QDF_STATUS hif_send_head(struct hif_opaque_softc *scn, uint8_t pipe_id, * * Return: # of free resources in pipe_id */ -uint16_t hif_get_free_queue_number(struct hif_opaque_softc *scn, uint8_t pipe_id) +uint16_t hif_get_free_queue_number(struct hif_opaque_softc *scn, + uint8_t pipe_id) { HIF_DEVICE_USB *device = HIF_GET_USB_DEVICE(scn); @@ -321,6 +324,7 @@ void hif_post_init(struct hif_opaque_softc *scn, void *target, void hif_detach_htc(struct hif_opaque_softc *scn) { HIF_DEVICE_USB *device = HIF_GET_USB_DEVICE(scn); + usb_hif_flush_all(device); qdf_mem_zero(&device->htc_callbacks, sizeof(device->htc_callbacks)); } @@ -856,8 +860,8 @@ QDF_STATUS hif_diag_write_mem(struct hif_opaque_softc *scn, uint8_t *data, int nbytes) { QDF_STATUS status = QDF_STATUS_SUCCESS; - HIF_TRACE("+%s", __func__); + HIF_TRACE("+%s", __func__); if ((address & 0x3) || ((uintptr_t)data & 0x3)) return QDF_STATUS_E_IO; diff --git a/hif/src/usb/hif_usb_internal.h b/hif/src/usb/hif_usb_internal.h index 217d2950e242..40ee48db3d81 100644 --- a/hif/src/usb/hif_usb_internal.h +++ b/hif/src/usb/hif_usb_internal.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013-2016 The Linux Foundation. All rights reserved. + * Copyright (c) 2013-2017 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -45,19 +45,19 @@ #ifdef HIF_USB_TASKLET #define HIF_USB_SCHEDULE_WORK(pipe)\ - tasklet_schedule(&pipe->io_complete_tasklet); + tasklet_schedule(&pipe->io_complete_tasklet) #define HIF_USB_INIT_WORK(pipe)\ tasklet_init(&pipe->io_complete_tasklet,\ usb_hif_io_comp_tasklet,\ - (long unsigned int)pipe); + (unsigned long)pipe) -#define HIF_USB_FLUSH_WORK(pipe) flush_work(&pipe->io_complete_work); +#define HIF_USB_FLUSH_WORK(pipe) flush_work(&pipe->io_complete_work) #else -#define HIF_USB_SCHEDULE_WORK(pipe) schedule_work(&pipe->io_complete_work); +#define HIF_USB_SCHEDULE_WORK(pipe) schedule_work(&pipe->io_complete_work) #define HIF_USB_INIT_WORK(pipe)\ INIT_WORK(&pipe->io_complete_work,\ - usb_hif_io_comp_work); + usb_hif_io_comp_work) #define HIF_USB_FLUSH_WORK(pipe) #endif @@ -70,15 +70,15 @@ #define USB_HIF_SUSPEND ATH_DEBUG_MAKE_MODULE_MASK(5) #define USB_HIF_ISOC_SUPPORT ATH_DEBUG_MAKE_MODULE_MASK(6) -struct _HIF_USB_PIPE; +struct HIF_USB_PIPE; -typedef struct _HIF_URB_CONTEXT { +struct HIF_URB_CONTEXT { DL_LIST link; - struct _HIF_USB_PIPE *pipe; + struct HIF_USB_PIPE *pipe; qdf_nbuf_t buf; struct urb *urb; struct hif_usb_send_context *send_context; -} HIF_URB_CONTEXT; +}; #define HIF_USB_PIPE_FLAG_TX (1 << 0) @@ -87,7 +87,7 @@ typedef struct _HIF_URB_CONTEXT { */ struct hif_usb_send_context { A_BOOL new_alloc; - HIF_DEVICE_USB *hif_usb_device; + struct HIF_DEVICE_USB *hif_usb_device; qdf_nbuf_t netbuf; unsigned int transfer_id; unsigned int head_data_len; @@ -95,30 +95,32 @@ struct hif_usb_send_context { extern unsigned int hif_usb_disable_rxdata2; -extern QDF_STATUS usb_hif_submit_ctrl_in(HIF_DEVICE_USB *macp, +extern QDF_STATUS usb_hif_submit_ctrl_in(struct HIF_DEVICE_USB *macp, uint8_t req, uint16_t value, uint16_t index, void *data, uint32_t size); -extern QDF_STATUS usb_hif_submit_ctrl_out(HIF_DEVICE_USB *macp, +extern QDF_STATUS usb_hif_submit_ctrl_out(struct HIF_DEVICE_USB *macp, uint8_t req, uint16_t value, uint16_t index, void *data, uint32_t size); -QDF_STATUS usb_hif_setup_pipe_resources(HIF_DEVICE_USB *device); -void usb_hif_cleanup_pipe_resources(HIF_DEVICE_USB *device); -void usb_hif_prestart_recv_pipes(HIF_DEVICE_USB *device); -void usb_hif_start_recv_pipes(HIF_DEVICE_USB *device); -void usb_hif_flush_all(HIF_DEVICE_USB *device); -void usb_hif_cleanup_transmit_urb(HIF_URB_CONTEXT *urb_context); -void usb_hif_enqueue_pending_transfer(HIF_USB_PIPE *pipe, - HIF_URB_CONTEXT *urb_context); -void usb_hif_remove_pending_transfer(HIF_URB_CONTEXT *urb_context); -HIF_URB_CONTEXT *usb_hif_alloc_urb_from_pipe(HIF_USB_PIPE *pipe); +QDF_STATUS usb_hif_setup_pipe_resources(struct HIF_DEVICE_USB *device); +void usb_hif_cleanup_pipe_resources(struct HIF_DEVICE_USB *device); +void usb_hif_prestart_recv_pipes(struct HIF_DEVICE_USB *device); +void usb_hif_start_recv_pipes(struct HIF_DEVICE_USB *device); +void usb_hif_flush_all(struct HIF_DEVICE_USB *device); +void usb_hif_cleanup_transmit_urb(struct HIF_URB_CONTEXT *urb_context); +void usb_hif_enqueue_pending_transfer(struct HIF_USB_PIPE *pipe, + struct HIF_URB_CONTEXT *urb_context); +void usb_hif_remove_pending_transfer(struct HIF_URB_CONTEXT *urb_context); +struct HIF_URB_CONTEXT *usb_hif_alloc_urb_from_pipe(struct HIF_USB_PIPE *pipe); +void hif_usb_device_deinit(struct hif_usb_softc *sc); +QDF_STATUS hif_usb_device_init(struct hif_usb_softc *sc); #ifdef HIF_USB_TASKLET -void usb_hif_io_comp_tasklet(long unsigned int context); +void usb_hif_io_comp_tasklet(unsigned long context); #else void usb_hif_io_comp_work(struct work_struct *work); #endif diff --git a/hif/src/usb/if_usb.c b/hif/src/usb/if_usb.c index d66eefb9b8e7..9cfbf2049b98 100644 --- a/hif/src/usb/if_usb.c +++ b/hif/src/usb/if_usb.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013-2016 The Linux Foundation. All rights reserved. + * Copyright (c) 2013-2017 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -48,10 +48,7 @@ void *fw_ram_seg_addr[FW_RAM_SEG_CNT]; static int hif_usb_unload_dev_num = -1; -struct hif_usb_softc *g_usb_sc = NULL; - -void hif_usb_device_deinit(struct hif_usb_softc *sc); -QDF_STATUS hif_usb_device_init(struct hif_usb_softc *sc); +struct hif_usb_softc *g_usb_sc; /** * hif_usb_diag_write_cold_reset() - reset SOC by sending a diag command @@ -234,10 +231,11 @@ QDF_STATUS hif_usb_enable_bus(struct hif_softc *scn, /* disable lpm to avoid usb2.0 probe timeout */ hif_usb_disable_lpm(usbdev); - /* params need to be added - TO DO - scn->enableuartprint = 1; - scn->enablefwlog = 0; - scn->max_no_of_peers = 1; */ + /* params need to be added - TODO + * scn->enableuartprint = 1; + * scn->enablefwlog = 0; + * scn->max_no_of_peers = 1; + */ sc->interface = interface; sc->reboot_notifier.notifier_call = hif_usb_reboot; @@ -373,6 +371,7 @@ int hif_usb_bus_resume(struct hif_softc *hif_ctx) int hif_usb_bus_reset_resume(struct hif_softc *hif_ctx) { int ret = 0; + HIF_ENTER(); if (hif_usb_diag_write_cold_reset(hif_ctx) != QDF_STATUS_SUCCESS) ret = 1; @@ -454,7 +453,8 @@ void hif_usb_reg_tbl_attach(struct hif_softc *scn) return; /* assign target register table if we find - corresponding type */ + * corresponding type + */ hif_register_tbl_attach(scn, hif_type); target_register_tbl_attach(scn, target_type); /* read the chip revision*/ diff --git a/hif/src/usb/if_usb.h b/hif/src/usb/if_usb.h index 1232602d4542..7d05c567dfa4 100644 --- a/hif/src/usb/if_usb.h +++ b/hif/src/usb/if_usb.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013-2016 The Linux Foundation. All rights reserved. + * Copyright (c) 2013-2017 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -84,7 +84,7 @@ struct fw_ramdump { }; /* USB Endpoint definition */ -typedef enum { +enum HIF_USB_PIPE_ID { HIF_TX_CTRL_PIPE = 0, HIF_TX_DATA_LP_PIPE, HIF_TX_DATA_MP_PIPE, @@ -94,11 +94,11 @@ typedef enum { HIF_RX_DATA2_PIPE, HIF_RX_INT_PIPE, HIF_USB_PIPE_MAX -} HIF_USB_PIPE_ID; +}; #define HIF_USB_PIPE_INVALID HIF_USB_PIPE_MAX -typedef struct _HIF_USB_PIPE { +struct HIF_USB_PIPE { DL_LIST urb_list_head; DL_LIST urb_pending_list; int32_t urb_alloc; @@ -118,9 +118,9 @@ typedef struct _HIF_USB_PIPE { struct sk_buff_head io_comp_queue; struct usb_endpoint_descriptor *ep_desc; int32_t urb_prestart_cnt; -} HIF_USB_PIPE; +}; -typedef struct _HIF_DEVICE_USB { +struct HIF_DEVICE_USB { struct hif_softc ol_sc; qdf_spinlock_t cs_lock; qdf_spinlock_t tx_lock; @@ -128,15 +128,14 @@ typedef struct _HIF_DEVICE_USB { struct hif_msg_callbacks htc_callbacks; struct usb_device *udev; struct usb_interface *interface; - HIF_USB_PIPE pipes[HIF_USB_PIPE_MAX]; + struct HIF_USB_PIPE pipes[HIF_USB_PIPE_MAX]; uint8_t *diag_cmd_buffer; uint8_t *diag_resp_buffer; void *claimed_context; A_BOOL is_bundle_enabled; uint16_t rx_bundle_cnt; uint32_t rx_bundle_buf_len; -} HIF_DEVICE_USB; - +}; struct hif_usb_softc { struct _HIF_DEVICE_USB hif_hdl; diff --git a/hif/src/usb/regtable_usb.h b/hif/src/usb/regtable_usb.h index 97ee5de3fd75..4d17bcc0d5e0 100644 --- a/hif/src/usb/regtable_usb.h +++ b/hif/src/usb/regtable_usb.h @@ -30,7 +30,7 @@ #define MISSING 0 -typedef struct targetdef_s { +struct targetdef_s { u_int32_t d_RTC_SOC_BASE_ADDRESS; u_int32_t d_RTC_WMAC_BASE_ADDRESS; u_int32_t d_SYSTEM_SLEEP_OFFSET; @@ -293,7 +293,7 @@ typedef struct targetdef_s { u_int32_t d_SOC_CHIP_ID_REVISION_MASK; u_int32_t d_SOC_CHIP_ID_REVISION_LSB; /* chip id end */ -} TARGET_REGISTER_TABLE; +}; #define RTC_SOC_BASE_ADDRESS \ (scn->targetdef->d_RTC_SOC_BASE_ADDRESS) @@ -987,7 +987,7 @@ typedef struct targetdef_s { SOC_CPU_CLOCK_STANDARD_MASK) /* PLL end */ -typedef struct hostdef_s { +struct hostdef_s { uint32_t d_INT_STATUS_ENABLE_ERROR_LSB; uint32_t d_INT_STATUS_ENABLE_ERROR_MASK; uint32_t d_INT_STATUS_ENABLE_CPU_LSB; @@ -1046,7 +1046,7 @@ typedef struct hostdef_s { uint32_t d_SOC_PCIE_BASE_ADDRESS; uint32_t d_MSI_MAGIC_ADR_ADDRESS; uint32_t d_MSI_MAGIC_ADDRESS; -} HOST_REGISTER_TABLE; +}; #define INT_STATUS_ENABLE_ERROR_LSB \ (scn->hostdef->d_INT_STATUS_ENABLE_ERROR_LSB) diff --git a/hif/src/usb/usbdrv.c b/hif/src/usb/usbdrv.c index 1cb1d4430156..8385e2773361 100644 --- a/hif/src/usb/usbdrv.c +++ b/hif/src/usb/usbdrv.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013-2016 The Linux Foundation. All rights reserved. + * Copyright (c) 2013-2017 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -42,23 +42,23 @@ ((x & FW_RAMDUMP_PATTERN_MASK) == \ FW_RAMDUMP_PATTERN)) ? 1 : 0) -static void usb_hif_post_recv_transfers(HIF_USB_PIPE *recv_pipe, +static void usb_hif_post_recv_transfers(struct HIF_USB_PIPE *recv_pipe, int buffer_length); static void usb_hif_post_recv_bundle_transfers - (HIF_USB_PIPE *recv_pipe, + (struct HIF_USB_PIPE *recv_pipe, int buffer_length); -static void usb_hif_cleanup_recv_urb(HIF_URB_CONTEXT *urb_context); +static void usb_hif_cleanup_recv_urb(struct HIF_URB_CONTEXT *urb_context); /** * usb_hif_free_urb_to_pipe() - add urb back to urb list of a pipe - * @pipe: pointer to HIF_USB_PIPE - * @urb_context: pointer to HIF_URB_CONTEXT + * @pipe: pointer to struct HIF_USB_PIPE + * @urb_context: pointer to struct HIF_URB_CONTEXT * * Return: none */ -static void usb_hif_free_urb_to_pipe(HIF_USB_PIPE *pipe, - HIF_URB_CONTEXT *urb_context) +static void usb_hif_free_urb_to_pipe(struct HIF_USB_PIPE *pipe, + struct HIF_URB_CONTEXT *urb_context) { qdf_spin_lock_irqsave(&pipe->device->cs_lock); pipe->urb_cnt++; @@ -68,19 +68,20 @@ static void usb_hif_free_urb_to_pipe(HIF_USB_PIPE *pipe, /** * usb_hif_alloc_urb_from_pipe() - remove urb back from urb list of a pipe - * @pipe: pointer to HIF_USB_PIPE + * @pipe: pointer to struct HIF_USB_PIPE * - * Return: HIF_URB_CONTEXT urb context removed from the urb list + * Return: struct HIF_URB_CONTEXT urb context removed from the urb list */ -HIF_URB_CONTEXT *usb_hif_alloc_urb_from_pipe(HIF_USB_PIPE *pipe) +struct HIF_URB_CONTEXT *usb_hif_alloc_urb_from_pipe(struct HIF_USB_PIPE *pipe) { - HIF_URB_CONTEXT *urb_context = NULL; + struct HIF_URB_CONTEXT *urb_context = NULL; DL_LIST *item; qdf_spin_lock_irqsave(&pipe->device->cs_lock); item = dl_list_remove_item_from_head(&pipe->urb_list_head); if (item != NULL) { - urb_context = A_CONTAINING_STRUCT(item, HIF_URB_CONTEXT, link); + urb_context = A_CONTAINING_STRUCT(item, struct HIF_URB_CONTEXT, + link); pipe->urb_cnt--; } qdf_spin_unlock_irqrestore(&pipe->device->cs_lock); @@ -90,20 +91,21 @@ HIF_URB_CONTEXT *usb_hif_alloc_urb_from_pipe(HIF_USB_PIPE *pipe) /** * usb_hif_dequeue_pending_transfer() - remove urb from pending xfer list - * @pipe: pointer to HIF_USB_PIPE + * @pipe: pointer to struct HIF_USB_PIPE * - * Return: HIF_URB_CONTEXT urb context removed from the pending xfer list + * Return: struct HIF_URB_CONTEXT urb context removed from the pending xfer list */ -static HIF_URB_CONTEXT *usb_hif_dequeue_pending_transfer - (HIF_USB_PIPE *pipe) +static struct HIF_URB_CONTEXT *usb_hif_dequeue_pending_transfer + (struct HIF_USB_PIPE *pipe) { - HIF_URB_CONTEXT *urb_context = NULL; + struct HIF_URB_CONTEXT *urb_context = NULL; DL_LIST *item; qdf_spin_lock_irqsave(&pipe->device->cs_lock); item = dl_list_remove_item_from_head(&pipe->urb_pending_list); if (item != NULL) - urb_context = A_CONTAINING_STRUCT(item, HIF_URB_CONTEXT, link); + urb_context = A_CONTAINING_STRUCT(item, struct HIF_URB_CONTEXT, + link); qdf_spin_unlock_irqrestore(&pipe->device->cs_lock); return urb_context; @@ -111,13 +113,13 @@ static HIF_URB_CONTEXT *usb_hif_dequeue_pending_transfer /** * usb_hif_enqueue_pending_transfer() - add urb to pending xfer list - * @pipe: pointer to HIF_USB_PIPE - * @urb_context: pointer to HIF_URB_CONTEXT to be added to the xfer list + * @pipe: pointer to struct HIF_USB_PIPE + * @urb_context: pointer to struct HIF_URB_CONTEXT to be added to the xfer list * * Return: none */ -void usb_hif_enqueue_pending_transfer(HIF_USB_PIPE *pipe, - HIF_URB_CONTEXT *urb_context) +void usb_hif_enqueue_pending_transfer(struct HIF_USB_PIPE *pipe, + struct HIF_URB_CONTEXT *urb_context) { qdf_spin_lock_irqsave(&pipe->device->cs_lock); dl_list_insert_tail(&pipe->urb_pending_list, &urb_context->link); @@ -127,12 +129,12 @@ void usb_hif_enqueue_pending_transfer(HIF_USB_PIPE *pipe, /** * usb_hif_remove_pending_transfer() - remove urb from its own list - * @urb_context: pointer to HIF_URB_CONTEXT to be removed + * @urb_context: pointer to struct HIF_URB_CONTEXT to be removed * * Return: none */ void -usb_hif_remove_pending_transfer(HIF_URB_CONTEXT *urb_context) +usb_hif_remove_pending_transfer(struct HIF_URB_CONTEXT *urb_context) { qdf_spin_lock_irqsave(&urb_context->pipe->device->cs_lock); dl_list_remove(&urb_context->link); @@ -141,17 +143,17 @@ usb_hif_remove_pending_transfer(HIF_URB_CONTEXT *urb_context) /** * usb_hif_alloc_pipe_resources() - allocate urb_cnt urbs to a HIF pipe - * @pipe: pointer to HIF_USB_PIPE to which resources will be allocated + * @pipe: pointer to struct HIF_USB_PIPE to which resources will be allocated * @urb_cnt: number of urbs to be added to the HIF pipe * * Return: QDF_STATUS_SUCCESS if success else an appropriate QDF_STATUS error */ static QDF_STATUS usb_hif_alloc_pipe_resources - (HIF_USB_PIPE *pipe, int urb_cnt) + (struct HIF_USB_PIPE *pipe, int urb_cnt) { QDF_STATUS status = QDF_STATUS_SUCCESS; int i; - HIF_URB_CONTEXT *urb_context; + struct HIF_URB_CONTEXT *urb_context; DL_LIST_INIT(&pipe->urb_list_head); DL_LIST_INIT(&pipe->urb_pending_list); @@ -191,13 +193,13 @@ static QDF_STATUS usb_hif_alloc_pipe_resources /** * usb_hif_free_pipe_resources() - free urb resources allocated to a HIF pipe - * @pipe: pointer to HIF_USB_PIPE + * @pipe: pointer to struct HIF_USB_PIPE * * Return: none */ -static void usb_hif_free_pipe_resources(HIF_USB_PIPE *pipe) +static void usb_hif_free_pipe_resources(struct HIF_USB_PIPE *pipe) { - HIF_URB_CONTEXT *urb_context; + struct HIF_URB_CONTEXT *urb_context; if (NULL == pipe->device) { /* nothing allocated for this pipe */ @@ -304,7 +306,7 @@ QDF_STATUS usb_hif_setup_pipe_resources(HIF_DEVICE_USB *device) int i; int urbcount; QDF_STATUS status = QDF_STATUS_SUCCESS; - HIF_USB_PIPE *pipe; + struct HIF_USB_PIPE *pipe; uint8_t pipe_num; /* walk decriptors and setup pipes */ @@ -312,7 +314,7 @@ QDF_STATUS usb_hif_setup_pipe_resources(HIF_DEVICE_USB *device) endpoint = &iface_desc->endpoint[i].desc; if (IS_BULK_EP(endpoint->bmAttributes)) { - HIF_DBG("%s Bulk Ep:0x%2.2X " "maxpktsz:%d", + HIF_DBG("%s Bulk Ep:0x%2.2X maxpktsz:%d", IS_DIR_IN(endpoint->bEndpointAddress) ? "RX" : "TX", endpoint->bEndpointAddress, @@ -417,13 +419,13 @@ void usb_hif_cleanup_pipe_resources(HIF_DEVICE_USB *device) /** * usb_hif_flush_pending_transfers() - kill pending urbs for a pipe - * @pipe: pointer to HIF_USB_PIPE structure + * @pipe: pointer to struct HIF_USB_PIPE structure * * Return: none */ -static void usb_hif_flush_pending_transfers(HIF_USB_PIPE *pipe) +static void usb_hif_flush_pending_transfers(struct HIF_USB_PIPE *pipe) { - HIF_URB_CONTEXT *urb_context; + struct HIF_URB_CONTEXT *urb_context; HIF_TRACE("+%s pipe : %d", __func__, pipe->logical_pipe_num); @@ -454,7 +456,8 @@ static void usb_hif_flush_pending_transfers(HIF_USB_PIPE *pipe) void usb_hif_flush_all(HIF_DEVICE_USB *device) { int i; - HIF_USB_PIPE *pipe; + struct HIF_USB_PIPE *pipe; + HIF_TRACE("+%s", __func__); for (i = 0; i < HIF_USB_PIPE_MAX; i++) { @@ -471,11 +474,11 @@ void usb_hif_flush_all(HIF_DEVICE_USB *device) /** * usb_hif_cleanup_recv_urb() - cleanup recv urb - * @urb_context: pointer to HIF_URB_CONTEXT structure + * @urb_context: pointer to struct HIF_URB_CONTEXT structure * * Return: none */ -static void usb_hif_cleanup_recv_urb(HIF_URB_CONTEXT *urb_context) +static void usb_hif_cleanup_recv_urb(struct HIF_URB_CONTEXT *urb_context) { HIF_TRACE("+%s", __func__); @@ -490,11 +493,11 @@ static void usb_hif_cleanup_recv_urb(HIF_URB_CONTEXT *urb_context) /** * usb_hif_cleanup_transmit_urb() - cleanup transmit urb - * @urb_context: pointer to HIF_URB_CONTEXT structure + * @urb_context: pointer to struct HIF_URB_CONTEXT structure * * Return: none */ -void usb_hif_cleanup_transmit_urb(HIF_URB_CONTEXT *urb_context) +void usb_hif_cleanup_transmit_urb(struct HIF_URB_CONTEXT *urb_context) { usb_hif_free_urb_to_pipe(urb_context->pipe, urb_context); } @@ -508,10 +511,11 @@ void usb_hif_cleanup_transmit_urb(HIF_URB_CONTEXT *urb_context) static void usb_hif_usb_recv_prestart_complete (struct urb *urb) { - HIF_URB_CONTEXT *urb_context = (HIF_URB_CONTEXT *) urb->context; + struct HIF_URB_CONTEXT *urb_context = + (struct HIF_URB_CONTEXT *) urb->context; QDF_STATUS status = QDF_STATUS_SUCCESS; qdf_nbuf_t buf = NULL; - HIF_USB_PIPE *pipe = urb_context->pipe; + struct HIF_USB_PIPE *pipe = urb_context->pipe; HIF_DBG("+%s: recv pipe: %d, stat:%d,len:%d urb:0x%p", __func__, @@ -521,7 +525,6 @@ static void usb_hif_usb_recv_prestart_complete /* this urb is not pending anymore */ usb_hif_remove_pending_transfer(urb_context); - do { if (urb->status != 0) { status = A_ECOMM; @@ -545,10 +548,8 @@ static void usb_hif_usb_recv_prestart_complete } break; } - if (urb->actual_length == 0) break; - buf = urb_context->buf; /* we are going to pass it up */ urb_context->buf = NULL; @@ -557,6 +558,7 @@ static void usb_hif_usb_recv_prestart_complete if (AR_DEBUG_LVL_CHECK(USB_HIF_DEBUG_DUMP_DATA)) { uint8_t *data; uint32_t len; + qdf_nbuf_peek_header(buf, &data, &len); debug_dump_bytes(data, len, "hif recv data"); } @@ -583,10 +585,11 @@ static void usb_hif_usb_recv_prestart_complete */ static void usb_hif_usb_recv_complete(struct urb *urb) { - HIF_URB_CONTEXT *urb_context = (HIF_URB_CONTEXT *) urb->context; + struct HIF_URB_CONTEXT *urb_context = + (struct HIF_URB_CONTEXT *) urb->context; QDF_STATUS status = QDF_STATUS_SUCCESS; qdf_nbuf_t buf = NULL; - HIF_USB_PIPE *pipe = urb_context->pipe; + struct HIF_USB_PIPE *pipe = urb_context->pipe; struct hif_usb_softc *sc = HIF_GET_USB_SOFTC(pipe->device); HIF_DBG("+%s: recv pipe: %d, stat:%d,len:%d urb:0x%p", @@ -628,10 +631,8 @@ static void usb_hif_usb_recv_complete(struct urb *urb) } break; } - if (urb->actual_length == 0) break; - buf = urb_context->buf; /* we are going to pass it up */ urb_context->buf = NULL; @@ -639,10 +640,10 @@ static void usb_hif_usb_recv_complete(struct urb *urb) if (AR_DEBUG_LVL_CHECK(USB_HIF_DEBUG_DUMP_DATA)) { uint8_t *data; uint32_t len; + qdf_nbuf_peek_header(buf, &data, &len); debug_dump_bytes(data, len, "hif recv data"); } - /* note: queue implements a lock */ skb_queue_tail(&pipe->io_comp_queue, buf); HIF_USB_SCHEDULE_WORK(pipe); @@ -651,7 +652,7 @@ static void usb_hif_usb_recv_complete(struct urb *urb) usb_hif_cleanup_recv_urb(urb_context); /* Only re-submit URB when STATUS is success and HIF is not at the - suspend state. + * suspend state. */ if (QDF_IS_STATUS_SUCCESS(status) && !sc->suspend_state) { if (pipe->urb_cnt >= pipe->urb_cnt_thresh) { @@ -678,10 +679,11 @@ static void usb_hif_usb_recv_complete(struct urb *urb) */ static void usb_hif_usb_recv_bundle_complete(struct urb *urb) { - HIF_URB_CONTEXT *urb_context = (HIF_URB_CONTEXT *) urb->context; + struct HIF_URB_CONTEXT *urb_context = + (struct HIF_URB_CONTEXT *) urb->context; QDF_STATUS status = QDF_STATUS_SUCCESS; qdf_nbuf_t buf = NULL; - HIF_USB_PIPE *pipe = urb_context->pipe; + struct HIF_USB_PIPE *pipe = urb_context->pipe; uint8_t *netdata, *netdata_new; uint32_t netlen, netlen_new; HTC_FRAME_HDR *HtcHdr; @@ -721,15 +723,13 @@ static void usb_hif_usb_recv_bundle_complete(struct urb *urb) } break; } - if (urb->actual_length == 0) break; - buf = urb_context->buf; - if (AR_DEBUG_LVL_CHECK(USB_HIF_DEBUG_DUMP_DATA)) { uint8_t *data; uint32_t len; + qdf_nbuf_peek_header(buf, &data, &len); debug_dump_bytes(data, len, "hif recv data"); } @@ -813,11 +813,10 @@ static void usb_hif_usb_recv_bundle_complete(struct urb *urb) * * Return: none */ -static void usb_hif_post_recv_prestart_transfers - (HIF_USB_PIPE *recv_pipe, +static void usb_hif_post_recv_prestart_transfers(struct HIF_USB_PIPE *recv_pipe, int prestart_urb) { - HIF_URB_CONTEXT *urb_context; + struct HIF_URB_CONTEXT *urb_context; uint8_t *data; uint32_t len; struct urb *urb; @@ -865,9 +864,8 @@ static void usb_hif_post_recv_prestart_transfers usb_hif_remove_pending_transfer(urb_context); usb_hif_cleanup_recv_urb(urb_context); break; - } else - recv_pipe->urb_prestart_cnt++; - + } + recv_pipe->urb_prestart_cnt++; } HIF_TRACE("-%s", __func__); @@ -880,10 +878,10 @@ static void usb_hif_post_recv_prestart_transfers * * Return: none */ -static void usb_hif_post_recv_transfers(HIF_USB_PIPE *recv_pipe, +static void usb_hif_post_recv_transfers(struct HIF_USB_PIPE *recv_pipe, int buffer_length) { - HIF_URB_CONTEXT *urb_context; + struct HIF_URB_CONTEXT *urb_context; uint8_t *data; uint32_t len; struct urb *urb; @@ -945,11 +943,10 @@ static void usb_hif_post_recv_transfers(HIF_USB_PIPE *recv_pipe, * * Return: none */ -static void usb_hif_post_recv_bundle_transfers - (HIF_USB_PIPE *recv_pipe, +static void usb_hif_post_recv_bundle_transfers(struct HIF_USB_PIPE *recv_pipe, int buffer_length) { - HIF_URB_CONTEXT *urb_context; + struct HIF_URB_CONTEXT *urb_context; uint8_t *data; uint32_t len; struct urb *urb; @@ -1016,7 +1013,7 @@ static void usb_hif_post_recv_bundle_transfers */ void usb_hif_prestart_recv_pipes(HIF_DEVICE_USB *device) { - HIF_USB_PIPE *pipe = &device->pipes[HIF_RX_DATA_PIPE]; + struct HIF_USB_PIPE *pipe = &device->pipes[HIF_RX_DATA_PIPE]; /* * USB driver learn to support bundle or not until the firmware @@ -1037,7 +1034,7 @@ void usb_hif_prestart_recv_pipes(HIF_DEVICE_USB *device) */ void usb_hif_start_recv_pipes(HIF_DEVICE_USB *device) { - HIF_USB_PIPE *pipe; + struct HIF_USB_PIPE *pipe; uint32_t buf_len; HIF_ENTER(); @@ -1184,11 +1181,11 @@ QDF_STATUS usb_hif_submit_ctrl_in(HIF_DEVICE_USB *device, /** * usb_hif_io_complete() - transmit call back for tx urb - * @pipe: pointer to HIF_USB_PIPE + * @pipe: pointer to struct HIF_USB_PIPE * * Return: none */ -void usb_hif_io_complete(HIF_USB_PIPE *pipe) +void usb_hif_io_complete(struct HIF_USB_PIPE *pipe) { qdf_nbuf_t buf; HIF_DEVICE_USB *device; @@ -1196,13 +1193,12 @@ void usb_hif_io_complete(HIF_USB_PIPE *pipe) uint8_t *data; uint32_t len; struct hif_usb_softc *sc = HIF_GET_USB_SOFTC(pipe->device); - device = pipe->device; + device = pipe->device; HIF_ENTER(); - while ((buf = skb_dequeue(&pipe->io_comp_queue))) { if (pipe->flags & HIF_USB_PIPE_FLAG_TX) { - HIF_DBG("+athusb xmit callback " "buf:0x%p", buf); + HIF_DBG("+athusb xmit callback buf:0x%p", buf); HtcHdr = (HTC_FRAME_HDR *) qdf_nbuf_get_frag_vaddr(buf, 0); @@ -1217,7 +1213,7 @@ void usb_hif_io_complete(HIF_USB_PIPE *pipe) #endif HIF_DBG("-athusb xmit callback"); } else { - HIF_DBG("+athusb recv callback buf:" "0x%p", buf); + HIF_DBG("+athusb recv callback buf: 0x%p", buf); qdf_nbuf_peek_header(buf, &data, &len); if (IS_FW_CRASH_DUMP(*((uint32_t *) data))) { @@ -1246,9 +1242,10 @@ void usb_hif_io_complete(HIF_USB_PIPE *pipe) * * Return: none */ -void usb_hif_io_comp_tasklet(long unsigned int context) +void usb_hif_io_comp_tasklet(unsigned long context) { - HIF_USB_PIPE *pipe = (HIF_USB_PIPE *) context; + struct HIF_USB_PIPE *pipe = (struct HIF_USB_PIPE *) context; + usb_hif_io_complete(pipe); } @@ -1261,7 +1258,9 @@ void usb_hif_io_comp_tasklet(long unsigned int context) */ void usb_hif_io_comp_work(struct work_struct *work) { - HIF_USB_PIPE *pipe = container_of(work, HIF_USB_PIPE, io_complete_work); + struct HIF_USB_PIPE *pipe = container_of(work, struct HIF_USB_PIPE, + io_complete_work); + usb_hif_io_complete(pipe); } #endif |
