// SPDX-License-Identifier: GPL-2.0-only /* * This file is part of wl1271 * * Copyright (C) 2008-2009 Nokia Corporation * * Contact: Luciano Coelho <luciano.coelho@nokia.com>
*/
buffer = kzalloc(WL18XX_LOGGER_SDIO_BUFF_MAX, GFP_KERNEL); if (!buffer) {
wl1271_error("Fail to allocate fw logger memory");
actual_len = 0; goto out;
}
ret = wlcore_read(wl, addr, buffer, WL18XX_LOGGER_SDIO_BUFF_MAX, false); if (ret < 0) {
wl1271_error("Fail to read logger buffer, error_id = %d",
ret);
actual_len = 0; goto free_out;
}
memcpy(&fw_log, buffer, sizeof(fw_log));
actual_len = le32_to_cpu(fw_log.actual_buff_size); if (actual_len == 0) goto free_out;
/* Calculate the internal pointer to the fwlog structure */
addr_ptr = internal_fw_addrbase + addr;
/* Calculate the internal pointers to the start and end of log buffer */
buff_start_ptr = addr_ptr + WL18XX_LOGGER_BUFF_OFFSET;
buff_end_ptr = buff_start_ptr + le32_to_cpu(fw_log.max_buff_size);
/* Read the read pointer and validate it */
buff_read_ptr = le32_to_cpu(fw_log.buff_read_ptr); if (buff_read_ptr < buff_start_ptr ||
buff_read_ptr >= buff_end_ptr) {
wl1271_error("buffer read pointer out of bounds: %x not in (%x-%x)\n",
buff_read_ptr, buff_start_ptr, buff_end_ptr); goto free_out;
}
/* Copy initial part up to the end of ring buffer */
len = min(actual_len, available_len);
wl12xx_copy_fwlog(wl, &buffer[start_loc], len);
clear_ptr = addr_ptr + start_loc + len; if (clear_ptr == buff_end_ptr)
clear_ptr = buff_start_ptr;
/* Copy any remaining part from beginning of ring buffer */
len = actual_len - len; if (len) {
wl12xx_copy_fwlog(wl,
&buffer[WL18XX_LOGGER_BUFF_OFFSET],
len);
clear_ptr = addr_ptr + WL18XX_LOGGER_BUFF_OFFSET + len;
}
/* Update the read pointer */
ret = wlcore_write32(wl, addr + WL18XX_LOGGER_READ_POINT_OFFSET,
clear_ptr);
free_out:
kfree(buffer);
out: return actual_len;
}
EXPORT_SYMBOL_GPL(wlcore_event_fw_logger);
for_each_set_bit(h, &sta_bitmap, wl->num_links) { bool found = false; /* find the ap vif connected to this sta */
wl12xx_for_each_wlvif_ap(wl, wlvif) { if (!test_bit(h, wlvif->ap.sta_hlid_map)) continue;
found = true; break;
} if (!found) continue;
void wlcore_event_beacon_loss(struct wl1271 *wl, unsignedlong roles_bitmap)
{ /* * We are HW_MONITOR device. On beacon loss - queue * connection loss work. Cancel it on REGAINED event.
*/ struct wl12xx_vif *wlvif; struct ieee80211_vif *vif; int delay = wl->conf.conn.synch_fail_thold *
wl->conf.conn.bss_lose_timeout;
wl1271_info("Beacon loss detected. roles:0x%lx", roles_bitmap);
/* don't attempt roaming in case of p2p */ if (wlvif->p2p) {
ieee80211_connection_loss(vif); continue;
}
/* * if the work is already queued, it should take place. * We don't want to delay the connection loss * indication any more.
*/
ieee80211_queue_delayed_work(wl->hw,
&wlvif->connection_loss_work,
msecs_to_jiffies(delay));
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.