Commit f545b23d authored by Jérôme Pouiller's avatar Jérôme Pouiller Committed by Greg Kroah-Hartman

staging: wfx: reformat comments on 100 columns

Until now, this driver was written in 80 columns style. However, since
all the functions are prefixed with "wfx_", this constraint is no more
respected in the last patches.

From the perspective of kernel Coding Style, it is not a problem since
it is now allowed to write code on 100 columns.

This patch just unify the code to use 100 columns in every comments.
Signed-off-by: default avatarJérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20220113085524.1110708-22-Jerome.Pouiller@silabs.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 381d3295
...@@ -32,18 +32,15 @@ static void device_wakeup(struct wfx_dev *wdev) ...@@ -32,18 +32,15 @@ static void device_wakeup(struct wfx_dev *wdev)
} }
for (;;) { for (;;) {
gpiod_set_value_cansleep(wdev->pdata.gpio_wakeup, 1); gpiod_set_value_cansleep(wdev->pdata.gpio_wakeup, 1);
/* completion.h does not provide any function to wait /* completion.h does not provide any function to wait completion without consume it
* completion without consume it (a kind of * (a kind of wait_for_completion_done_timeout()). So we have to emulate it.
* wait_for_completion_done_timeout()). So we have to emulate
* it.
*/ */
if (wait_for_completion_timeout(&wdev->hif.ctrl_ready, msecs_to_jiffies(2))) { if (wait_for_completion_timeout(&wdev->hif.ctrl_ready, msecs_to_jiffies(2))) {
complete(&wdev->hif.ctrl_ready); complete(&wdev->hif.ctrl_ready);
return; return;
} else if (max_retry-- > 0) { } else if (max_retry-- > 0) {
/* Older firmwares have a race in sleep/wake-up process. /* Older firmwares have a race in sleep/wake-up process. Redo the process
* Redo the process is sufficient to unfreeze the * is sufficient to unfreeze the chip.
* chip.
*/ */
dev_err(wdev->dev, "timeout while wake up chip\n"); dev_err(wdev->dev, "timeout while wake up chip\n");
gpiod_set_value_cansleep(wdev->pdata.gpio_wakeup, 0); gpiod_set_value_cansleep(wdev->pdata.gpio_wakeup, 0);
...@@ -219,9 +216,9 @@ static int bh_work_tx(struct wfx_dev *wdev, int max_msg) ...@@ -219,9 +216,9 @@ static int bh_work_tx(struct wfx_dev *wdev, int max_msg)
return i; return i;
} }
/* In SDIO mode, it is necessary to make an access to a register to acknowledge /* In SDIO mode, it is necessary to make an access to a register to acknowledge last received
* last received message. It could be possible to restrict this acknowledge to * message. It could be possible to restrict this acknowledge to SDIO mode and only if last
* SDIO mode and only if last operation was rx. * operation was rx.
*/ */
static void ack_sdio_data(struct wfx_dev *wdev) static void ack_sdio_data(struct wfx_dev *wdev)
{ {
...@@ -287,12 +284,11 @@ void wfx_bh_request_tx(struct wfx_dev *wdev) ...@@ -287,12 +284,11 @@ void wfx_bh_request_tx(struct wfx_dev *wdev)
queue_work(system_highpri_wq, &wdev->hif.bh); queue_work(system_highpri_wq, &wdev->hif.bh);
} }
/* If IRQ is not available, this function allow to manually poll the control /* If IRQ is not available, this function allow to manually poll the control register and simulate
* register and simulate an IRQ ahen an event happened. * an IRQ ahen an event happened.
* *
* Note that the device has a bug: If an IRQ raise while host read control * Note that the device has a bug: If an IRQ raise while host read control register, the IRQ is
* register, the IRQ is lost. So, use this function carefully (only duing * lost. So, use this function carefully (only duing device initialisation).
* device initialisation).
*/ */
void wfx_bh_poll_irq(struct wfx_dev *wdev) void wfx_bh_poll_irq(struct wfx_dev *wdev)
{ {
......
...@@ -38,13 +38,12 @@ struct wfx_spi_priv { ...@@ -38,13 +38,12 @@ struct wfx_spi_priv {
bool need_swab; bool need_swab;
}; };
/* The chip reads 16bits of data at time and place them directly into (little /* The chip reads 16bits of data at time and place them directly into (little endian) CPU register.
* endian) CPU register. So, the chip expects bytes order to be "B1 B0 B3 B2" * So, the chip expects bytes order to be "B1 B0 B3 B2" (while LE is "B0 B1 B2 B3" and BE is
* (while LE is "B0 B1 B2 B3" and BE is "B3 B2 B1 B0") * "B3 B2 B1 B0")
* *
* A little endian host with bits_per_word == 16 should do the right job * A little endian host with bits_per_word == 16 should do the right job natively. The code below to
* natively. The code below to support big endian host and commonly used SPI * support big endian host and commonly used SPI 8bits.
* 8bits.
*/ */
static int wfx_spi_copy_from_io(void *priv, unsigned int addr, void *dst, size_t count) static int wfx_spi_copy_from_io(void *priv, unsigned int addr, void *dst, size_t count)
{ {
...@@ -160,8 +159,7 @@ static int wfx_spi_irq_unsubscribe(void *priv) ...@@ -160,8 +159,7 @@ static int wfx_spi_irq_unsubscribe(void *priv)
static size_t wfx_spi_align_size(void *priv, size_t size) static size_t wfx_spi_align_size(void *priv, size_t size)
{ {
/* Most of SPI controllers avoid DMA if buffer size is not 32bit aligned /* Most of SPI controllers avoid DMA if buffer size is not 32bit aligned */
*/
return ALIGN(size, 4); return ALIGN(size, 4);
} }
......
...@@ -74,8 +74,8 @@ void wfx_rx_cb(struct wfx_vif *wvif, const struct wfx_hif_ind_rx *arg, struct sk ...@@ -74,8 +74,8 @@ void wfx_rx_cb(struct wfx_vif *wvif, const struct wfx_hif_ind_rx *arg, struct sk
if (arg->encryp) if (arg->encryp)
hdr->flag |= RX_FLAG_DECRYPTED; hdr->flag |= RX_FLAG_DECRYPTED;
/* Block ack negotiation is offloaded by the firmware. However, /* Block ack negotiation is offloaded by the firmware. However, re-ordering must be done by
* re-ordering must be done by the mac80211. * the mac80211.
*/ */
if (ieee80211_is_action(frame->frame_control) && if (ieee80211_is_action(frame->frame_control) &&
mgmt->u.action.category == WLAN_CATEGORY_BACK && mgmt->u.action.category == WLAN_CATEGORY_BACK &&
......
...@@ -30,8 +30,8 @@ static int wfx_get_hw_rate(struct wfx_dev *wdev, const struct ieee80211_tx_rate ...@@ -30,8 +30,8 @@ static int wfx_get_hw_rate(struct wfx_dev *wdev, const struct ieee80211_tx_rate
} }
return rate->idx + 14; return rate->idx + 14;
} }
/* The device only support 2GHz, else band information should be /* The device only support 2GHz, else band information should be retrieved from
* retrieved from ieee80211_tx_info * ieee80211_tx_info
*/ */
band = wdev->hw->wiphy->bands[NL80211_BAND_2GHZ]; band = wdev->hw->wiphy->bands[NL80211_BAND_2GHZ];
if (rate->idx >= band->n_bitrates) { if (rate->idx >= band->n_bitrates) {
...@@ -356,9 +356,8 @@ static int wfx_tx_inner(struct wfx_vif *wvif, struct ieee80211_sta *sta, struct ...@@ -356,9 +356,8 @@ static int wfx_tx_inner(struct wfx_vif *wvif, struct ieee80211_sta *sta, struct
/* Fill tx request */ /* Fill tx request */
req = (struct wfx_hif_req_tx *)hif_msg->body; req = (struct wfx_hif_req_tx *)hif_msg->body;
/* packet_id just need to be unique on device. 32bits are more than /* packet_id just need to be unique on device. 32bits are more than necessary for that task,
* necessary for that task, so we tae advantage of it to add some extra * so we take advantage of it to add some extra data for debug.
* data for debug.
*/ */
req->packet_id = atomic_add_return(1, &wvif->wdev->packet_id) & 0xFFFF; req->packet_id = atomic_add_return(1, &wvif->wdev->packet_id) & 0xFFFF;
req->packet_id |= IEEE80211_SEQ_TO_SN(le16_to_cpu(hdr->seq_ctrl)) << 16; req->packet_id |= IEEE80211_SEQ_TO_SN(le16_to_cpu(hdr->seq_ctrl)) << 16;
...@@ -402,8 +401,8 @@ void wfx_tx(struct ieee80211_hw *hw, struct ieee80211_tx_control *control, struc ...@@ -402,8 +401,8 @@ void wfx_tx(struct ieee80211_hw *hw, struct ieee80211_tx_control *control, struc
wvif = wvif_iterate(wdev, NULL); wvif = wvif_iterate(wdev, NULL);
if (WARN_ON(!wvif)) if (WARN_ON(!wvif))
goto drop; goto drop;
/* Because of TX_AMPDU_SETUP_IN_HW, mac80211 does not try to send any /* Because of TX_AMPDU_SETUP_IN_HW, mac80211 does not try to send any BlockAck session
* BlockAck session management frame. The check below exist just in case. * management frame. The check below exist just in case.
*/ */
if (wfx_is_action_back(hdr)) { if (wfx_is_action_back(hdr)) {
dev_info(wdev->dev, "drop BA action\n"); dev_info(wdev->dev, "drop BA action\n");
......
...@@ -250,9 +250,9 @@ static ssize_t wfx_send_hif_msg_write(struct file *file, const char __user *user ...@@ -250,9 +250,9 @@ static ssize_t wfx_send_hif_msg_write(struct file *file, const char __user *user
if (count < sizeof(struct wfx_hif_msg)) if (count < sizeof(struct wfx_hif_msg))
return -EINVAL; return -EINVAL;
/* wfx_cmd_send() checks that reply buffer is wide enough, but does not /* wfx_cmd_send() checks that reply buffer is wide enough, but does not return precise
* return precise length read. User have to know how many bytes should * length read. User have to know how many bytes should be read. Filling reply buffer with a
* be read. Filling reply buffer with a memory pattern may help user. * memory pattern may help user.
*/ */
memset(context->reply, 0xFF, sizeof(context->reply)); memset(context->reply, 0xFF, sizeof(context->reply));
request = memdup_user(user_buf, count); request = memdup_user(user_buf, count);
...@@ -282,9 +282,7 @@ static ssize_t wfx_send_hif_msg_read(struct file *file, char __user *user_buf, ...@@ -282,9 +282,7 @@ static ssize_t wfx_send_hif_msg_read(struct file *file, char __user *user_buf,
return ret; return ret;
if (context->ret < 0) if (context->ret < 0)
return context->ret; return context->ret;
/* Be careful, write() is waiting for a full message while read() /* Be careful, write() is waiting for a full message while read() only returns a payload */
* only returns a payload
*/
if (copy_to_user(user_buf, context->reply, count)) if (copy_to_user(user_buf, context->reply, count))
return -EFAULT; return -EFAULT;
......
...@@ -69,15 +69,13 @@ static const char * const fwio_errors[] = { ...@@ -69,15 +69,13 @@ static const char * const fwio_errors[] = {
[ERR_MAC_KEY] = "MAC key not initialized", [ERR_MAC_KEY] = "MAC key not initialized",
}; };
/* request_firmware() allocate data using vmalloc(). It is not compatible with /* request_firmware() allocate data using vmalloc(). It is not compatible with underlying hardware
* underlying hardware that use DMA. Function below detect this case and * that use DMA. Function below detect this case and allocate a bounce buffer if necessary.
* allocate a bounce buffer if necessary.
* *
* Notice that, in doubt, you can enable CONFIG_DEBUG_SG to ask kernel to * Notice that, in doubt, you can enable CONFIG_DEBUG_SG to ask kernel to detect this problem at
* detect this problem at runtime (else, kernel silently fail). * runtime (else, kernel silently fail).
* *
* NOTE: it may also be possible to use 'pages' from struct firmware and avoid * NOTE: it may also be possible to use 'pages' from struct firmware and avoid bounce buffer
* bounce buffer
*/ */
static int wfx_sram_write_dma_safe(struct wfx_dev *wdev, u32 addr, const u8 *buf, size_t len) static int wfx_sram_write_dma_safe(struct wfx_dev *wdev, u32 addr, const u8 *buf, size_t len)
{ {
...@@ -202,9 +200,7 @@ static int upload_firmware(struct wfx_dev *wdev, const u8 *data, size_t len) ...@@ -202,9 +200,7 @@ static int upload_firmware(struct wfx_dev *wdev, const u8 *data, size_t len)
if (ret < 0) if (ret < 0)
return ret; return ret;
/* The device seems to not support writing 0 in this register /* The device seems to not support writing 0 in this register during first loop */
* during first loop
*/
offs += DNLD_BLOCK_SIZE; offs += DNLD_BLOCK_SIZE;
ret = wfx_sram_reg_write(wdev, WFX_DCA_PUT, offs); ret = wfx_sram_reg_write(wdev, WFX_DCA_PUT, offs);
if (ret < 0) if (ret < 0)
......
...@@ -174,8 +174,8 @@ enum wfx_hif_frame_format { ...@@ -174,8 +174,8 @@ enum wfx_hif_frame_format {
}; };
struct wfx_hif_req_tx { struct wfx_hif_req_tx {
/* packet_id is not interpreted by the device, so it is not necessary to /* packet_id is not interpreted by the device, so it is not necessary to declare it little
* declare it little endian * endian
*/ */
u32 packet_id; u32 packet_id;
u8 max_tx_rate; u8 max_tx_rate;
...@@ -212,8 +212,8 @@ enum wfx_hif_qos_ackplcy { ...@@ -212,8 +212,8 @@ enum wfx_hif_qos_ackplcy {
struct wfx_hif_cnf_tx { struct wfx_hif_cnf_tx {
__le32 status; __le32 status;
/* packet_id is copied from struct wfx_hif_req_tx without been interpreted /* packet_id is copied from struct wfx_hif_req_tx without been interpreted by the device, so
* by the device, so it is not necessary to declare it little endian * it is not necessary to declare it little endian
*/ */
u32 packet_id; u32 packet_id;
u8 txed_rate; u8 txed_rate;
......
...@@ -371,9 +371,7 @@ void wfx_handle_rx(struct wfx_dev *wdev, struct sk_buff *skb) ...@@ -371,9 +371,7 @@ void wfx_handle_rx(struct wfx_dev *wdev, struct sk_buff *skb)
wfx_hif_receive_indication(wdev, hif, hif->body, skb); wfx_hif_receive_indication(wdev, hif, hif->body, skb);
return; return;
} }
/* Note: mutex_is_lock cause an implicit memory barrier that protect /* Note: mutex_is_lock cause an implicit memory barrier that protect buf_send */
* buf_send
*/
if (mutex_is_locked(&wdev->hif_cmd.lock) && if (mutex_is_locked(&wdev->hif_cmd.lock) &&
wdev->hif_cmd.buf_send && wdev->hif_cmd.buf_send->id == hif_id) { wdev->hif_cmd.buf_send && wdev->hif_cmd.buf_send->id == hif_id) {
wfx_hif_generic_confirm(wdev, hif, hif->body); wfx_hif_generic_confirm(wdev, hif, hif->body);
......
...@@ -61,8 +61,8 @@ int wfx_cmd_send(struct wfx_dev *wdev, struct wfx_hif_msg *request, ...@@ -61,8 +61,8 @@ int wfx_cmd_send(struct wfx_dev *wdev, struct wfx_hif_msg *request,
mutex_lock(&wdev->hif_cmd.lock); mutex_lock(&wdev->hif_cmd.lock);
WARN(wdev->hif_cmd.buf_send, "data locking error"); WARN(wdev->hif_cmd.buf_send, "data locking error");
/* Note: call to complete() below has an implicit memory barrier that /* Note: call to complete() below has an implicit memory barrier that hopefully protect
* hopefully protect buf_send * buf_send
*/ */
wdev->hif_cmd.buf_send = request; wdev->hif_cmd.buf_send = request;
wdev->hif_cmd.buf_recv = reply; wdev->hif_cmd.buf_recv = reply;
...@@ -72,9 +72,7 @@ int wfx_cmd_send(struct wfx_dev *wdev, struct wfx_hif_msg *request, ...@@ -72,9 +72,7 @@ int wfx_cmd_send(struct wfx_dev *wdev, struct wfx_hif_msg *request,
wfx_bh_request_tx(wdev); wfx_bh_request_tx(wdev);
if (no_reply) { if (no_reply) {
/* Chip won't reply. Give enough time to the wq to send the /* Chip won't reply. Give enough time to the wq to send the buffer. */
* buffer.
*/
msleep(100); msleep(100);
wdev->hif_cmd.buf_send = NULL; wdev->hif_cmd.buf_send = NULL;
mutex_unlock(&wdev->hif_cmd.lock); mutex_unlock(&wdev->hif_cmd.lock);
...@@ -118,8 +116,8 @@ int wfx_cmd_send(struct wfx_dev *wdev, struct wfx_hif_msg *request, ...@@ -118,8 +116,8 @@ int wfx_cmd_send(struct wfx_dev *wdev, struct wfx_hif_msg *request,
return ret; return ret;
} }
/* This function is special. After HIF_REQ_ID_SHUT_DOWN, chip won't reply to any /* This function is special. After HIF_REQ_ID_SHUT_DOWN, chip won't reply to any request anymore.
* request anymore. Obviously, only call this function during device unregister. * Obviously, only call this function during device unregister.
*/ */
int wfx_hif_shutdown(struct wfx_dev *wdev) int wfx_hif_shutdown(struct wfx_dev *wdev)
{ {
...@@ -340,9 +338,7 @@ int wfx_hif_add_key(struct wfx_dev *wdev, const struct wfx_hif_req_add_key *arg) ...@@ -340,9 +338,7 @@ int wfx_hif_add_key(struct wfx_dev *wdev, const struct wfx_hif_req_add_key *arg)
/* FIXME: swap bytes as necessary in body */ /* FIXME: swap bytes as necessary in body */
memcpy(body, arg, sizeof(*body)); memcpy(body, arg, sizeof(*body));
if (wfx_api_older_than(wdev, 1, 5)) if (wfx_api_older_than(wdev, 1, 5))
/* Legacy firmwares expect that add_key to be sent on right /* Legacy firmwares expect that add_key to be sent on right interface. */
* interface.
*/
wfx_fill_header(hif, arg->int_id, HIF_REQ_ID_ADD_KEY, sizeof(*body)); wfx_fill_header(hif, arg->int_id, HIF_REQ_ID_ADD_KEY, sizeof(*body));
else else
wfx_fill_header(hif, -1, HIF_REQ_ID_ADD_KEY, sizeof(*body)); wfx_fill_header(hif, -1, HIF_REQ_ID_ADD_KEY, sizeof(*body));
......
...@@ -12,9 +12,8 @@ ...@@ -12,9 +12,8 @@
struct wfx_dev; struct wfx_dev;
/* Caution: in the functions below, 'buf' will used with a DMA. So, it must be /* Caution: in the functions below, 'buf' will used with a DMA. So, it must be kmalloc'd (do not use
* kmalloc'd (do not use stack allocated buffers). In doubt, enable * stack allocated buffers). In doubt, enable CONFIG_DEBUG_SG to detect badly located buffer.
* CONFIG_DEBUG_SG to detect badly located buffer.
*/ */
int wfx_data_read(struct wfx_dev *wdev, void *buf, size_t buf_len); int wfx_data_read(struct wfx_dev *wdev, void *buf, size_t buf_len);
int wfx_data_write(struct wfx_dev *wdev, const void *buf, size_t buf_len); int wfx_data_write(struct wfx_dev *wdev, const void *buf, size_t buf_len);
......
...@@ -162,19 +162,17 @@ bool wfx_api_older_than(struct wfx_dev *wdev, int major, int minor) ...@@ -162,19 +162,17 @@ bool wfx_api_older_than(struct wfx_dev *wdev, int major, int minor)
return false; return false;
} }
/* The device needs data about the antenna configuration. This information in /* The device needs data about the antenna configuration. This information in provided by PDS
* provided by PDS (Platform Data Set, this is the wording used in WF200 * (Platform Data Set, this is the wording used in WF200 documentation) files. For hardware
* documentation) files. For hardware integrators, the full process to create * integrators, the full process to create PDS files is described here:
* PDS files is described here:
* https:github.com/SiliconLabs/wfx-firmware/blob/master/PDS/README.md * https:github.com/SiliconLabs/wfx-firmware/blob/master/PDS/README.md
* *
* So this function aims to send PDS to the device. However, the PDS file is * So this function aims to send PDS to the device. However, the PDS file is often bigger than Rx
* often bigger than Rx buffers of the chip, so it has to be sent in multiple * buffers of the chip, so it has to be sent in multiple parts.
* parts.
* *
* In add, the PDS data cannot be split anywhere. The PDS files contains tree * In add, the PDS data cannot be split anywhere. The PDS files contains tree structures. Braces are
* structures. Braces are used to enter/leave a level of the tree (in a JSON * used to enter/leave a level of the tree (in a JSON fashion). PDS files can only been split
* fashion). PDS files can only been split between root nodes. * between root nodes.
*/ */
int wfx_send_pds(struct wfx_dev *wdev, u8 *buf, size_t len) int wfx_send_pds(struct wfx_dev *wdev, u8 *buf, size_t len)
{ {
...@@ -341,8 +339,8 @@ int wfx_probe(struct wfx_dev *wdev) ...@@ -341,8 +339,8 @@ int wfx_probe(struct wfx_dev *wdev)
int err; int err;
struct gpio_desc *gpio_saved; struct gpio_desc *gpio_saved;
/* During first part of boot, gpio_wakeup cannot yet been used. So /* During first part of boot, gpio_wakeup cannot yet been used. So prevent bh() to touch
* prevent bh() to touch it. * it.
*/ */
gpio_saved = wdev->pdata.gpio_wakeup; gpio_saved = wdev->pdata.gpio_wakeup;
wdev->pdata.gpio_wakeup = NULL; wdev->pdata.gpio_wakeup = NULL;
......
...@@ -23,8 +23,8 @@ struct wfx_platform_data { ...@@ -23,8 +23,8 @@ struct wfx_platform_data {
const char *file_fw; const char *file_fw;
const char *file_pds; const char *file_pds;
struct gpio_desc *gpio_wakeup; struct gpio_desc *gpio_wakeup;
/* if true HIF D_out is sampled on the rising edge of the clock /* if true HIF D_out is sampled on the rising edge of the clock (intended to be used in
* (intended to be used in 50Mhz SDIO) * 50Mhz SDIO)
*/ */
bool use_rising_clk; bool use_rising_clk;
}; };
......
...@@ -59,9 +59,8 @@ void wfx_tx_lock_flush(struct wfx_dev *wdev) ...@@ -59,9 +59,8 @@ void wfx_tx_lock_flush(struct wfx_dev *wdev)
void wfx_tx_queues_init(struct wfx_vif *wvif) void wfx_tx_queues_init(struct wfx_vif *wvif)
{ {
/* The device is in charge to respect the details of the QoS parameters. /* The device is in charge to respect the details of the QoS parameters. The driver just
* The driver just ensure that it roughtly respect the priorities to * ensure that it roughtly respect the priorities to avoid any shortage.
* avoid any shortage.
*/ */
const int priorities[IEEE80211_NUM_ACS] = { 1, 2, 64, 128 }; const int priorities[IEEE80211_NUM_ACS] = { 1, 2, 64, 128 };
int i; int i;
......
...@@ -107,8 +107,8 @@ void wfx_configure_filter(struct ieee80211_hw *hw, unsigned int changed_flags, ...@@ -107,8 +107,8 @@ void wfx_configure_filter(struct ieee80211_hw *hw, unsigned int changed_flags,
* - PS-Poll (FIF_PSPOLL) are never filtered * - PS-Poll (FIF_PSPOLL) are never filtered
* - RTS, CTS and Ack (FIF_CONTROL) are always filtered * - RTS, CTS and Ack (FIF_CONTROL) are always filtered
* - Broken frames (FIF_FCSFAIL and FIF_PLCPFAIL) are always filtered * - Broken frames (FIF_FCSFAIL and FIF_PLCPFAIL) are always filtered
* - Firmware does (yet) allow to forward unicast traffic sent to * - Firmware does (yet) allow to forward unicast traffic sent to other stations (aka.
* other stations (aka. promiscuous mode) * promiscuous mode)
*/ */
*total_flags &= FIF_BCN_PRBRESP_PROMISC | FIF_ALLMULTI | FIF_OTHER_BSS | *total_flags &= FIF_BCN_PRBRESP_PROMISC | FIF_ALLMULTI | FIF_OTHER_BSS |
FIF_PROBE_REQ | FIF_PSPOLL; FIF_PROBE_REQ | FIF_PSPOLL;
...@@ -168,9 +168,7 @@ static int wfx_get_ps_timeout(struct wfx_vif *wvif, bool *enable_ps) ...@@ -168,9 +168,7 @@ static int wfx_get_ps_timeout(struct wfx_vif *wvif, bool *enable_ps)
dev_info(wvif->wdev->dev, "ignoring requested PS mode"); dev_info(wvif->wdev->dev, "ignoring requested PS mode");
return -1; return -1;
} }
/* It is necessary to enable PS if channels /* It is necessary to enable PS if channels are different. */
* are different.
*/
if (enable_ps) if (enable_ps)
*enable_ps = true; *enable_ps = true;
if (wvif->wdev->force_ps_timeout > -1) if (wvif->wdev->force_ps_timeout > -1)
...@@ -429,10 +427,9 @@ static void wfx_join(struct wfx_vif *wvif) ...@@ -429,10 +427,9 @@ static void wfx_join(struct wfx_vif *wvif)
ieee80211_connection_loss(wvif->vif); ieee80211_connection_loss(wvif->vif);
wfx_reset(wvif); wfx_reset(wvif);
} else { } else {
/* Due to beacon filtering it is possible that the /* Due to beacon filtering it is possible that the AP's beacon is not known for the
* AP's beacon is not known for the mac80211 stack. * mac80211 stack. Disable filtering temporary to make sure the stack receives at
* Disable filtering temporary to make sure the stack * least one
* receives at least one
*/ */
wfx_filter_beacon(wvif, false); wfx_filter_beacon(wvif, false);
} }
...@@ -459,9 +456,7 @@ static void wfx_join_finalize(struct wfx_vif *wvif, ...@@ -459,9 +456,7 @@ static void wfx_join_finalize(struct wfx_vif *wvif,
wvif->join_in_progress = false; wvif->join_in_progress = false;
wfx_hif_set_association_mode(wvif, ampdu_density, greenfield, info->use_short_preamble); wfx_hif_set_association_mode(wvif, ampdu_density, greenfield, info->use_short_preamble);
wfx_hif_keep_alive_period(wvif, 0); wfx_hif_keep_alive_period(wvif, 0);
/* beacon_loss_count is defined to 7 in net/mac80211/mlme.c. Let's use /* beacon_loss_count is defined to 7 in net/mac80211/mlme.c. Let's use the same value. */
* the same value.
*/
wfx_hif_set_bss_params(wvif, info->aid, 7); wfx_hif_set_bss_params(wvif, info->aid, 7);
wfx_hif_set_beacon_wakeup_period(wvif, 1, 1); wfx_hif_set_beacon_wakeup_period(wvif, 1, 1);
wfx_update_pm(wvif); wfx_update_pm(wvif);
...@@ -485,10 +480,9 @@ void wfx_leave_ibss(struct ieee80211_hw *hw, struct ieee80211_vif *vif) ...@@ -485,10 +480,9 @@ void wfx_leave_ibss(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
static void wfx_enable_beacon(struct wfx_vif *wvif, bool enable) static void wfx_enable_beacon(struct wfx_vif *wvif, bool enable)
{ {
/* Driver has Content After DTIM Beacon in queue. Driver is waiting for /* Driver has Content After DTIM Beacon in queue. Driver is waiting for a signal from the
* a signal from the firmware. Since we are going to stop to send * firmware. Since we are going to stop to send beacons, this signal will never happens. See
* beacons, this signal will never happens. See also * also wfx_suspend_resume_mc()
* wfx_suspend_resume_mc()
*/ */
if (!enable && wfx_tx_queues_has_cab(wvif)) { if (!enable && wfx_tx_queues_has_cab(wvif)) {
wvif->after_dtim_tx_allowed = true; wvif->after_dtim_tx_allowed = true;
...@@ -527,9 +521,7 @@ void wfx_bss_info_changed(struct ieee80211_hw *hw, struct ieee80211_vif *vif, ...@@ -527,9 +521,7 @@ void wfx_bss_info_changed(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
if (vif->type != NL80211_IFTYPE_STATION) if (vif->type != NL80211_IFTYPE_STATION)
dev_warn(wdev->dev, "%s: misunderstood change: BEACON_INFO\n", __func__); dev_warn(wdev->dev, "%s: misunderstood change: BEACON_INFO\n", __func__);
wfx_hif_set_beacon_wakeup_period(wvif, info->dtim_period, info->dtim_period); wfx_hif_set_beacon_wakeup_period(wvif, info->dtim_period, info->dtim_period);
/* We temporary forwarded beacon for join process. It is now no /* We temporary forwarded beacon for join process. It is now no more necessary. */
* more necessary.
*/
wfx_filter_beacon(wvif, true); wfx_filter_beacon(wvif, true);
} }
...@@ -629,8 +621,8 @@ void wfx_suspend_resume_mc(struct wfx_vif *wvif, enum sta_notify_cmd notify_cmd) ...@@ -629,8 +621,8 @@ void wfx_suspend_resume_mc(struct wfx_vif *wvif, enum sta_notify_cmd notify_cmd)
if (notify_cmd != STA_NOTIFY_AWAKE) if (notify_cmd != STA_NOTIFY_AWAKE)
return; return;
/* Device won't be able to honor CAB if a scan is in progress on any /* Device won't be able to honor CAB if a scan is in progress on any interface. Prefer to
* interface. Prefer to skip this DTIM and wait for the next one. * skip this DTIM and wait for the next one.
*/ */
wvif_it = NULL; wvif_it = NULL;
while ((wvif_it = wvif_iterate(wvif->wdev, wvif_it)) != NULL) while ((wvif_it = wvif_iterate(wvif->wdev, wvif_it)) != NULL)
......
...@@ -18,8 +18,8 @@ ...@@ -18,8 +18,8 @@
#include "hif_api_cmd.h" #include "hif_api_cmd.h"
#include "hif_api_mib.h" #include "hif_api_mib.h"
/* The hell below need some explanations. For each symbolic number, we need to /* The hell below need some explanations. For each symbolic number, we need to define it with
* define it with TRACE_DEFINE_ENUM() and in a list for __print_symbolic. * TRACE_DEFINE_ENUM() and in a list for __print_symbolic.
* *
* 1. Define a new macro that call TRACE_DEFINE_ENUM(): * 1. Define a new macro that call TRACE_DEFINE_ENUM():
* *
...@@ -41,9 +41,8 @@ ...@@ -41,9 +41,8 @@
* #undef xxx_name * #undef xxx_name
* #define xxx_name(msg) { msg, #msg }, * #define xxx_name(msg) { msg, #msg },
* *
* 5. list_name can now nearly be used with __print_symbolic() but, * 5. list_name can now nearly be used with __print_symbolic() but, __print_symbolic() dislike
* __print_symbolic() dislike last comma of list. So we define a new list * last comma of list. So we define a new list with a dummy element:
* with a dummy element:
* *
* #define list_for_print_symbolic list_names { -1, NULL } * #define list_for_print_symbolic list_names { -1, NULL }
*/ */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment