diff options
| author | Chien-Ming Chen <mingc@qca.qualcomm.com> | 2014-12-18 16:36:22 +0800 |
|---|---|---|
| committer | AnjaneeDevi Kapparapu <c_akappa@qti.qualcomm.com> | 2014-12-19 16:19:10 +0530 |
| commit | fef57131f976549cd0903f83f334923c99afbbb3 (patch) | |
| tree | 7f3780f0322c44ad4300020ec2fb245ac78a3ec1 | |
| parent | f044b8ff001526c05399e53807e716ef67786898 (diff) | |
qcacld: usb: Fix target crash dump in USB bundle mode
The crash dump of target doesn't contain extra HTC header.
In USB bundle mode, dump handler can't parse the dump data
correctly.
Change-Id: I02cbc36910b3e59f4e96b51a6e0c50802b4855db
CRs-Fixed: 772934
| -rw-r--r-- | CORE/SERVICES/HIF/USB/usbdrv.c | 44 |
1 files changed, 24 insertions, 20 deletions
diff --git a/CORE/SERVICES/HIF/USB/usbdrv.c b/CORE/SERVICES/HIF/USB/usbdrv.c index ee5d3e1ed82a..5c7fa9a81735 100644 --- a/CORE/SERVICES/HIF/USB/usbdrv.c +++ b/CORE/SERVICES/HIF/USB/usbdrv.c @@ -48,6 +48,10 @@ #define IS_ISOC_EP(attr) (((attr) & 3) == 0x01) #define IS_DIR_IN(addr) ((addr) & 0x80) +#define IS_FW_CRASH_DUMP(x) ((x == FW_ASSERT_PATTERN) || \ + (x == FW_REG_PATTERN) || \ + ((x & FW_RAMDUMP_PATTERN_MASK) == FW_RAMDUMP_PATTERN))?1:0 + static void usb_hif_post_recv_transfers(HIF_USB_PIPE *recv_pipe, int buffer_length); static void usb_hif_post_recv_bundle_transfers(HIF_USB_PIPE *recv_pipe, @@ -656,25 +660,29 @@ static void usb_hif_usb_recv_bundle_complete(struct urb *urb) do { A_UINT16 frame_len; - /* Hack into HTC header for bundle processing */ - HtcHdr = (HTC_FRAME_HDR *) netdata; - if (HtcHdr->EndpointID >= ENDPOINT_MAX) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, - ("athusb: Rx: invalid EndpointID=%d\n", - HtcHdr->EndpointID)); - break; - } + if (IS_FW_CRASH_DUMP(*(A_UINT32 *) netdata)) + frame_len = netlen; + else { + /* Hack into HTC header for bundle processing */ + HtcHdr = (HTC_FRAME_HDR *) netdata; + if (HtcHdr->EndpointID >= ENDPOINT_MAX) { + AR_DEBUG_PRINTF(ATH_DEBUG_ERR, + ("athusb: Rx: invalid EndpointID=%d\n", + HtcHdr->EndpointID)); + break; + } - payloadLen = HtcHdr->PayloadLen; - payloadLen = A_LE2CPU16(payloadLen); + payloadLen = HtcHdr->PayloadLen; + payloadLen = A_LE2CPU16(payloadLen); - if (payloadLen > HIF_USB_RX_BUFFER_SIZE) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR, - ("athusb: payloadLen too long %u\n", - payloadLen)); - break; + if (payloadLen > HIF_USB_RX_BUFFER_SIZE) { + AR_DEBUG_PRINTF(ATH_DEBUG_ERR, + ("athusb: payloadLen too long %u\n", + payloadLen)); + break; + } + frame_len = (HTC_HDR_LENGTH + payloadLen); } - frame_len = (HTC_HDR_LENGTH + payloadLen); if (netlen >= frame_len) { /* allocate a new skb and copy */ @@ -1072,10 +1080,6 @@ A_STATUS usb_hif_submit_ctrl_in(HIF_DEVICE_USB *device, return ret; } -#define IS_FW_CRASH_DUMP(x) ((x == FW_ASSERT_PATTERN) || \ - (x == FW_REG_PATTERN) || \ - ((x & FW_RAMDUMP_PATTERN_MASK) == FW_RAMDUMP_PATTERN))?1:0 - void usb_hif_io_comp_work(struct work_struct *work) { HIF_USB_PIPE *pipe = container_of(work, HIF_USB_PIPE, io_complete_work); |
