Commit 4d69c752 authored by Stanislaw Gruszka's avatar Stanislaw Gruszka

iwlegacy: rename REPLY_ to N_ or C_

Signed-off-by: default avatarStanislaw Gruszka <sgruszka@redhat.com>
parent db7746f7
...@@ -348,7 +348,7 @@ static int il3945_send_beacon_cmd(struct il_priv *il) ...@@ -348,7 +348,7 @@ static int il3945_send_beacon_cmd(struct il_priv *il)
frame_size = il3945_hw_get_beacon_cmd(il, frame, rate); frame_size = il3945_hw_get_beacon_cmd(il, frame, rate);
rc = il_send_cmd_pdu(il, REPLY_TX_BEACON, frame_size, rc = il_send_cmd_pdu(il, C_TX_BEACON, frame_size,
&frame->u.cmd[0]); &frame->u.cmd[0]);
il3945_free_frame(il, frame); il3945_free_frame(il, frame);
...@@ -406,7 +406,7 @@ static void il3945_build_tx_cmd_hwcrypto(struct il_priv *il, ...@@ -406,7 +406,7 @@ static void il3945_build_tx_cmd_hwcrypto(struct il_priv *il,
} }
/* /*
* handle build REPLY_TX command notification. * handle build C_TX command notification.
*/ */
static void il3945_build_tx_cmd_basic(struct il_priv *il, static void il3945_build_tx_cmd_basic(struct il_priv *il,
struct il_device_cmd *cmd, struct il_device_cmd *cmd,
...@@ -460,7 +460,7 @@ static void il3945_build_tx_cmd_basic(struct il_priv *il, ...@@ -460,7 +460,7 @@ static void il3945_build_tx_cmd_basic(struct il_priv *il,
} }
/* /*
* start REPLY_TX command process * start C_TX command process
*/ */
static int il3945_tx_skb(struct il_priv *il, struct sk_buff *skb) static int il3945_tx_skb(struct il_priv *il, struct sk_buff *skb)
{ {
...@@ -560,7 +560,7 @@ static int il3945_tx_skb(struct il_priv *il, struct sk_buff *skb) ...@@ -560,7 +560,7 @@ static int il3945_tx_skb(struct il_priv *il, struct sk_buff *skb)
* after Tx, uCode's Tx response will return this value so driver can * after Tx, uCode's Tx response will return this value so driver can
* locate the frame within the tx queue and do post-tx processing. * locate the frame within the tx queue and do post-tx processing.
*/ */
out_cmd->hdr.cmd = REPLY_TX; out_cmd->hdr.cmd = C_TX;
out_cmd->hdr.sequence = cpu_to_le16((u16)(QUEUE_TO_SEQ(txq_id) | out_cmd->hdr.sequence = cpu_to_le16((u16)(QUEUE_TO_SEQ(txq_id) |
IDX_TO_SEQ(q->write_ptr))); IDX_TO_SEQ(q->write_ptr)));
...@@ -672,7 +672,7 @@ static int il3945_get_measurement(struct il_priv *il, ...@@ -672,7 +672,7 @@ static int il3945_get_measurement(struct il_priv *il,
struct il_spectrum_cmd spectrum; struct il_spectrum_cmd spectrum;
struct il_rx_pkt *pkt; struct il_rx_pkt *pkt;
struct il_host_cmd cmd = { struct il_host_cmd cmd = {
.id = REPLY_SPECTRUM_MEASUREMENT_CMD, .id = C_SPECTRUM_MEASUREMENT,
.data = (void *)&spectrum, .data = (void *)&spectrum,
.flags = CMD_WANT_SKB, .flags = CMD_WANT_SKB,
}; };
...@@ -717,7 +717,7 @@ static int il3945_get_measurement(struct il_priv *il, ...@@ -717,7 +717,7 @@ static int il3945_get_measurement(struct il_priv *il,
pkt = (struct il_rx_pkt *)cmd.reply_page; pkt = (struct il_rx_pkt *)cmd.reply_page;
if (pkt->hdr.flags & IL_CMD_FAILED_MSK) { if (pkt->hdr.flags & IL_CMD_FAILED_MSK) {
IL_ERR("Bad return from REPLY_RX_ON_ASSOC command\n"); IL_ERR("Bad return from N_RX_ON_ASSOC command\n");
rc = -EIO; rc = -EIO;
} }
...@@ -786,7 +786,7 @@ static void il3945_rx_reply_add_sta(struct il_priv *il, ...@@ -786,7 +786,7 @@ static void il3945_rx_reply_add_sta(struct il_priv *il,
struct il_rx_pkt *pkt = rxb_addr(rxb); struct il_rx_pkt *pkt = rxb_addr(rxb);
#endif #endif
D_RX("Received REPLY_ADD_STA: 0x%02X\n", pkt->u.status); D_RX("Received C_ADD_STA: 0x%02X\n", pkt->u.status);
} }
static void il3945_rx_beacon_notif(struct il_priv *il, static void il3945_rx_beacon_notif(struct il_priv *il,
...@@ -853,27 +853,27 @@ static void il3945_rx_card_state_notif(struct il_priv *il, ...@@ -853,27 +853,27 @@ static void il3945_rx_card_state_notif(struct il_priv *il,
*/ */
static void il3945_setup_rx_handlers(struct il_priv *il) static void il3945_setup_rx_handlers(struct il_priv *il)
{ {
il->rx_handlers[REPLY_ALIVE] = il3945_rx_reply_alive; il->rx_handlers[N_ALIVE] = il3945_rx_reply_alive;
il->rx_handlers[REPLY_ADD_STA] = il3945_rx_reply_add_sta; il->rx_handlers[C_ADD_STA] = il3945_rx_reply_add_sta;
il->rx_handlers[REPLY_ERROR] = il_rx_reply_error; il->rx_handlers[N_ERROR] = il_rx_reply_error;
il->rx_handlers[CHANNEL_SWITCH_NOTIFICATION] = il_rx_csa; il->rx_handlers[N_CHANNEL_SWITCH] = il_rx_csa;
il->rx_handlers[SPECTRUM_MEASURE_NOTIFICATION] = il->rx_handlers[N_SPECTRUM_MEASUREMENT] =
il_rx_spectrum_measure_notif; il_rx_spectrum_measure_notif;
il->rx_handlers[PM_SLEEP_NOTIFICATION] = il_rx_pm_sleep_notif; il->rx_handlers[N_PM_SLEEP] = il_rx_pm_sleep_notif;
il->rx_handlers[PM_DEBUG_STATISTIC_NOTIFIC] = il->rx_handlers[N_PM_DEBUG_STATS] =
il_rx_pm_debug_stats_notif; il_rx_pm_debug_stats_notif;
il->rx_handlers[BEACON_NOTIFICATION] = il3945_rx_beacon_notif; il->rx_handlers[N_BEACON] = il3945_rx_beacon_notif;
/* /*
* The same handler is used for both the REPLY to a discrete * The same handler is used for both the REPLY to a discrete
* stats request from the host as well as for the periodic * stats request from the host as well as for the periodic
* stats notifications (after received beacons) from the uCode. * stats notifications (after received beacons) from the uCode.
*/ */
il->rx_handlers[REPLY_STATS_CMD] = il3945_reply_stats; il->rx_handlers[C_STATS] = il3945_reply_stats;
il->rx_handlers[STATS_NOTIFICATION] = il3945_hw_rx_stats; il->rx_handlers[N_STATS] = il3945_hw_rx_stats;
il_setup_rx_scan_handlers(il); il_setup_rx_scan_handlers(il);
il->rx_handlers[CARD_STATE_NOTIFICATION] = il3945_rx_card_state_notif; il->rx_handlers[N_CARD_STATE] = il3945_rx_card_state_notif;
/* Set up hardware specific Rx handlers */ /* Set up hardware specific Rx handlers */
il3945_hw_rx_handler_setup(il); il3945_hw_rx_handler_setup(il);
...@@ -1253,8 +1253,8 @@ static void il3945_rx_handle(struct il_priv *il) ...@@ -1253,8 +1253,8 @@ static void il3945_rx_handle(struct il_priv *il)
* Ucode should set SEQ_RX_FRAME bit if ucode-originated, * Ucode should set SEQ_RX_FRAME bit if ucode-originated,
* but apparently a few don't get set; catch them here. */ * but apparently a few don't get set; catch them here. */
reclaim = !(pkt->hdr.sequence & SEQ_RX_FRAME) && reclaim = !(pkt->hdr.sequence & SEQ_RX_FRAME) &&
pkt->hdr.cmd != STATS_NOTIFICATION && pkt->hdr.cmd != N_STATS &&
pkt->hdr.cmd != REPLY_TX; pkt->hdr.cmd != C_TX;
/* Based on type of command response or notification, /* Based on type of command response or notification,
* handle those that need handling via function in * handle those that need handling via function in
...@@ -2137,9 +2137,9 @@ static int il3945_set_ucode_ptrs(struct il_priv *il) ...@@ -2137,9 +2137,9 @@ static int il3945_set_ucode_ptrs(struct il_priv *il)
} }
/** /**
* il3945_init_alive_start - Called after REPLY_ALIVE notification received * il3945_init_alive_start - Called after N_ALIVE notification received
* *
* Called after REPLY_ALIVE notification received from "initialize" uCode. * Called after N_ALIVE notification received from "initialize" uCode.
* *
* Tell "initialize" uCode to go ahead and load the runtime uCode. * Tell "initialize" uCode to go ahead and load the runtime uCode.
*/ */
...@@ -2180,7 +2180,7 @@ static void il3945_init_alive_start(struct il_priv *il) ...@@ -2180,7 +2180,7 @@ static void il3945_init_alive_start(struct il_priv *il)
} }
/** /**
* il3945_alive_start - called after REPLY_ALIVE notification received * il3945_alive_start - called after N_ALIVE notification received
* from protocol/runtime uCode (initialization uCode's * from protocol/runtime uCode (initialization uCode's
* Alive gets handled by il3945_init_alive_start()). * Alive gets handled by il3945_init_alive_start()).
*/ */
...@@ -2553,7 +2553,7 @@ static void il3945_rfkill_poll(struct work_struct *data) ...@@ -2553,7 +2553,7 @@ static void il3945_rfkill_poll(struct work_struct *data)
int il3945_request_scan(struct il_priv *il, struct ieee80211_vif *vif) int il3945_request_scan(struct il_priv *il, struct ieee80211_vif *vif)
{ {
struct il_host_cmd cmd = { struct il_host_cmd cmd = {
.id = REPLY_SCAN_CMD, .id = C_SCAN,
.len = sizeof(struct il3945_scan_cmd), .len = sizeof(struct il3945_scan_cmd),
.flags = CMD_SIZE_HUGE, .flags = CMD_SIZE_HUGE,
}; };
...@@ -2767,7 +2767,7 @@ void il3945_post_associate(struct il_priv *il) ...@@ -2767,7 +2767,7 @@ void il3945_post_associate(struct il_priv *il)
rc = il_send_rxon_timing(il, ctx); rc = il_send_rxon_timing(il, ctx);
if (rc) if (rc)
IL_WARN("REPLY_RXON_TIMING failed - " IL_WARN("C_RXON_TIMING failed - "
"Attempting to continue.\n"); "Attempting to continue.\n");
ctx->staging.filter_flags |= RXON_FILTER_ASSOC_MSK; ctx->staging.filter_flags |= RXON_FILTER_ASSOC_MSK;
...@@ -2931,7 +2931,7 @@ void il3945_config_ap(struct il_priv *il) ...@@ -2931,7 +2931,7 @@ void il3945_config_ap(struct il_priv *il)
/* RXON Timing */ /* RXON Timing */
rc = il_send_rxon_timing(il, ctx); rc = il_send_rxon_timing(il, ctx);
if (rc) if (rc)
IL_WARN("REPLY_RXON_TIMING failed - " IL_WARN("C_RXON_TIMING failed - "
"Attempting to continue.\n"); "Attempting to continue.\n");
ctx->staging.assoc_id = 0; ctx->staging.assoc_id = 0;
...@@ -3657,12 +3657,12 @@ static int il3945_pci_probe(struct pci_dev *pdev, const struct pci_device_id *en ...@@ -3657,12 +3657,12 @@ static int il3945_pci_probe(struct pci_dev *pdev, const struct pci_device_id *en
il->ctx.ctxid = 0; il->ctx.ctxid = 0;
il->ctx.rxon_cmd = REPLY_RXON; il->ctx.rxon_cmd = C_RXON;
il->ctx.rxon_timing_cmd = REPLY_RXON_TIMING; il->ctx.rxon_timing_cmd = C_RXON_TIMING;
il->ctx.rxon_assoc_cmd = REPLY_RXON_ASSOC; il->ctx.rxon_assoc_cmd = C_RXON_ASSOC;
il->ctx.qos_cmd = REPLY_QOS_PARAM; il->ctx.qos_cmd = C_QOS_PARAM;
il->ctx.ap_sta_id = IL_AP_ID; il->ctx.ap_sta_id = IL_AP_ID;
il->ctx.wep_key_cmd = REPLY_WEPKEY; il->ctx.wep_key_cmd = C_WEPKEY;
il->ctx.interface_modes = il->ctx.interface_modes =
BIT(NL80211_IFTYPE_STATION) | BIT(NL80211_IFTYPE_STATION) |
BIT(NL80211_IFTYPE_ADHOC); BIT(NL80211_IFTYPE_ADHOC);
......
...@@ -53,7 +53,7 @@ static int il3945_send_led_cmd(struct il_priv *il, ...@@ -53,7 +53,7 @@ static int il3945_send_led_cmd(struct il_priv *il,
struct il_led_cmd *led_cmd) struct il_led_cmd *led_cmd)
{ {
struct il_host_cmd cmd = { struct il_host_cmd cmd = {
.id = REPLY_LEDS_CMD, .id = C_LEDS,
.len = sizeof(struct il_led_cmd), .len = sizeof(struct il_led_cmd),
.data = led_cmd, .data = led_cmd,
.flags = CMD_ASYNC, .flags = CMD_ASYNC,
...@@ -1444,7 +1444,7 @@ static int il3945_send_tx_power(struct il_priv *il) ...@@ -1444,7 +1444,7 @@ static int il3945_send_tx_power(struct il_priv *il)
txpower.power[i].rate); txpower.power[i].rate);
} }
return il_send_cmd_pdu(il, REPLY_TX_PWR_TBL_CMD, return il_send_cmd_pdu(il, C_TX_PWR_TBL,
sizeof(struct il3945_txpowertable_cmd), sizeof(struct il3945_txpowertable_cmd),
&txpower); &txpower);
...@@ -1673,7 +1673,7 @@ static int il3945_send_rxon_assoc(struct il_priv *il, ...@@ -1673,7 +1673,7 @@ static int il3945_send_rxon_assoc(struct il_priv *il,
struct il_rx_pkt *pkt; struct il_rx_pkt *pkt;
struct il3945_rxon_assoc_cmd rxon_assoc; struct il3945_rxon_assoc_cmd rxon_assoc;
struct il_host_cmd cmd = { struct il_host_cmd cmd = {
.id = REPLY_RXON_ASSOC, .id = C_RXON_ASSOC,
.len = sizeof(rxon_assoc), .len = sizeof(rxon_assoc),
.flags = CMD_WANT_SKB, .flags = CMD_WANT_SKB,
.data = &rxon_assoc, .data = &rxon_assoc,
...@@ -1701,7 +1701,7 @@ static int il3945_send_rxon_assoc(struct il_priv *il, ...@@ -1701,7 +1701,7 @@ static int il3945_send_rxon_assoc(struct il_priv *il,
pkt = (struct il_rx_pkt *)cmd.reply_page; pkt = (struct il_rx_pkt *)cmd.reply_page;
if (pkt->hdr.flags & IL_CMD_FAILED_MSK) { if (pkt->hdr.flags & IL_CMD_FAILED_MSK) {
IL_ERR("Bad return from REPLY_RXON_ASSOC command\n"); IL_ERR("Bad return from C_RXON_ASSOC command\n");
rc = -EIO; rc = -EIO;
} }
...@@ -1782,7 +1782,7 @@ int il3945_commit_rxon(struct il_priv *il, struct il_rxon_context *ctx) ...@@ -1782,7 +1782,7 @@ int il3945_commit_rxon(struct il_priv *il, struct il_rxon_context *ctx)
*/ */
active_rxon->reserved4 = 0; active_rxon->reserved4 = 0;
active_rxon->reserved5 = 0; active_rxon->reserved5 = 0;
rc = il_send_cmd_pdu(il, REPLY_RXON, rc = il_send_cmd_pdu(il, C_RXON,
sizeof(struct il3945_rxon_cmd), sizeof(struct il3945_rxon_cmd),
&il->ctx.active); &il->ctx.active);
...@@ -1818,7 +1818,7 @@ int il3945_commit_rxon(struct il_priv *il, struct il_rxon_context *ctx) ...@@ -1818,7 +1818,7 @@ int il3945_commit_rxon(struct il_priv *il, struct il_rxon_context *ctx)
il_set_rxon_hwcrypto(il, ctx, !il3945_mod_params.sw_crypto); il_set_rxon_hwcrypto(il, ctx, !il3945_mod_params.sw_crypto);
/* Apply the new configuration */ /* Apply the new configuration */
rc = il_send_cmd_pdu(il, REPLY_RXON, rc = il_send_cmd_pdu(il, C_RXON,
sizeof(struct il3945_rxon_cmd), sizeof(struct il3945_rxon_cmd),
staging_rxon); staging_rxon);
if (rc) { if (rc) {
...@@ -2237,9 +2237,9 @@ int il3945_hw_tx_queue_init(struct il_priv *il, struct il_tx_queue *txq) ...@@ -2237,9 +2237,9 @@ int il3945_hw_tx_queue_init(struct il_priv *il, struct il_tx_queue *txq)
static u16 il3945_get_hcmd_size(u8 cmd_id, u16 len) static u16 il3945_get_hcmd_size(u8 cmd_id, u16 len)
{ {
switch (cmd_id) { switch (cmd_id) {
case REPLY_RXON: case C_RXON:
return sizeof(struct il3945_rxon_cmd); return sizeof(struct il3945_rxon_cmd);
case POWER_TBL_CMD: case C_POWER_TBL:
return sizeof(struct il3945_powertable_cmd); return sizeof(struct il3945_powertable_cmd);
default: default:
return len; return len;
...@@ -2383,14 +2383,14 @@ int il3945_init_hw_rate_table(struct il_priv *il) ...@@ -2383,14 +2383,14 @@ int il3945_init_hw_rate_table(struct il_priv *il)
/* Update the rate scaling for control frame Tx */ /* Update the rate scaling for control frame Tx */
rate_cmd.table_id = 0; rate_cmd.table_id = 0;
rc = il_send_cmd_pdu(il, REPLY_RATE_SCALE, sizeof(rate_cmd), rc = il_send_cmd_pdu(il, C_RATE_SCALE, sizeof(rate_cmd),
&rate_cmd); &rate_cmd);
if (rc) if (rc)
return rc; return rc;
/* Update the rate scaling for data frame Tx */ /* Update the rate scaling for data frame Tx */
rate_cmd.table_id = 1; rate_cmd.table_id = 1;
return il_send_cmd_pdu(il, REPLY_RATE_SCALE, sizeof(rate_cmd), return il_send_cmd_pdu(il, C_RATE_SCALE, sizeof(rate_cmd),
&rate_cmd); &rate_cmd);
} }
...@@ -2464,8 +2464,8 @@ unsigned int il3945_hw_get_beacon_cmd(struct il_priv *il, ...@@ -2464,8 +2464,8 @@ unsigned int il3945_hw_get_beacon_cmd(struct il_priv *il,
void il3945_hw_rx_handler_setup(struct il_priv *il) void il3945_hw_rx_handler_setup(struct il_priv *il)
{ {
il->rx_handlers[REPLY_TX] = il3945_rx_reply_tx; il->rx_handlers[C_TX] = il3945_rx_reply_tx;
il->rx_handlers[REPLY_3945_RX] = il3945_rx_reply_rx; il->rx_handlers[N_3945_RX] = il3945_rx_reply_rx;
} }
void il3945_hw_setup_deferred_work(struct il_priv *il) void il3945_hw_setup_deferred_work(struct il_priv *il)
......
...@@ -410,13 +410,13 @@ static void il4965_prepare_legacy_sensitivity_tbl(struct il_priv *il, ...@@ -410,13 +410,13 @@ static void il4965_prepare_legacy_sensitivity_tbl(struct il_priv *il,
data->nrg_th_cck); data->nrg_th_cck);
} }
/* Prepare a SENSITIVITY_CMD, send to uCode if values have changed */ /* Prepare a C_SENSITIVITY, send to uCode if values have changed */
static int il4965_sensitivity_write(struct il_priv *il) static int il4965_sensitivity_write(struct il_priv *il)
{ {
struct il_sensitivity_cmd cmd; struct il_sensitivity_cmd cmd;
struct il_sensitivity_data *data = NULL; struct il_sensitivity_data *data = NULL;
struct il_host_cmd cmd_out = { struct il_host_cmd cmd_out = {
.id = SENSITIVITY_CMD, .id = C_SENSITIVITY,
.len = sizeof(struct il_sensitivity_cmd), .len = sizeof(struct il_sensitivity_cmd),
.flags = CMD_ASYNC, .flags = CMD_ASYNC,
.data = &cmd, .data = &cmd,
...@@ -429,12 +429,12 @@ static int il4965_sensitivity_write(struct il_priv *il) ...@@ -429,12 +429,12 @@ static int il4965_sensitivity_write(struct il_priv *il)
il4965_prepare_legacy_sensitivity_tbl(il, data, &cmd.table[0]); il4965_prepare_legacy_sensitivity_tbl(il, data, &cmd.table[0]);
/* Update uCode's "work" table, and copy it to DSP */ /* Update uCode's "work" table, and copy it to DSP */
cmd.control = SENSITIVITY_CMD_CONTROL_WORK_TBL; cmd.control = C_SENSITIVITY_CONTROL_WORK_TBL;
/* Don't send command to uCode if nothing has changed */ /* Don't send command to uCode if nothing has changed */
if (!memcmp(&cmd.table[0], &(il->sensitivity_tbl[0]), if (!memcmp(&cmd.table[0], &(il->sensitivity_tbl[0]),
sizeof(u16)*HD_TBL_SIZE)) { sizeof(u16)*HD_TBL_SIZE)) {
D_CALIB("No change in SENSITIVITY_CMD\n"); D_CALIB("No change in C_SENSITIVITY\n");
return 0; return 0;
} }
...@@ -776,11 +776,11 @@ static void il4965_gain_computation(struct il_priv *il, ...@@ -776,11 +776,11 @@ static void il4965_gain_computation(struct il_priv *il,
cmd.diff_gain_a = data->delta_gain_code[0]; cmd.diff_gain_a = data->delta_gain_code[0];
cmd.diff_gain_b = data->delta_gain_code[1]; cmd.diff_gain_b = data->delta_gain_code[1];
cmd.diff_gain_c = data->delta_gain_code[2]; cmd.diff_gain_c = data->delta_gain_code[2];
ret = il_send_cmd_pdu(il, REPLY_PHY_CALIBRATION_CMD, ret = il_send_cmd_pdu(il, C_PHY_CALIBRATION,
sizeof(cmd), &cmd); sizeof(cmd), &cmd);
if (ret) if (ret)
D_CALIB("fail sending cmd " D_CALIB("fail sending cmd "
"REPLY_PHY_CALIBRATION_CMD\n"); "C_PHY_CALIBRATION\n");
/* TODO we might want recalculate /* TODO we might want recalculate
* rx_chain in rxon cmd */ * rx_chain in rxon cmd */
......
...@@ -608,8 +608,8 @@ static void il4965_pass_packet_to_mac80211(struct il_priv *il, ...@@ -608,8 +608,8 @@ static void il4965_pass_packet_to_mac80211(struct il_priv *il,
rxb->page = NULL; rxb->page = NULL;
} }
/* Called for REPLY_RX (legacy ABG frames), or /* Called for N_RX (legacy ABG frames), or
* REPLY_RX_MPDU_CMD (HT high-throughput N frames). */ * N_RX_MPDU (HT high-throughput N frames). */
void il4965_rx_reply_rx(struct il_priv *il, void il4965_rx_reply_rx(struct il_priv *il,
struct il_rx_buf *rxb) struct il_rx_buf *rxb)
{ {
...@@ -624,15 +624,15 @@ void il4965_rx_reply_rx(struct il_priv *il, ...@@ -624,15 +624,15 @@ void il4965_rx_reply_rx(struct il_priv *il,
u32 rate_n_flags; u32 rate_n_flags;
/** /**
* REPLY_RX and REPLY_RX_MPDU_CMD are handled differently. * N_RX and N_RX_MPDU are handled differently.
* REPLY_RX: physical layer info is in this buffer * N_RX: physical layer info is in this buffer
* REPLY_RX_MPDU_CMD: physical layer info was sent in separate * N_RX_MPDU: physical layer info was sent in separate
* command and cached in il->last_phy_res * command and cached in il->last_phy_res
* *
* Here we set up local variables depending on which command is * Here we set up local variables depending on which command is
* received. * received.
*/ */
if (pkt->hdr.cmd == REPLY_RX) { if (pkt->hdr.cmd == N_RX) {
phy_res = (struct il_rx_phy_res *)pkt->u.raw; phy_res = (struct il_rx_phy_res *)pkt->u.raw;
header = (struct ieee80211_hdr *)(pkt->u.raw + sizeof(*phy_res) header = (struct ieee80211_hdr *)(pkt->u.raw + sizeof(*phy_res)
+ phy_res->cfg_phy_cnt); + phy_res->cfg_phy_cnt);
...@@ -728,8 +728,8 @@ void il4965_rx_reply_rx(struct il_priv *il, ...@@ -728,8 +728,8 @@ void il4965_rx_reply_rx(struct il_priv *il,
rxb, &rx_status); rxb, &rx_status);
} }
/* Cache phy data (Rx signal strength, etc) for HT frame (REPLY_RX_PHY_CMD). /* Cache phy data (Rx signal strength, etc) for HT frame (N_RX_PHY).
* This will be used later in il_rx_reply_rx() for REPLY_RX_MPDU_CMD. */ * This will be used later in il_rx_reply_rx() for N_RX_MPDU. */
void il4965_rx_reply_rx_phy(struct il_priv *il, void il4965_rx_reply_rx_phy(struct il_priv *il,
struct il_rx_buf *rxb) struct il_rx_buf *rxb)
{ {
...@@ -827,7 +827,7 @@ static inline u32 il4965_ant_idx_to_flags(u8 ant_idx) ...@@ -827,7 +827,7 @@ static inline u32 il4965_ant_idx_to_flags(u8 ant_idx)
int il4965_request_scan(struct il_priv *il, struct ieee80211_vif *vif) int il4965_request_scan(struct il_priv *il, struct ieee80211_vif *vif)
{ {
struct il_host_cmd cmd = { struct il_host_cmd cmd = {
.id = REPLY_SCAN_CMD, .id = C_SCAN,
.len = sizeof(struct il_scan_cmd), .len = sizeof(struct il_scan_cmd),
.flags = CMD_SIZE_HUGE, .flags = CMD_SIZE_HUGE,
}; };
...@@ -1388,7 +1388,7 @@ void il4965_rx_stats(struct il_priv *il, ...@@ -1388,7 +1388,7 @@ void il4965_rx_stats(struct il_priv *il,
msecs_to_jiffies(REG_RECALIB_PERIOD * 1000)); msecs_to_jiffies(REG_RECALIB_PERIOD * 1000));
if (unlikely(!test_bit(S_SCANNING, &il->status)) && if (unlikely(!test_bit(S_SCANNING, &il->status)) &&
(pkt->hdr.cmd == STATS_NOTIFICATION)) { (pkt->hdr.cmd == N_STATS)) {
il4965_rx_calc_noise(il); il4965_rx_calc_noise(il);
queue_work(il->workqueue, &il->run_time_calib_work); queue_work(il->workqueue, &il->run_time_calib_work);
} }
...@@ -1473,7 +1473,7 @@ il4965_get_fifo_from_tid(struct il_rxon_context *ctx, u16 tid) ...@@ -1473,7 +1473,7 @@ il4965_get_fifo_from_tid(struct il_rxon_context *ctx, u16 tid)
} }
/* /*
* handle build REPLY_TX command notification. * handle build C_TX command notification.
*/ */
static void il4965_tx_cmd_build_basic(struct il_priv *il, static void il4965_tx_cmd_build_basic(struct il_priv *il,
struct sk_buff *skb, struct sk_buff *skb,
...@@ -1640,7 +1640,7 @@ static void il4965_tx_cmd_build_hwcrypto(struct il_priv *il, ...@@ -1640,7 +1640,7 @@ static void il4965_tx_cmd_build_hwcrypto(struct il_priv *il,
} }
/* /*
* start REPLY_TX command process * start C_TX command process
*/ */
int il4965_tx_skb(struct il_priv *il, struct sk_buff *skb) int il4965_tx_skb(struct il_priv *il, struct sk_buff *skb)
{ {
...@@ -1797,7 +1797,7 @@ int il4965_tx_skb(struct il_priv *il, struct sk_buff *skb) ...@@ -1797,7 +1797,7 @@ int il4965_tx_skb(struct il_priv *il, struct sk_buff *skb)
* after Tx, uCode's Tx response will return this value so driver can * after Tx, uCode's Tx response will return this value so driver can
* locate the frame within the tx queue and do post-tx processing. * locate the frame within the tx queue and do post-tx processing.
*/ */
out_cmd->hdr.cmd = REPLY_TX; out_cmd->hdr.cmd = C_TX;
out_cmd->hdr.sequence = cpu_to_le16((u16)(QUEUE_TO_SEQ(txq_id) | out_cmd->hdr.sequence = cpu_to_le16((u16)(QUEUE_TO_SEQ(txq_id) |
IDX_TO_SEQ(q->write_ptr))); IDX_TO_SEQ(q->write_ptr)));
...@@ -2616,7 +2616,7 @@ void il4965_hwrate_to_tx_control(struct il_priv *il, u32 rate_n_flags, ...@@ -2616,7 +2616,7 @@ void il4965_hwrate_to_tx_control(struct il_priv *il, u32 rate_n_flags,
} }
/** /**
* il4965_rx_reply_compressed_ba - Handler for REPLY_COMPRESSED_BA * il4965_rx_reply_compressed_ba - Handler for N_COMPRESSED_BA
* *
* Handles block-acknowledge notification from device, which reports success * Handles block-acknowledge notification from device, which reports success
* of frames sent via aggregation. * of frames sent via aggregation.
...@@ -2668,7 +2668,7 @@ void il4965_rx_reply_compressed_ba(struct il_priv *il, ...@@ -2668,7 +2668,7 @@ void il4965_rx_reply_compressed_ba(struct il_priv *il,
spin_lock_irqsave(&il->sta_lock, flags); spin_lock_irqsave(&il->sta_lock, flags);
D_TX_REPLY("REPLY_COMPRESSED_BA [%d] Received from %pM, " D_TX_REPLY("N_COMPRESSED_BA [%d] Received from %pM, "
"sta_id = %d\n", "sta_id = %d\n",
agg->wait_for_ba, agg->wait_for_ba,
(u8 *) &ba_resp->sta_addr_lo32, (u8 *) &ba_resp->sta_addr_lo32,
...@@ -2917,7 +2917,7 @@ int il4965_remove_default_wep_key(struct il_priv *il, ...@@ -2917,7 +2917,7 @@ int il4965_remove_default_wep_key(struct il_priv *il,
memset(&ctx->wep_keys[keyconf->keyidx], 0, sizeof(ctx->wep_keys[0])); memset(&ctx->wep_keys[keyconf->keyidx], 0, sizeof(ctx->wep_keys[0]));
if (il_is_rfkill(il)) { if (il_is_rfkill(il)) {
D_WEP( D_WEP(
"Not sending REPLY_WEPKEY command due to RFKILL.\n"); "Not sending C_WEPKEY command due to RFKILL.\n");
/* but keys in device are clear anyway so return success */ /* but keys in device are clear anyway so return success */
return 0; return 0;
} }
...@@ -3201,7 +3201,7 @@ int il4965_remove_dynamic_key(struct il_priv *il, ...@@ -3201,7 +3201,7 @@ int il4965_remove_dynamic_key(struct il_priv *il,
if (il_is_rfkill(il)) { if (il_is_rfkill(il)) {
D_WEP( D_WEP(
"Not sending REPLY_ADD_STA command because RFKILL enabled.\n"); "Not sending C_ADD_STA command because RFKILL enabled.\n");
spin_unlock_irqrestore(&il->sta_lock, flags); spin_unlock_irqrestore(&il->sta_lock, flags);
return 0; return 0;
} }
...@@ -3598,7 +3598,7 @@ int il4965_send_beacon_cmd(struct il_priv *il) ...@@ -3598,7 +3598,7 @@ int il4965_send_beacon_cmd(struct il_priv *il)
return -EINVAL; return -EINVAL;
} }
rc = il_send_cmd_pdu(il, REPLY_TX_BEACON, frame_size, rc = il_send_cmd_pdu(il, C_TX_BEACON, frame_size,
&frame->u.cmd[0]); &frame->u.cmd[0]);
il4965_free_frame(il, frame); il4965_free_frame(il, frame);
...@@ -3801,7 +3801,7 @@ static void il4965_rx_reply_alive(struct il_priv *il, ...@@ -3801,7 +3801,7 @@ static void il4965_rx_reply_alive(struct il_priv *il,
* This callback is provided in order to send a stats request. * This callback is provided in order to send a stats request.
* *
* This timer function is continually reset to execute within * This timer function is continually reset to execute within
* REG_RECALIB_PERIOD seconds since the last STATS_NOTIFICATION * REG_RECALIB_PERIOD seconds since the last N_STATS
* was received. We need to ensure we receive the stats in order * was received. We need to ensure we receive the stats in order
* to update the temperature used for calibrating the TXPOWER. * to update the temperature used for calibrating the TXPOWER.
*/ */
...@@ -3921,37 +3921,37 @@ static void il4965_rx_card_state_notif(struct il_priv *il, ...@@ -3921,37 +3921,37 @@ static void il4965_rx_card_state_notif(struct il_priv *il,
*/ */
static void il4965_setup_rx_handlers(struct il_priv *il) static void il4965_setup_rx_handlers(struct il_priv *il)
{ {
il->rx_handlers[REPLY_ALIVE] = il4965_rx_reply_alive; il->rx_handlers[N_ALIVE] = il4965_rx_reply_alive;
il->rx_handlers[REPLY_ERROR] = il_rx_reply_error; il->rx_handlers[N_ERROR] = il_rx_reply_error;
il->rx_handlers[CHANNEL_SWITCH_NOTIFICATION] = il_rx_csa; il->rx_handlers[N_CHANNEL_SWITCH] = il_rx_csa;
il->rx_handlers[SPECTRUM_MEASURE_NOTIFICATION] = il->rx_handlers[N_SPECTRUM_MEASUREMENT] =
il_rx_spectrum_measure_notif; il_rx_spectrum_measure_notif;
il->rx_handlers[PM_SLEEP_NOTIFICATION] = il_rx_pm_sleep_notif; il->rx_handlers[N_PM_SLEEP] = il_rx_pm_sleep_notif;
il->rx_handlers[PM_DEBUG_STATISTIC_NOTIFIC] = il->rx_handlers[N_PM_DEBUG_STATS] =
il_rx_pm_debug_stats_notif; il_rx_pm_debug_stats_notif;
il->rx_handlers[BEACON_NOTIFICATION] = il4965_rx_beacon_notif; il->rx_handlers[N_BEACON] = il4965_rx_beacon_notif;
/* /*
* The same handler is used for both the REPLY to a discrete * The same handler is used for both the REPLY to a discrete
* stats request from the host as well as for the periodic * stats request from the host as well as for the periodic
* stats notifications (after received beacons) from the uCode. * stats notifications (after received beacons) from the uCode.
*/ */
il->rx_handlers[REPLY_STATS_CMD] = il4965_reply_stats; il->rx_handlers[C_STATS] = il4965_reply_stats;
il->rx_handlers[STATS_NOTIFICATION] = il4965_rx_stats; il->rx_handlers[N_STATS] = il4965_rx_stats;
il_setup_rx_scan_handlers(il); il_setup_rx_scan_handlers(il);
/* status change handler */ /* status change handler */
il->rx_handlers[CARD_STATE_NOTIFICATION] = il->rx_handlers[N_CARD_STATE] =
il4965_rx_card_state_notif; il4965_rx_card_state_notif;
il->rx_handlers[MISSED_BEACONS_NOTIFICATION] = il->rx_handlers[N_MISSED_BEACONS] =
il4965_rx_missed_beacon_notif; il4965_rx_missed_beacon_notif;
/* Rx handlers */ /* Rx handlers */
il->rx_handlers[REPLY_RX_PHY_CMD] = il4965_rx_reply_rx_phy; il->rx_handlers[N_RX_PHY] = il4965_rx_reply_rx_phy;
il->rx_handlers[REPLY_RX_MPDU_CMD] = il4965_rx_reply_rx; il->rx_handlers[N_RX_MPDU] = il4965_rx_reply_rx;
/* block ack */ /* block ack */
il->rx_handlers[REPLY_COMPRESSED_BA] = il4965_rx_reply_compressed_ba; il->rx_handlers[N_COMPRESSED_BA] = il4965_rx_reply_compressed_ba;
/* Set up hardware specific Rx handlers */ /* Set up hardware specific Rx handlers */
il->cfg->ops->lib->rx_handler_setup(il); il->cfg->ops->lib->rx_handler_setup(il);
} }
...@@ -4019,12 +4019,12 @@ void il4965_rx_handle(struct il_priv *il) ...@@ -4019,12 +4019,12 @@ void il4965_rx_handle(struct il_priv *il)
* Ucode should set SEQ_RX_FRAME bit if ucode-originated, * Ucode should set SEQ_RX_FRAME bit if ucode-originated,
* but apparently a few don't get set; catch them here. */ * but apparently a few don't get set; catch them here. */
reclaim = !(pkt->hdr.sequence & SEQ_RX_FRAME) && reclaim = !(pkt->hdr.sequence & SEQ_RX_FRAME) &&
(pkt->hdr.cmd != REPLY_RX_PHY_CMD) && (pkt->hdr.cmd != N_RX_PHY) &&
(pkt->hdr.cmd != REPLY_RX) && (pkt->hdr.cmd != N_RX) &&
(pkt->hdr.cmd != REPLY_RX_MPDU_CMD) && (pkt->hdr.cmd != N_RX_MPDU) &&
(pkt->hdr.cmd != REPLY_COMPRESSED_BA) && (pkt->hdr.cmd != N_COMPRESSED_BA) &&
(pkt->hdr.cmd != STATS_NOTIFICATION) && (pkt->hdr.cmd != N_STATS) &&
(pkt->hdr.cmd != REPLY_TX); (pkt->hdr.cmd != C_TX);
/* Based on type of command response or notification, /* Based on type of command response or notification,
* handle those that need handling via function in * handle those that need handling via function in
...@@ -4923,12 +4923,12 @@ static void il4965_rf_kill_ct_config(struct il_priv *il) ...@@ -4923,12 +4923,12 @@ static void il4965_rf_kill_ct_config(struct il_priv *il)
cmd.critical_temperature_R = cmd.critical_temperature_R =
cpu_to_le32(il->hw_params.ct_kill_threshold); cpu_to_le32(il->hw_params.ct_kill_threshold);
ret = il_send_cmd_pdu(il, REPLY_CT_KILL_CONFIG_CMD, ret = il_send_cmd_pdu(il, C_CT_KILL_CONFIG,
sizeof(cmd), &cmd); sizeof(cmd), &cmd);
if (ret) if (ret)
IL_ERR("REPLY_CT_KILL_CONFIG_CMD failed\n"); IL_ERR("C_CT_KILL_CONFIG failed\n");
else else
D_INFO("REPLY_CT_KILL_CONFIG_CMD " D_INFO("C_CT_KILL_CONFIG "
"succeeded, " "succeeded, "
"critical temperature is %d\n", "critical temperature is %d\n",
il->hw_params.ct_kill_threshold); il->hw_params.ct_kill_threshold);
...@@ -5042,7 +5042,7 @@ static int il4965_alive_notify(struct il_priv *il) ...@@ -5042,7 +5042,7 @@ static int il4965_alive_notify(struct il_priv *il)
} }
/** /**
* il4965_alive_start - called after REPLY_ALIVE notification received * il4965_alive_start - called after N_ALIVE notification received
* from protocol/runtime uCode (initialization uCode's * from protocol/runtime uCode (initialization uCode's
* Alive gets handled by il_init_alive_start()). * Alive gets handled by il_init_alive_start()).
*/ */
...@@ -6200,12 +6200,12 @@ il4965_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -6200,12 +6200,12 @@ il4965_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
il->ctx.always_active = true; il->ctx.always_active = true;
il->ctx.is_active = true; il->ctx.is_active = true;
il->ctx.rxon_cmd = REPLY_RXON; il->ctx.rxon_cmd = C_RXON;
il->ctx.rxon_timing_cmd = REPLY_RXON_TIMING; il->ctx.rxon_timing_cmd = C_RXON_TIMING;
il->ctx.rxon_assoc_cmd = REPLY_RXON_ASSOC; il->ctx.rxon_assoc_cmd = C_RXON_ASSOC;
il->ctx.qos_cmd = REPLY_QOS_PARAM; il->ctx.qos_cmd = C_QOS_PARAM;
il->ctx.ap_sta_id = IL_AP_ID; il->ctx.ap_sta_id = IL_AP_ID;
il->ctx.wep_key_cmd = REPLY_WEPKEY; il->ctx.wep_key_cmd = C_WEPKEY;
il->ctx.ac_to_fifo = il4965_bss_ac_to_fifo; il->ctx.ac_to_fifo = il4965_bss_ac_to_fifo;
il->ctx.ac_to_queue = il4965_bss_ac_to_queue; il->ctx.ac_to_queue = il4965_bss_ac_to_queue;
il->ctx.exclusive_interface_modes = il->ctx.exclusive_interface_modes =
......
...@@ -2172,8 +2172,8 @@ static void il4965_rs_rate_scale_perform(struct il_priv *il, ...@@ -2172,8 +2172,8 @@ static void il4965_rs_rate_scale_perform(struct il_priv *il,
* if the driver's iwl-4965-rs rate scaling algorithm is used, instead of * if the driver's iwl-4965-rs rate scaling algorithm is used, instead of
* rc80211_simple. * rc80211_simple.
* *
* NOTE: Run REPLY_ADD_STA command to set up station table entry, before * NOTE: Run C_ADD_STA command to set up station table entry, before
* calling this function (which runs REPLY_TX_LINK_QUALITY_CMD, * calling this function (which runs C_TX_LINK_QUALITY_CMD,
* which requires station table entry to exist). * which requires station table entry to exist).
*/ */
static void il4965_rs_initialize_lq(struct il_priv *il, static void il4965_rs_initialize_lq(struct il_priv *il,
......
...@@ -249,7 +249,7 @@ static int ...@@ -249,7 +249,7 @@ static int
il4965_send_led_cmd(struct il_priv *il, struct il_led_cmd *led_cmd) il4965_send_led_cmd(struct il_priv *il, struct il_led_cmd *led_cmd)
{ {
struct il_host_cmd cmd = { struct il_host_cmd cmd = {
.id = REPLY_LEDS_CMD, .id = C_LEDS,
.len = sizeof(struct il_led_cmd), .len = sizeof(struct il_led_cmd),
.data = led_cmd, .data = led_cmd,
.flags = CMD_ASYNC, .flags = CMD_ASYNC,
...@@ -465,9 +465,9 @@ static int il4965_set_ucode_ptrs(struct il_priv *il) ...@@ -465,9 +465,9 @@ static int il4965_set_ucode_ptrs(struct il_priv *il)
} }
/** /**
* il4965_init_alive_start - Called after REPLY_ALIVE notification received * il4965_init_alive_start - Called after N_ALIVE notification received
* *
* Called after REPLY_ALIVE notification received from "initialize" uCode. * Called after N_ALIVE notification received from "initialize" uCode.
* *
* The 4965 "initialize" ALIVE reply contains calibration data for: * The 4965 "initialize" ALIVE reply contains calibration data for:
* Voltage, temperature, and MIMO tx gain correction, now stored in il * Voltage, temperature, and MIMO tx gain correction, now stored in il
...@@ -567,10 +567,10 @@ static void il4965_chain_noise_reset(struct il_priv *il) ...@@ -567,10 +567,10 @@ static void il4965_chain_noise_reset(struct il_priv *il)
cmd.diff_gain_a = 0; cmd.diff_gain_a = 0;
cmd.diff_gain_b = 0; cmd.diff_gain_b = 0;
cmd.diff_gain_c = 0; cmd.diff_gain_c = 0;
if (il_send_cmd_pdu(il, REPLY_PHY_CALIBRATION_CMD, if (il_send_cmd_pdu(il, C_PHY_CALIBRATION,
sizeof(cmd), &cmd)) sizeof(cmd), &cmd))
IL_ERR( IL_ERR(
"Could not send REPLY_PHY_CALIBRATION_CMD\n"); "Could not send C_PHY_CALIBRATION\n");
data->state = IL_CHAIN_NOISE_ACCUMULATE; data->state = IL_CHAIN_NOISE_ACCUMULATE;
D_CALIB("Run chain_noise_calibrate\n"); D_CALIB("Run chain_noise_calibrate\n");
} }
...@@ -1370,7 +1370,7 @@ static int il4965_send_tx_power(struct il_priv *il) ...@@ -1370,7 +1370,7 @@ static int il4965_send_tx_power(struct il_priv *il)
goto out; goto out;
ret = il_send_cmd_pdu(il, ret = il_send_cmd_pdu(il,
REPLY_TX_PWR_TBL_CMD, sizeof(cmd), &cmd); C_TX_PWR_TBL, sizeof(cmd), &cmd);
out: out:
return ret; return ret;
...@@ -1408,7 +1408,7 @@ static int il4965_send_rxon_assoc(struct il_priv *il, ...@@ -1408,7 +1408,7 @@ static int il4965_send_rxon_assoc(struct il_priv *il,
ctx->staging.ofdm_ht_dual_stream_basic_rates; ctx->staging.ofdm_ht_dual_stream_basic_rates;
rxon_assoc.rx_chain_select_flags = ctx->staging.rx_chain; rxon_assoc.rx_chain_select_flags = ctx->staging.rx_chain;
ret = il_send_cmd_pdu_async(il, REPLY_RXON_ASSOC, ret = il_send_cmd_pdu_async(il, C_RXON_ASSOC,
sizeof(rxon_assoc), &rxon_assoc, NULL); sizeof(rxon_assoc), &rxon_assoc, NULL);
return ret; return ret;
...@@ -1632,7 +1632,7 @@ static int il4965_hw_channel_switch(struct il_priv *il, ...@@ -1632,7 +1632,7 @@ static int il4965_hw_channel_switch(struct il_priv *il,
} }
return il_send_cmd_pdu(il, return il_send_cmd_pdu(il,
REPLY_CHANNEL_SWITCH, sizeof(cmd), &cmd); C_CHANNEL_SWITCH, sizeof(cmd), &cmd);
} }
/** /**
...@@ -1795,7 +1795,7 @@ static void il4965_temperature_calib(struct il_priv *il) ...@@ -1795,7 +1795,7 @@ static void il4965_temperature_calib(struct il_priv *il)
static u16 il4965_get_hcmd_size(u8 cmd_id, u16 len) static u16 il4965_get_hcmd_size(u8 cmd_id, u16 len)
{ {
switch (cmd_id) { switch (cmd_id) {
case REPLY_RXON: case C_RXON:
return (u16) sizeof(struct il4965_rxon_cmd); return (u16) sizeof(struct il4965_rxon_cmd);
default: default:
return len; return len;
...@@ -2145,10 +2145,10 @@ static void il4965_rx_beacon_notif(struct il_priv *il, ...@@ -2145,10 +2145,10 @@ static void il4965_rx_beacon_notif(struct il_priv *il,
static void il4965_rx_handler_setup(struct il_priv *il) static void il4965_rx_handler_setup(struct il_priv *il)
{ {
/* Legacy Rx frames */ /* Legacy Rx frames */
il->rx_handlers[REPLY_RX] = il4965_rx_reply_rx; il->rx_handlers[N_RX] = il4965_rx_reply_rx;
/* Tx response */ /* Tx response */
il->rx_handlers[REPLY_TX] = il4965_rx_reply_tx; il->rx_handlers[C_TX] = il4965_rx_reply_tx;
il->rx_handlers[BEACON_NOTIFICATION] = il4965_rx_beacon_notif; il->rx_handlers[N_BEACON] = il4965_rx_beacon_notif;
} }
static struct il_hcmd_ops il4965_hcmd = { static struct il_hcmd_ops il4965_hcmd = {
......
...@@ -278,8 +278,8 @@ static inline int il4965_hw_valid_rtc_data_addr(u32 addr) ...@@ -278,8 +278,8 @@ static inline int il4965_hw_valid_rtc_data_addr(u32 addr)
* uCode provides all 4 values to the driver via the "initialize alive" * uCode provides all 4 values to the driver via the "initialize alive"
* notification (see struct il4965_init_alive_resp). After the runtime uCode * notification (see struct il4965_init_alive_resp). After the runtime uCode
* image loads, uCode updates the R4 value via stats notifications * image loads, uCode updates the R4 value via stats notifications
* (see STATS_NOTIFICATION), which occur after each received beacon * (see N_STATS), which occur after each received beacon
* when associated, or can be requested via REPLY_STATS_CMD. * when associated, or can be requested via C_STATS.
* *
* NOTE: uCode provides the R4 value as a 23-bit signed value. Driver * NOTE: uCode provides the R4 value as a 23-bit signed value. Driver
* must sign-extend to 32 bits before applying formula below. * must sign-extend to 32 bits before applying formula below.
......
...@@ -1165,7 +1165,7 @@ void il_send_bt_config(struct il_priv *il) ...@@ -1165,7 +1165,7 @@ void il_send_bt_config(struct il_priv *il)
D_INFO("BT coex %s\n", D_INFO("BT coex %s\n",
(bt_cmd.flags == BT_COEX_DISABLE) ? "disable" : "active"); (bt_cmd.flags == BT_COEX_DISABLE) ? "disable" : "active");
if (il_send_cmd_pdu(il, REPLY_BT_CONFIG, if (il_send_cmd_pdu(il, C_BT_CONFIG,
sizeof(struct il_bt_cmd), &bt_cmd)) sizeof(struct il_bt_cmd), &bt_cmd))
IL_ERR("failed to send BT Coex Config\n"); IL_ERR("failed to send BT Coex Config\n");
} }
...@@ -1179,11 +1179,11 @@ int il_send_stats_request(struct il_priv *il, u8 flags, bool clear) ...@@ -1179,11 +1179,11 @@ int il_send_stats_request(struct il_priv *il, u8 flags, bool clear)
}; };
if (flags & CMD_ASYNC) if (flags & CMD_ASYNC)
return il_send_cmd_pdu_async(il, REPLY_STATS_CMD, return il_send_cmd_pdu_async(il, C_STATS,
sizeof(struct il_stats_cmd), sizeof(struct il_stats_cmd),
&stats_cmd, NULL); &stats_cmd, NULL);
else else
return il_send_cmd_pdu(il, REPLY_STATS_CMD, return il_send_cmd_pdu(il, C_STATS,
sizeof(struct il_stats_cmd), sizeof(struct il_stats_cmd),
&stats_cmd); &stats_cmd);
} }
......
...@@ -554,7 +554,7 @@ static ssize_t il_dbgfs_interrupt_read(struct file *file, ...@@ -554,7 +554,7 @@ static ssize_t il_dbgfs_interrupt_read(struct file *file,
pos += scnprintf(buf + pos, bufsz - pos, pos += scnprintf(buf + pos, bufsz - pos,
"Rx command responses:\t\t %u\n", "Rx command responses:\t\t %u\n",
il->isr_stats.rx); il->isr_stats.rx);
for (cnt = 0; cnt < REPLY_MAX; cnt++) { for (cnt = 0; cnt < IL_CN_MAX; cnt++) {
if (il->isr_stats.rx_handlers[cnt] > 0) if (il->isr_stats.rx_handlers[cnt] > 0)
pos += scnprintf(buf + pos, bufsz - pos, pos += scnprintf(buf + pos, bufsz - pos,
"\tRx handler[%36s]:\t\t %u\n", "\tRx handler[%36s]:\t\t %u\n",
......
...@@ -383,8 +383,8 @@ struct il_rx_queue { ...@@ -383,8 +383,8 @@ struct il_rx_queue {
* @bitmap1: High order, one bit for each frame pending ACK in Tx win * @bitmap1: High order, one bit for each frame pending ACK in Tx win
* @rate_n_flags: Rate at which Tx was attempted * @rate_n_flags: Rate at which Tx was attempted
* *
* If REPLY_TX indicates that aggregation was attempted, driver must wait * If C_TX indicates that aggregation was attempted, driver must wait
* for block ack (REPLY_COMPRESSED_BA). This struct stores tx reply info * for block ack (N_COMPRESSED_BA). This struct stores tx reply info
* until block ack arrives. * until block ack arrives.
*/ */
struct il_ht_agg { struct il_ht_agg {
...@@ -813,7 +813,7 @@ struct isr_stats { ...@@ -813,7 +813,7 @@ struct isr_stats {
u32 ctkill; u32 ctkill;
u32 wakeup; u32 wakeup;
u32 rx; u32 rx;
u32 rx_handlers[REPLY_MAX]; u32 rx_handlers[IL_CN_MAX];
u32 tx; u32 tx;
u32 unhandled; u32 unhandled;
}; };
...@@ -968,7 +968,7 @@ struct il_priv { ...@@ -968,7 +968,7 @@ struct il_priv {
enum ieee80211_band band; enum ieee80211_band band;
int alloc_rxb_page; int alloc_rxb_page;
void (*rx_handlers[REPLY_MAX])(struct il_priv *il, void (*rx_handlers[IL_CN_MAX])(struct il_priv *il,
struct il_rx_buf *rxb); struct il_rx_buf *rxb);
struct ieee80211_supported_band bands[IEEE80211_NUM_BANDS]; struct ieee80211_supported_band bands[IEEE80211_NUM_BANDS];
......
...@@ -40,47 +40,47 @@ ...@@ -40,47 +40,47 @@
const char *il_get_cmd_string(u8 cmd) const char *il_get_cmd_string(u8 cmd)
{ {
switch (cmd) { switch (cmd) {
IL_CMD(REPLY_ALIVE); IL_CMD(N_ALIVE);
IL_CMD(REPLY_ERROR); IL_CMD(N_ERROR);
IL_CMD(REPLY_RXON); IL_CMD(C_RXON);
IL_CMD(REPLY_RXON_ASSOC); IL_CMD(C_RXON_ASSOC);
IL_CMD(REPLY_QOS_PARAM); IL_CMD(C_QOS_PARAM);
IL_CMD(REPLY_RXON_TIMING); IL_CMD(C_RXON_TIMING);
IL_CMD(REPLY_ADD_STA); IL_CMD(C_ADD_STA);
IL_CMD(REPLY_REMOVE_STA); IL_CMD(C_REM_STA);
IL_CMD(REPLY_WEPKEY); IL_CMD(C_WEPKEY);
IL_CMD(REPLY_3945_RX); IL_CMD(N_3945_RX);
IL_CMD(REPLY_TX); IL_CMD(C_TX);
IL_CMD(REPLY_RATE_SCALE); IL_CMD(C_RATE_SCALE);
IL_CMD(REPLY_LEDS_CMD); IL_CMD(C_LEDS);
IL_CMD(REPLY_TX_LINK_QUALITY_CMD); IL_CMD(C_TX_LINK_QUALITY_CMD);
IL_CMD(REPLY_CHANNEL_SWITCH); IL_CMD(C_CHANNEL_SWITCH);
IL_CMD(CHANNEL_SWITCH_NOTIFICATION); IL_CMD(N_CHANNEL_SWITCH);
IL_CMD(REPLY_SPECTRUM_MEASUREMENT_CMD); IL_CMD(C_SPECTRUM_MEASUREMENT);
IL_CMD(SPECTRUM_MEASURE_NOTIFICATION); IL_CMD(N_SPECTRUM_MEASUREMENT);
IL_CMD(POWER_TBL_CMD); IL_CMD(C_POWER_TBL);
IL_CMD(PM_SLEEP_NOTIFICATION); IL_CMD(N_PM_SLEEP);
IL_CMD(PM_DEBUG_STATISTIC_NOTIFIC); IL_CMD(N_PM_DEBUG_STATS);
IL_CMD(REPLY_SCAN_CMD); IL_CMD(C_SCAN);
IL_CMD(REPLY_SCAN_ABORT_CMD); IL_CMD(C_SCAN_ABORT);
IL_CMD(SCAN_START_NOTIFICATION); IL_CMD(N_SCAN_START);
IL_CMD(SCAN_RESULTS_NOTIFICATION); IL_CMD(N_SCAN_RESULTS);
IL_CMD(SCAN_COMPLETE_NOTIFICATION); IL_CMD(N_SCAN_COMPLETE);
IL_CMD(BEACON_NOTIFICATION); IL_CMD(N_BEACON);
IL_CMD(REPLY_TX_BEACON); IL_CMD(C_TX_BEACON);
IL_CMD(REPLY_TX_PWR_TBL_CMD); IL_CMD(C_TX_PWR_TBL);
IL_CMD(REPLY_BT_CONFIG); IL_CMD(C_BT_CONFIG);
IL_CMD(REPLY_STATS_CMD); IL_CMD(C_STATS);
IL_CMD(STATS_NOTIFICATION); IL_CMD(N_STATS);
IL_CMD(CARD_STATE_NOTIFICATION); IL_CMD(N_CARD_STATE);
IL_CMD(MISSED_BEACONS_NOTIFICATION); IL_CMD(N_MISSED_BEACONS);
IL_CMD(REPLY_CT_KILL_CONFIG_CMD); IL_CMD(C_CT_KILL_CONFIG);
IL_CMD(SENSITIVITY_CMD); IL_CMD(C_SENSITIVITY);
IL_CMD(REPLY_PHY_CALIBRATION_CMD); IL_CMD(C_PHY_CALIBRATION);
IL_CMD(REPLY_RX_PHY_CMD); IL_CMD(N_RX_PHY);
IL_CMD(REPLY_RX_MPDU_CMD); IL_CMD(N_RX_MPDU);
IL_CMD(REPLY_RX); IL_CMD(N_RX);
IL_CMD(REPLY_COMPRESSED_BA); IL_CMD(N_COMPRESSED_BA);
default: default:
return "UNKNOWN"; return "UNKNOWN";
...@@ -102,8 +102,8 @@ static void il_generic_cmd_callback(struct il_priv *il, ...@@ -102,8 +102,8 @@ static void il_generic_cmd_callback(struct il_priv *il,
#ifdef CONFIG_IWLEGACY_DEBUG #ifdef CONFIG_IWLEGACY_DEBUG
switch (cmd->hdr.cmd) { switch (cmd->hdr.cmd) {
case REPLY_TX_LINK_QUALITY_CMD: case C_TX_LINK_QUALITY_CMD:
case SENSITIVITY_CMD: case C_SENSITIVITY:
D_HC_DUMP("back from %s (0x%08X)\n", D_HC_DUMP("back from %s (0x%08X)\n",
il_get_cmd_string(cmd->hdr.cmd), pkt->hdr.flags); il_get_cmd_string(cmd->hdr.cmd), pkt->hdr.flags);
break; break;
......
...@@ -88,7 +88,7 @@ il_set_power(struct il_priv *il, struct il_powertable_cmd *cmd) ...@@ -88,7 +88,7 @@ il_set_power(struct il_priv *il, struct il_powertable_cmd *cmd)
le32_to_cpu(cmd->sleep_interval[3]), le32_to_cpu(cmd->sleep_interval[3]),
le32_to_cpu(cmd->sleep_interval[4])); le32_to_cpu(cmd->sleep_interval[4]));
return il_send_cmd_pdu(il, POWER_TBL_CMD, return il_send_cmd_pdu(il, C_POWER_TBL,
sizeof(struct il_powertable_cmd), cmd); sizeof(struct il_powertable_cmd), cmd);
} }
......
...@@ -189,7 +189,7 @@ ...@@ -189,7 +189,7 @@
* procedure. * procedure.
* *
* This save/restore method is mostly for autonomous power management during * This save/restore method is mostly for autonomous power management during
* normal operation (result of POWER_TBL_CMD). Platform suspend/resume and * normal operation (result of C_POWER_TBL). Platform suspend/resume and
* RFKILL should use complete restarts (with total re-initialization) of uCode, * RFKILL should use complete restarts (with total re-initialization) of uCode,
* allowing total shutdown (including BSM memory). * allowing total shutdown (including BSM memory).
* *
......
...@@ -59,7 +59,7 @@ static int il_send_scan_abort(struct il_priv *il) ...@@ -59,7 +59,7 @@ static int il_send_scan_abort(struct il_priv *il)
int ret; int ret;
struct il_rx_pkt *pkt; struct il_rx_pkt *pkt;
struct il_host_cmd cmd = { struct il_host_cmd cmd = {
.id = REPLY_SCAN_ABORT_CMD, .id = C_SCAN_ABORT,
.flags = CMD_WANT_SKB, .flags = CMD_WANT_SKB,
}; };
...@@ -181,7 +181,7 @@ int il_scan_cancel_timeout(struct il_priv *il, unsigned long ms) ...@@ -181,7 +181,7 @@ int il_scan_cancel_timeout(struct il_priv *il, unsigned long ms)
} }
EXPORT_SYMBOL(il_scan_cancel_timeout); EXPORT_SYMBOL(il_scan_cancel_timeout);
/* Service response to REPLY_SCAN_CMD (0x80) */ /* Service response to C_SCAN (0x80) */
static void il_rx_reply_scan(struct il_priv *il, static void il_rx_reply_scan(struct il_priv *il,
struct il_rx_buf *rxb) struct il_rx_buf *rxb)
{ {
...@@ -194,7 +194,7 @@ static void il_rx_reply_scan(struct il_priv *il, ...@@ -194,7 +194,7 @@ static void il_rx_reply_scan(struct il_priv *il,
#endif #endif
} }
/* Service SCAN_START_NOTIFICATION (0x82) */ /* Service N_SCAN_START (0x82) */
static void il_rx_scan_start_notif(struct il_priv *il, static void il_rx_scan_start_notif(struct il_priv *il,
struct il_rx_buf *rxb) struct il_rx_buf *rxb)
{ {
...@@ -212,7 +212,7 @@ static void il_rx_scan_start_notif(struct il_priv *il, ...@@ -212,7 +212,7 @@ static void il_rx_scan_start_notif(struct il_priv *il,
notif->status, notif->beacon_timer); notif->status, notif->beacon_timer);
} }
/* Service SCAN_RESULTS_NOTIFICATION (0x83) */ /* Service N_SCAN_RESULTS (0x83) */
static void il_rx_scan_results_notif(struct il_priv *il, static void il_rx_scan_results_notif(struct il_priv *il,
struct il_rx_buf *rxb) struct il_rx_buf *rxb)
{ {
...@@ -234,7 +234,7 @@ static void il_rx_scan_results_notif(struct il_priv *il, ...@@ -234,7 +234,7 @@ static void il_rx_scan_results_notif(struct il_priv *il,
#endif #endif
} }
/* Service SCAN_COMPLETE_NOTIFICATION (0x84) */ /* Service N_SCAN_COMPLETE (0x84) */
static void il_rx_scan_complete_notif(struct il_priv *il, static void il_rx_scan_complete_notif(struct il_priv *il,
struct il_rx_buf *rxb) struct il_rx_buf *rxb)
{ {
...@@ -263,12 +263,12 @@ static void il_rx_scan_complete_notif(struct il_priv *il, ...@@ -263,12 +263,12 @@ static void il_rx_scan_complete_notif(struct il_priv *il,
void il_setup_rx_scan_handlers(struct il_priv *il) void il_setup_rx_scan_handlers(struct il_priv *il)
{ {
/* scan handlers */ /* scan handlers */
il->rx_handlers[REPLY_SCAN_CMD] = il_rx_reply_scan; il->rx_handlers[C_SCAN] = il_rx_reply_scan;
il->rx_handlers[SCAN_START_NOTIFICATION] = il->rx_handlers[N_SCAN_START] =
il_rx_scan_start_notif; il_rx_scan_start_notif;
il->rx_handlers[SCAN_RESULTS_NOTIFICATION] = il->rx_handlers[N_SCAN_RESULTS] =
il_rx_scan_results_notif; il_rx_scan_results_notif;
il->rx_handlers[SCAN_COMPLETE_NOTIFICATION] = il->rx_handlers[N_SCAN_COMPLETE] =
il_rx_scan_complete_notif; il_rx_scan_complete_notif;
} }
EXPORT_SYMBOL(il_setup_rx_scan_handlers); EXPORT_SYMBOL(il_setup_rx_scan_handlers);
......
...@@ -67,7 +67,7 @@ static int il_process_add_sta_resp(struct il_priv *il, ...@@ -67,7 +67,7 @@ static int il_process_add_sta_resp(struct il_priv *il,
int ret = -EIO; int ret = -EIO;
if (pkt->hdr.flags & IL_CMD_FAILED_MSK) { if (pkt->hdr.flags & IL_CMD_FAILED_MSK) {
IL_ERR("Bad return from REPLY_ADD_STA (0x%08X)\n", IL_ERR("Bad return from C_ADD_STA (0x%08X)\n",
pkt->hdr.flags); pkt->hdr.flags);
return ret; return ret;
} }
...@@ -79,7 +79,7 @@ static int il_process_add_sta_resp(struct il_priv *il, ...@@ -79,7 +79,7 @@ static int il_process_add_sta_resp(struct il_priv *il,
switch (pkt->u.add_sta.status) { switch (pkt->u.add_sta.status) {
case ADD_STA_SUCCESS_MSK: case ADD_STA_SUCCESS_MSK:
D_INFO("REPLY_ADD_STA PASSED\n"); D_INFO("C_ADD_STA PASSED\n");
il_sta_ucode_activate(il, sta_id); il_sta_ucode_activate(il, sta_id);
ret = 0; ret = 0;
break; break;
...@@ -97,7 +97,7 @@ static int il_process_add_sta_resp(struct il_priv *il, ...@@ -97,7 +97,7 @@ static int il_process_add_sta_resp(struct il_priv *il,
sta_id); sta_id);
break; break;
default: default:
D_ASSOC("Received REPLY_ADD_STA:(0x%08X)\n", D_ASSOC("Received C_ADD_STA:(0x%08X)\n",
pkt->u.add_sta.status); pkt->u.add_sta.status);
break; break;
} }
...@@ -142,7 +142,7 @@ int il_send_add_sta(struct il_priv *il, ...@@ -142,7 +142,7 @@ int il_send_add_sta(struct il_priv *il,
int ret = 0; int ret = 0;
u8 data[sizeof(*sta)]; u8 data[sizeof(*sta)];
struct il_host_cmd cmd = { struct il_host_cmd cmd = {
.id = REPLY_ADD_STA, .id = C_ADD_STA,
.flags = flags, .flags = flags,
.data = data, .data = data,
}; };
...@@ -290,7 +290,7 @@ u8 il_prep_station(struct il_priv *il, struct il_rxon_context *ctx, ...@@ -290,7 +290,7 @@ u8 il_prep_station(struct il_priv *il, struct il_rxon_context *ctx,
sta_id, addr); sta_id, addr);
il->num_stations++; il->num_stations++;
/* Set up the REPLY_ADD_STA command to send to device */ /* Set up the C_ADD_STA command to send to device */
memset(&station->sta, 0, sizeof(struct il_addsta_cmd)); memset(&station->sta, 0, sizeof(struct il_addsta_cmd));
memcpy(station->sta.sta.addr, addr, ETH_ALEN); memcpy(station->sta.sta.addr, addr, ETH_ALEN);
station->sta.mode = 0; station->sta.mode = 0;
...@@ -421,7 +421,7 @@ static int il_send_remove_station(struct il_priv *il, ...@@ -421,7 +421,7 @@ static int il_send_remove_station(struct il_priv *il,
struct il_rem_sta_cmd rm_sta_cmd; struct il_rem_sta_cmd rm_sta_cmd;
struct il_host_cmd cmd = { struct il_host_cmd cmd = {
.id = REPLY_REMOVE_STA, .id = C_REM_STA,
.len = sizeof(struct il_rem_sta_cmd), .len = sizeof(struct il_rem_sta_cmd),
.flags = CMD_SYNC, .flags = CMD_SYNC,
.data = &rm_sta_cmd, .data = &rm_sta_cmd,
...@@ -440,7 +440,7 @@ static int il_send_remove_station(struct il_priv *il, ...@@ -440,7 +440,7 @@ static int il_send_remove_station(struct il_priv *il,
pkt = (struct il_rx_pkt *)cmd.reply_page; pkt = (struct il_rx_pkt *)cmd.reply_page;
if (pkt->hdr.flags & IL_CMD_FAILED_MSK) { if (pkt->hdr.flags & IL_CMD_FAILED_MSK) {
IL_ERR("Bad return from REPLY_REMOVE_STA (0x%08X)\n", IL_ERR("Bad return from C_REM_STA (0x%08X)\n",
pkt->hdr.flags); pkt->hdr.flags);
ret = -EIO; ret = -EIO;
} }
...@@ -454,11 +454,11 @@ static int il_send_remove_station(struct il_priv *il, ...@@ -454,11 +454,11 @@ static int il_send_remove_station(struct il_priv *il,
spin_unlock_irqrestore(&il->sta_lock, spin_unlock_irqrestore(&il->sta_lock,
flags_spin); flags_spin);
} }
D_ASSOC("REPLY_REMOVE_STA PASSED\n"); D_ASSOC("C_REM_STA PASSED\n");
break; break;
default: default:
ret = -EIO; ret = -EIO;
IL_ERR("REPLY_REMOVE_STA failed\n"); IL_ERR("C_REM_STA failed\n");
break; break;
} }
} }
...@@ -753,7 +753,7 @@ int il_send_lq_cmd(struct il_priv *il, struct il_rxon_context *ctx, ...@@ -753,7 +753,7 @@ int il_send_lq_cmd(struct il_priv *il, struct il_rxon_context *ctx,
unsigned long flags_spin; unsigned long flags_spin;
struct il_host_cmd cmd = { struct il_host_cmd cmd = {
.id = REPLY_TX_LINK_QUALITY_CMD, .id = C_TX_LINK_QUALITY_CMD,
.len = sizeof(struct il_link_quality_cmd), .len = sizeof(struct il_link_quality_cmd),
.flags = flags, .flags = flags,
.data = lq, .data = lq,
......
...@@ -509,8 +509,8 @@ int il_enqueue_hcmd(struct il_priv *il, struct il_host_cmd *cmd) ...@@ -509,8 +509,8 @@ int il_enqueue_hcmd(struct il_priv *il, struct il_host_cmd *cmd)
#ifdef CONFIG_IWLEGACY_DEBUG #ifdef CONFIG_IWLEGACY_DEBUG
switch (out_cmd->hdr.cmd) { switch (out_cmd->hdr.cmd) {
case REPLY_TX_LINK_QUALITY_CMD: case C_TX_LINK_QUALITY_CMD:
case SENSITIVITY_CMD: case C_SENSITIVITY:
D_HC_DUMP( D_HC_DUMP(
"Sending command %s (#%x), seq: 0x%04X, " "Sending command %s (#%x), seq: 0x%04X, "
"%d bytes at %d[%d]:%d\n", "%d bytes at %d[%d]:%d\n",
......
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