Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 314851
b: refs/heads/master
c: 1e41213
h: refs/heads/master
i:
  314849: e7c500c
  314847: ffb706b
v: v3
  • Loading branch information
Igal Chernobelsky authored and Luciano Coelho committed Jun 21, 2012
1 parent 2fa055c commit 3a81c98
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: add779a0738a6bd199b3c5b9f0f8090036e53ff0
refs/heads/master: 1e41213fe738e8f8e3fd69dd490ac7e4faaa184f
34 changes: 22 additions & 12 deletions trunk/drivers/net/wireless/ti/wlcore/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -770,14 +770,16 @@ size_t wl12xx_copy_fwlog(struct wl1271 *wl, u8 *memblock, size_t maxlen)
return len;
}

#define WLCORE_FW_LOG_END 0x2000000

static void wl12xx_read_fwlog_panic(struct wl1271 *wl)
{
u32 addr;
u32 first_addr;
u32 offset;
u32 end_of_log;
u8 *block;

if ((wl->quirks & WLCORE_QUIRK_FWLOG_NOT_IMPLEMENTED) ||
(wl->conf.fwlog.mode != WL12XX_FWLOG_ON_DEMAND) ||
(wl->conf.fwlog.mem_blocks == 0))
return;

Expand All @@ -791,19 +793,26 @@ static void wl12xx_read_fwlog_panic(struct wl1271 *wl)
* Make sure the chip is awake and the logger isn't active.
* Do not send a stop fwlog command if the fw is hanged.
*/
if (!wl1271_ps_elp_wakeup(wl) && !wl->watchdog_recovery)
wl12xx_cmd_stop_fwlog(wl);
else
if (wl1271_ps_elp_wakeup(wl))
goto out;
if (!wl->watchdog_recovery)
wl12xx_cmd_stop_fwlog(wl);

/* Read the first memory block address */
wl12xx_fw_status(wl, wl->fw_status_1, wl->fw_status_2);
first_addr = le32_to_cpu(wl->fw_status_2->log_start_addr);
if (!first_addr)
addr = le32_to_cpu(wl->fw_status_2->log_start_addr);
if (!addr)
goto out;

if (wl->conf.fwlog.mode == WL12XX_FWLOG_CONTINUOUS) {
offset = sizeof(addr) + sizeof(struct wl1271_rx_descriptor);
end_of_log = WLCORE_FW_LOG_END;
} else {
offset = sizeof(addr);
end_of_log = addr;
}

/* Traverse the memory blocks linked list */
addr = first_addr;
do {
memset(block, 0, WL12XX_HW_BLOCK_SIZE);
wl1271_read_hwaddr(wl, addr, block, WL12XX_HW_BLOCK_SIZE,
Expand All @@ -812,13 +821,14 @@ static void wl12xx_read_fwlog_panic(struct wl1271 *wl)
/*
* Memory blocks are linked to one another. The first 4 bytes
* of each memory block hold the hardware address of the next
* one. The last memory block points to the first one.
* one. The last memory block points to the first one in
* on demand mode and is equal to 0x2000000 in continuous mode.
*/
addr = le32_to_cpup((__le32 *)block);
if (!wl12xx_copy_fwlog(wl, block + sizeof(addr),
WL12XX_HW_BLOCK_SIZE - sizeof(addr)))
if (!wl12xx_copy_fwlog(wl, block + offset,
WL12XX_HW_BLOCK_SIZE - offset))
break;
} while (addr && (addr != first_addr));
} while (addr && (addr != end_of_log));

wake_up_interruptible(&wl->fwlog_waitq);

Expand Down

0 comments on commit 3a81c98

Please sign in to comment.