diff options
Diffstat (limited to 'drivers/staging/wfx/hif_rx.c')
-rw-r--r-- | drivers/staging/wfx/hif_rx.c | 78 |
1 files changed, 53 insertions, 25 deletions
diff --git a/drivers/staging/wfx/hif_rx.c b/drivers/staging/wfx/hif_rx.c index 36e171b27ae2..820de216be0c 100644 --- a/drivers/staging/wfx/hif_rx.c +++ b/drivers/staging/wfx/hif_rx.c @@ -18,7 +18,8 @@ #include "secure_link.h" #include "hif_api_cmd.h" -static int hif_generic_confirm(struct wfx_dev *wdev, struct hif_msg *hif, void *buf) +static int hif_generic_confirm(struct wfx_dev *wdev, struct hif_msg *hif, + void *buf) { // All confirm messages start with status int status = le32_to_cpu(*((__le32 *) buf)); @@ -33,7 +34,8 @@ static int hif_generic_confirm(struct wfx_dev *wdev, struct hif_msg *hif, void * } if (cmd != wdev->hif_cmd.buf_send->id) { - dev_warn(wdev->dev, "chip response mismatch request: 0x%.2x vs 0x%.2x\n", + dev_warn(wdev->dev, + "chip response mismatch request: 0x%.2x vs 0x%.2x\n", cmd, wdev->hif_cmd.buf_send->id); return -EINVAL; } @@ -70,7 +72,8 @@ static int hif_tx_confirm(struct wfx_dev *wdev, struct hif_msg *hif, void *buf) return 0; } -static int hif_multi_tx_confirm(struct wfx_dev *wdev, struct hif_msg *hif, void *buf) +static int hif_multi_tx_confirm(struct wfx_dev *wdev, struct hif_msg *hif, + void *buf) { struct hif_cnf_multi_transmit *body = buf; struct hif_cnf_tx *buf_loc = (struct hif_cnf_tx *) &body->tx_conf_payload; @@ -90,7 +93,8 @@ static int hif_multi_tx_confirm(struct wfx_dev *wdev, struct hif_msg *hif, void return 0; } -static int hif_startup_indication(struct wfx_dev *wdev, struct hif_msg *hif, void *buf) +static int hif_startup_indication(struct wfx_dev *wdev, struct hif_msg *hif, + void *buf) { struct hif_ind_startup *body = buf; @@ -108,7 +112,8 @@ static int hif_startup_indication(struct wfx_dev *wdev, struct hif_msg *hif, voi return 0; } -static int hif_wakeup_indication(struct wfx_dev *wdev, struct hif_msg *hif, void *buf) +static int hif_wakeup_indication(struct wfx_dev *wdev, struct hif_msg *hif, + void *buf) { if (!wdev->pdata.gpio_wakeup || !gpiod_get_value(wdev->pdata.gpio_wakeup)) { @@ -118,7 +123,8 @@ static int hif_wakeup_indication(struct wfx_dev *wdev, struct hif_msg *hif, void return 0; } -static int hif_keys_indication(struct wfx_dev *wdev, struct hif_msg *hif, void *buf) +static int hif_keys_indication(struct wfx_dev *wdev, struct hif_msg *hif, + void *buf) { struct hif_ind_sl_exchange_pub_keys *body = buf; @@ -131,13 +137,15 @@ static int hif_keys_indication(struct wfx_dev *wdev, struct hif_msg *hif, void * return 0; } -static int hif_receive_indication(struct wfx_dev *wdev, struct hif_msg *hif, void *buf, struct sk_buff *skb) +static int hif_receive_indication(struct wfx_dev *wdev, struct hif_msg *hif, + void *buf, struct sk_buff *skb) { struct wfx_vif *wvif = wdev_to_wvif(wdev, hif->interface); struct hif_ind_rx *body = buf; if (!wvif) { - dev_warn(wdev->dev, "ignore rx data for non-existent vif %d\n", hif->interface); + dev_warn(wdev->dev, "ignore rx data for non-existent vif %d\n", + hif->interface); return 0; } skb_pull(skb, sizeof(struct hif_msg) + sizeof(struct hif_ind_rx)); @@ -146,7 +154,8 @@ static int hif_receive_indication(struct wfx_dev *wdev, struct hif_msg *hif, voi return 0; } -static int hif_event_indication(struct wfx_dev *wdev, struct hif_msg *hif, void *buf) +static int hif_event_indication(struct wfx_dev *wdev, struct hif_msg *hif, + void *buf) { struct wfx_vif *wvif = wdev_to_wvif(wdev, hif->interface); struct hif_ind_event *body = buf; @@ -173,7 +182,8 @@ static int hif_event_indication(struct wfx_dev *wdev, struct hif_msg *hif, void return 0; } -static int hif_pm_mode_complete_indication(struct wfx_dev *wdev, struct hif_msg *hif, void *buf) +static int hif_pm_mode_complete_indication(struct wfx_dev *wdev, + struct hif_msg *hif, void *buf) { struct wfx_vif *wvif = wdev_to_wvif(wdev, hif->interface); @@ -183,7 +193,8 @@ static int hif_pm_mode_complete_indication(struct wfx_dev *wdev, struct hif_msg return 0; } -static int hif_scan_complete_indication(struct wfx_dev *wdev, struct hif_msg *hif, void *buf) +static int hif_scan_complete_indication(struct wfx_dev *wdev, + struct hif_msg *hif, void *buf) { struct wfx_vif *wvif = wdev_to_wvif(wdev, hif->interface); struct hif_ind_scan_cmpl *body = buf; @@ -194,7 +205,8 @@ static int hif_scan_complete_indication(struct wfx_dev *wdev, struct hif_msg *hi return 0; } -static int hif_join_complete_indication(struct wfx_dev *wdev, struct hif_msg *hif, void *buf) +static int hif_join_complete_indication(struct wfx_dev *wdev, + struct hif_msg *hif, void *buf) { struct wfx_vif *wvif = wdev_to_wvif(wdev, hif->interface); @@ -204,7 +216,8 @@ static int hif_join_complete_indication(struct wfx_dev *wdev, struct hif_msg *hi return 0; } -static int hif_suspend_resume_indication(struct wfx_dev *wdev, struct hif_msg *hif, void *buf) +static int hif_suspend_resume_indication(struct wfx_dev *wdev, + struct hif_msg *hif, void *buf) { struct wfx_vif *wvif = wdev_to_wvif(wdev, hif->interface); struct hif_ind_suspend_resume_tx *body = buf; @@ -215,7 +228,8 @@ static int hif_suspend_resume_indication(struct wfx_dev *wdev, struct hif_msg *h return 0; } -static int hif_error_indication(struct wfx_dev *wdev, struct hif_msg *hif, void *buf) +static int hif_error_indication(struct wfx_dev *wdev, struct hif_msg *hif, + void *buf) { struct hif_ind_error *body = buf; u8 *pRollback = (u8 *) body->data; @@ -223,31 +237,39 @@ static int hif_error_indication(struct wfx_dev *wdev, struct hif_msg *hif, void switch (body->type) { case HIF_ERROR_FIRMWARE_ROLLBACK: - dev_err(wdev->dev, "asynchronous error: firmware rollback error %d\n", *pRollback); + dev_err(wdev->dev, + "asynchronous error: firmware rollback error %d\n", + *pRollback); break; case HIF_ERROR_FIRMWARE_DEBUG_ENABLED: dev_err(wdev->dev, "asynchronous error: firmware debug feature enabled\n"); break; case HIF_ERROR_OUTDATED_SESSION_KEY: - dev_err(wdev->dev, "asynchronous error: secure link outdated key: %#.8x\n", *pStatus); + dev_err(wdev->dev, "asynchronous error: secure link outdated key: %#.8x\n", + *pStatus); break; case HIF_ERROR_INVALID_SESSION_KEY: dev_err(wdev->dev, "asynchronous error: invalid session key\n"); break; case HIF_ERROR_OOR_VOLTAGE: - dev_err(wdev->dev, "asynchronous error: out-of-range overvoltage: %#.8x\n", *pStatus); + dev_err(wdev->dev, "asynchronous error: out-of-range overvoltage: %#.8x\n", + *pStatus); break; case HIF_ERROR_PDS_VERSION: - dev_err(wdev->dev, "asynchronous error: wrong PDS payload or version: %#.8x\n", *pStatus); + dev_err(wdev->dev, + "asynchronous error: wrong PDS payload or version: %#.8x\n", + *pStatus); break; default: - dev_err(wdev->dev, "asynchronous error: unknown (%d)\n", body->type); + dev_err(wdev->dev, "asynchronous error: unknown (%d)\n", + body->type); break; } return 0; } -static int hif_generic_indication(struct wfx_dev *wdev, struct hif_msg *hif, void *buf) +static int hif_generic_indication(struct wfx_dev *wdev, struct hif_msg *hif, + void *buf) { struct hif_ind_generic *body = buf; @@ -255,23 +277,29 @@ static int hif_generic_indication(struct wfx_dev *wdev, struct hif_msg *hif, voi case HIF_GENERIC_INDICATION_TYPE_RAW: return 0; case HIF_GENERIC_INDICATION_TYPE_STRING: - dev_info(wdev->dev, "firmware says: %s\n", (char *) body->indication_data.raw_data); + dev_info(wdev->dev, "firmware says: %s\n", + (char *) body->indication_data.raw_data); return 0; case HIF_GENERIC_INDICATION_TYPE_RX_STATS: mutex_lock(&wdev->rx_stats_lock); // Older firmware send a generic indication beside RxStats if (!wfx_api_older_than(wdev, 1, 4)) - dev_info(wdev->dev, "Rx test ongoing. Temperature: %d°C\n", body->indication_data.rx_stats.current_temp); - memcpy(&wdev->rx_stats, &body->indication_data.rx_stats, sizeof(wdev->rx_stats)); + dev_info(wdev->dev, "Rx test ongoing. Temperature: %d°C\n", + body->indication_data.rx_stats.current_temp); + memcpy(&wdev->rx_stats, &body->indication_data.rx_stats, + sizeof(wdev->rx_stats)); mutex_unlock(&wdev->rx_stats_lock); return 0; default: - dev_err(wdev->dev, "generic_indication: unknown indication type: %#.8x\n", body->indication_type); + dev_err(wdev->dev, + "generic_indication: unknown indication type: %#.8x\n", + body->indication_type); return -EIO; } } -static int hif_exception_indication(struct wfx_dev *wdev, struct hif_msg *hif, void *buf) +static int hif_exception_indication(struct wfx_dev *wdev, + struct hif_msg *hif, void *buf) { size_t len = hif->len - 4; // drop header dev_err(wdev->dev, "firmware exception\n"); |