#define DRV_DESCRIPTION \
"Intel(R) PRO/Wireless 3945ABG/BG Network Connection driver for Linux"
-#ifdef CONFIG_IWLWIFI_LEGACY_DEBUG
+#ifdef CONFIG_IWLEGACY_DEBUG
#define VD "d"
#else
#define VD
key_flags |= (STA_KEY_FLG_CCMP | STA_KEY_FLG_MAP_KEY_MSK);
key_flags |= cpu_to_le16(keyconf->keyidx << STA_KEY_FLG_KEYID_POS);
- if (sta_id == il->contexts[IL_RXON_CTX_BSS].bcast_sta_id)
+ if (sta_id == il->ctx.bcast_sta_id)
key_flags |= STA_KEY_MULTICAST_MSK;
keyconf->flags |= IEEE80211_KEY_FLAG_GENERATE_IV;
if ((il->stations[sta_id].sta.key.key_flags & STA_KEY_FLG_ENCRYPT_MSK)
== STA_KEY_FLG_NO_ENC)
il->stations[sta_id].sta.key.key_offset =
- il_get_free_ucode_key_index(il);
+ il_get_free_ucode_key_idx(il);
/* else, we are overriding an existing key => no need to allocated room
* in uCode. */
int left)
{
- if (!il_is_associated(il, IL_RXON_CTX_BSS) || !il->beacon_skb)
+ if (!il_is_associated(il) || !il->beacon_skb)
return 0;
if (il->beacon_skb->len > left)
}
rate = il_get_lowest_plcp(il,
- &il->contexts[IL_RXON_CTX_BSS]);
+ &il->ctx);
frame_size = il3945_hw_get_beacon_cmd(il, frame, rate);
fc = hdr->frame_control;
-#ifdef CONFIG_IWLWIFI_LEGACY_DEBUG
+#ifdef CONFIG_IWLEGACY_DEBUG
if (ieee80211_is_auth(fc))
D_TX("Sending AUTH frame\n");
else if (ieee80211_is_assoc_req(fc))
hdr_len = ieee80211_hdrlen(fc);
- /* Find index into station table for destination station */
+ /* Find idx into station table for destination station */
sta_id = il_sta_id_or_broadcast(
- il, &il->contexts[IL_RXON_CTX_BSS],
+ il, &il->ctx,
info->control.sta);
if (sta_id == IL_INVALID_STATION) {
D_DROP("Dropping - INVALID STATION: %pM\n",
spin_lock_irqsave(&il->lock, flags);
- idx = il_get_cmd_index(q, q->write_ptr, 0);
+ idx = il_get_cmd_idx(q, q->write_ptr, 0);
/* Set up driver data for this TFD */
memset(&(txq->txb[q->write_ptr]), 0, sizeof(struct il_tx_info));
txq->txb[q->write_ptr].skb = skb;
- txq->txb[q->write_ptr].ctx = &il->contexts[IL_RXON_CTX_BSS];
+ txq->txb[q->write_ptr].ctx = &il->ctx;
/* Init first empty entry in queue's array of Tx/cmd buffers */
out_cmd = txq->cmd[idx];
/*
* Set up the Tx-command (not MAC!) header.
- * Store the chosen Tx queue and TFD index within the sequence field;
+ * Store the chosen Tx queue and TFD idx within the sequence field;
* 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.
*/
out_cmd->hdr.cmd = REPLY_TX;
out_cmd->hdr.sequence = cpu_to_le16((u16)(QUEUE_TO_SEQ(txq_id) |
- INDEX_TO_SEQ(q->write_ptr)));
+ IDX_TO_SEQ(q->write_ptr)));
/* Copy MAC header from skb into command buffer */
memcpy(tx_cmd->hdr, hdr, hdr_len);
}
- /* Tell device the write index *just past* this latest filled TFD */
+ /* Tell device the write idx *just past* this latest filled TFD */
q->write_ptr = il_queue_inc_wrap(q->write_ptr, q->n_bd);
il_txq_update_write_ptr(il, txq);
spin_unlock_irqrestore(&il->lock, flags);
- if ((il_queue_space(q) < q->high_mark)
+ if (il_queue_space(q) < q->high_mark
&& il->mac80211_registered) {
if (wait_write_ptr) {
spin_lock_irqsave(&il->lock, flags);
u8 type)
{
struct il_spectrum_cmd spectrum;
- struct il_rx_packet *pkt;
+ struct il_rx_pkt *pkt;
struct il_host_cmd cmd = {
.id = REPLY_SPECTRUM_MEASUREMENT_CMD,
.data = (void *)&spectrum,
int rc;
int spectrum_resp_status;
int duration = le16_to_cpu(params->duration);
- struct il_rxon_context *ctx = &il->contexts[IL_RXON_CTX_BSS];
+ struct il_rxon_context *ctx = &il->ctx;
- if (il_is_associated(il, IL_RXON_CTX_BSS))
+ if (il_is_associated(il))
add_time = il_usecs_to_beacons(il,
le64_to_cpu(params->start_time) - il->_3945.last_tsf,
le16_to_cpu(ctx->timing.beacon_interval));
cmd.len = sizeof(spectrum);
spectrum.len = cpu_to_le16(cmd.len - sizeof(spectrum.len));
- if (il_is_associated(il, IL_RXON_CTX_BSS))
+ if (il_is_associated(il))
spectrum.start_time =
il_add_beacon_time(il,
il->_3945.last_beacon_time, add_time,
if (rc)
return rc;
- pkt = (struct il_rx_packet *)cmd.reply_page;
+ pkt = (struct il_rx_pkt *)cmd.reply_page;
if (pkt->hdr.flags & IL_CMD_FAILED_MSK) {
IL_ERR("Bad return from REPLY_RX_ON_ASSOC command\n");
rc = -EIO;
}
static void il3945_rx_reply_alive(struct il_priv *il,
- struct il_rx_mem_buffer *rxb)
+ struct il_rx_buf *rxb)
{
- struct il_rx_packet *pkt = rxb_addr(rxb);
+ struct il_rx_pkt *pkt = rxb_addr(rxb);
struct il_alive_resp *palive;
struct delayed_work *pwork;
}
static void il3945_rx_reply_add_sta(struct il_priv *il,
- struct il_rx_mem_buffer *rxb)
+ struct il_rx_buf *rxb)
{
-#ifdef CONFIG_IWLWIFI_LEGACY_DEBUG
- struct il_rx_packet *pkt = rxb_addr(rxb);
+#ifdef CONFIG_IWLEGACY_DEBUG
+ struct il_rx_pkt *pkt = rxb_addr(rxb);
#endif
D_RX("Received REPLY_ADD_STA: 0x%02X\n", pkt->u.status);
}
static void il3945_rx_beacon_notif(struct il_priv *il,
- struct il_rx_mem_buffer *rxb)
+ struct il_rx_buf *rxb)
{
- struct il_rx_packet *pkt = rxb_addr(rxb);
+ struct il_rx_pkt *pkt = rxb_addr(rxb);
struct il3945_beacon_notif *beacon = &(pkt->u.beacon_status);
-#ifdef CONFIG_IWLWIFI_LEGACY_DEBUG
+#ifdef CONFIG_IWLEGACY_DEBUG
u8 rate = beacon->beacon_notify_hdr.rate;
D_RX("beacon status %x retries %d iss %d "
/* Handle notification from uCode that card's power state is changing
* due to software, hardware, or critical temperature RFKILL */
static void il3945_rx_card_state_notif(struct il_priv *il,
- struct il_rx_mem_buffer *rxb)
+ struct il_rx_buf *rxb)
{
- struct il_rx_packet *pkt = rxb_addr(rxb);
+ struct il_rx_pkt *pkt = rxb_addr(rxb);
u32 flags = le32_to_cpu(pkt->u.card_state_notif.flags);
unsigned long status = il->status;
il_rx_spectrum_measure_notif;
il->rx_handlers[PM_SLEEP_NOTIFICATION] = il_rx_pm_sleep_notif;
il->rx_handlers[PM_DEBUG_STATISTIC_NOTIFIC] =
- il_rx_pm_debug_statistics_notif;
+ il_rx_pm_debug_stats_notif;
il->rx_handlers[BEACON_NOTIFICATION] = il3945_rx_beacon_notif;
/*
* The same handler is used for both the REPLY to a discrete
- * statistics request from the host as well as for the periodic
- * statistics notifications (after received beacons) from the uCode.
+ * stats request from the host as well as for the periodic
+ * stats notifications (after received beacons) from the uCode.
*/
- il->rx_handlers[REPLY_STATISTICS_CMD] = il3945_reply_statistics;
- il->rx_handlers[STATISTICS_NOTIFICATION] = il3945_hw_rx_statistics;
+ il->rx_handlers[REPLY_STATISTICS_CMD] = il3945_reply_stats;
+ il->rx_handlers[STATISTICS_NOTIFICATION] = il3945_hw_rx_stats;
il_setup_rx_scan_handlers(il);
il->rx_handlers[CARD_STATE_NOTIFICATION] = il3945_rx_card_state_notif;
* 0 to 31
*
* Rx Queue Indexes
- * The host/firmware share two index registers for managing the Rx buffers.
+ * The host/firmware share two idx registers for managing the Rx buffers.
*
- * The READ index maps to the first position that the firmware may be writing
+ * The READ idx maps to the first position that the firmware may be writing
* to -- the driver can read up to (but not including) this position and get
* good data.
- * The READ index is managed by the firmware once the card is enabled.
+ * The READ idx is managed by the firmware once the card is enabled.
*
- * The WRITE index maps to the last position the driver has read from -- the
+ * The WRITE idx maps to the last position the driver has read from -- the
* position preceding WRITE is the last slot the firmware can place a packet.
*
* The queue is empty (no good data) if WRITE = READ - 1, and is full if
* WRITE = READ.
*
* During initialization, the host sets up the READ queue position to the first
- * INDEX position, and WRITE to the last (READ - 1 wrapped)
+ * IDX position, and WRITE to the last (READ - 1 wrapped)
*
- * When the firmware places a packet in a buffer, it will advance the READ index
- * and fire the RX interrupt. The driver can then query the READ index and
- * process as many packets as possible, moving the WRITE index forward as it
+ * When the firmware places a packet in a buffer, it will advance the READ idx
+ * and fire the RX interrupt. The driver can then query the READ idx and
+ * process as many packets as possible, moving the WRITE idx forward as it
* resets the Rx queue buffers with new memory.
*
* The management in the driver is as follows:
* iwl->rxq->free_count drops to or below RX_LOW_WATERMARK, work is scheduled
* to replenish the iwl->rxq->rx_free.
* + In il3945_rx_replenish (scheduled) if 'processed' != 'read' then the
- * iwl->rxq is replenished and the READ INDEX is updated (updating the
- * 'processed' and 'read' driver indexes as well)
+ * iwl->rxq is replenished and the READ IDX is updated (updating the
+ * 'processed' and 'read' driver idxes as well)
* + A received packet is processed and handed to the kernel network stack,
- * detached from the iwl->rxq. The driver 'processed' index is updated.
+ * detached from the iwl->rxq. The driver 'processed' idx is updated.
* + The Host/Firmware iwl->rxq is replenished at tasklet time from the rx_free
* list. If there are no allocated buffers in iwl->rxq->rx_free, the READ
- * INDEX is not incremented and iwl->status(RX_STALLED) is set. If there
+ * IDX is not incremented and iwl->status(RX_STALLED) is set. If there
* were enough free buffers and RX_STALLED is set it is cleared.
*
*
* il3945_rx_queue_restock
* il3945_rx_queue_restock() Moves available buffers from rx_free into Rx
* queue, updates firmware pointers, and updates
- * the WRITE index. If insufficient rx_free buffers
+ * the WRITE idx. If insufficient rx_free buffers
* are available, schedules il3945_rx_replenish
*
* -- enable interrupts --
- * ISR - il3945_rx() Detach il_rx_mem_buffers from pool up to the
- * READ INDEX, detaching the SKB from the pool.
+ * ISR - il3945_rx() Detach il_rx_bufs from pool up to the
+ * READ IDX, detaching the SKB from the pool.
* Moves the packet buffer from queue to rx_used.
* Calls il3945_rx_queue_restock to refill any empty
* slots.
* and we have free pre-allocated buffers, fill the ranks as much
* as we can, pulling from rx_free.
*
- * This moves the 'write' index forward to catch up with 'processed', and
+ * This moves the 'write' idx forward to catch up with 'processed', and
* also updates the memory address in the firmware to reference the new
* target buffer.
*/
{
struct il_rx_queue *rxq = &il->rxq;
struct list_head *element;
- struct il_rx_mem_buffer *rxb;
+ struct il_rx_buf *rxb;
unsigned long flags;
int write;
spin_lock_irqsave(&rxq->lock, flags);
write = rxq->write & ~0x7;
- while ((il_rx_queue_space(rxq) > 0) && (rxq->free_count)) {
+ while (il_rx_queue_space(rxq) > 0 && rxq->free_count) {
/* Get next free Rx buffer, remove from free list */
element = rxq->rx_free.next;
- rxb = list_entry(element, struct il_rx_mem_buffer, list);
+ rxb = list_entry(element, struct il_rx_buf, list);
list_del(element);
/* Point to Rx buffer via next RBD in circular buffer */
/* If we've added more space for the firmware to place data, tell it.
* Increment device's write pointer in multiples of 8. */
- if ((rxq->write_actual != (rxq->write & ~0x7))
- || (abs(rxq->write - rxq->read) > 7)) {
+ if (rxq->write_actual != (rxq->write & ~0x7) ||
+ abs(rxq->write - rxq->read) > 7) {
spin_lock_irqsave(&rxq->lock, flags);
rxq->need_update = 1;
spin_unlock_irqrestore(&rxq->lock, flags);
{
struct il_rx_queue *rxq = &il->rxq;
struct list_head *element;
- struct il_rx_mem_buffer *rxb;
+ struct il_rx_buf *rxb;
struct page *page;
unsigned long flags;
gfp_t gfp_mask = priority;
if (!page) {
if (net_ratelimit())
D_INFO("Failed to allocate SKB buffer.\n");
- if ((rxq->free_count <= RX_LOW_WATERMARK) &&
+ if (rxq->free_count <= RX_LOW_WATERMARK &&
net_ratelimit())
IL_ERR("Failed to allocate SKB buffer with %s. Only %u free buffers remaining.\n",
priority == GFP_ATOMIC ? "GFP_ATOMIC" : "GFP_KERNEL",
return;
}
element = rxq->rx_used.next;
- rxb = list_entry(element, struct il_rx_mem_buffer, list);
+ rxb = list_entry(element, struct il_rx_buf, list);
list_del(element);
spin_unlock_irqrestore(&rxq->lock, flags);
*/
static void il3945_rx_handle(struct il_priv *il)
{
- struct il_rx_mem_buffer *rxb;
- struct il_rx_packet *pkt;
+ struct il_rx_buf *rxb;
+ struct il_rx_pkt *pkt;
struct il_rx_queue *rxq = &il->rxq;
u32 r, i;
int reclaim;
u32 count = 8;
int total_empty = 0;
- /* uCode's read index (stored in shared DRAM) indicates the last Rx
+ /* uCode's read idx (stored in shared DRAM) indicates the last Rx
* buffer that the driver may process (last buffer filled by ucode). */
r = le16_to_cpu(rxq->rb_stts->closed_rb_num) & 0x0FFF;
i = rxq->read;
* Ucode should set SEQ_RX_FRAME bit if ucode-originated,
* but apparently a few don't get set; catch them here. */
reclaim = !(pkt->hdr.sequence & SEQ_RX_FRAME) &&
- (pkt->hdr.cmd != STATISTICS_NOTIFICATION) &&
- (pkt->hdr.cmd != REPLY_TX);
+ pkt->hdr.cmd != STATISTICS_NOTIFICATION &&
+ pkt->hdr.cmd != REPLY_TX;
/* Based on type of command response or notification,
* handle those that need handling via function in
u32 inta, handled = 0;
u32 inta_fh;
unsigned long flags;
-#ifdef CONFIG_IWLWIFI_LEGACY_DEBUG
+#ifdef CONFIG_IWLEGACY_DEBUG
u32 inta_mask;
#endif
inta_fh = _il_rd(il, CSR_FH_INT_STATUS);
_il_wr(il, CSR_FH_INT_STATUS, inta_fh);
-#ifdef CONFIG_IWLWIFI_LEGACY_DEBUG
+#ifdef CONFIG_IWLEGACY_DEBUG
if (il_get_debug_level(il) & IL_DL_ISR) {
/* just for debug */
inta_mask = _il_rd(il, CSR_INT_MASK);
return;
}
-#ifdef CONFIG_IWLWIFI_LEGACY_DEBUG
+#ifdef CONFIG_IWLEGACY_DEBUG
if (il_get_debug_level(il) & (IL_DL_ISR)) {
/* NIC fires this, but we don't use it, redundant with WAKEUP */
if (inta & CSR_INT_BIT_SCD) {
if (test_bit(STATUS_INT_ENABLED, &il->status))
il_enable_interrupts(il);
-#ifdef CONFIG_IWLWIFI_LEGACY_DEBUG
+#ifdef CONFIG_IWLEGACY_DEBUG
if (il_get_debug_level(il) & (IL_DL_ISR)) {
inta = _il_rd(il, CSR_INT);
inta_mask = _il_rd(il, CSR_INT_MASK);
* hearing clear Rx packet).*/
if (IL_UCODE_API(il->ucode_ver) >= 2) {
if (n_probes)
- scan_ch->type |= IWL39_SCAN_PROBE_MASK(n_probes);
+ scan_ch->type |= IL39_SCAN_PROBE_MASK(n_probes);
} else {
/* uCode v1 does not allow setting direct probe bits on
* passive channel. */
if ((scan_ch->type & 1) && n_probes)
- scan_ch->type |= IWL39_SCAN_PROBE_MASK(n_probes);
+ scan_ch->type |= IL39_SCAN_PROBE_MASK(n_probes);
}
/* Set txpower levels to defaults */
{
int i;
- for (i = 0; i < IL_RATE_COUNT_LEGACY; i++) {
+ for (i = 0; i < RATE_COUNT_LEGACY; i++) {
rates[i].bitrate = il3945_rates[i].ieee * 5;
- rates[i].hw_value = i; /* Rate scaling will work on indexes */
+ rates[i].hw_value = i; /* Rate scaling will work on idxes */
rates[i].hw_value_short = i;
rates[i].flags = 0;
- if ((i > IWL39_LAST_OFDM_RATE) || (i < IL_FIRST_OFDM_RATE)) {
+ if (i > IL39_LAST_OFDM_RATE || i < IL_FIRST_OFDM_RATE) {
/*
* If CCK != 1M then set short preamble rate flag.
*/
D_INFO("ucode inst image size is %u\n", len);
il_wr(il, HBUS_TARG_MEM_RADDR,
- IWL39_RTC_INST_LOWER_BOUND);
+ IL39_RTC_INST_LOWER_BOUND);
errcnt = 0;
for (; len > 0; len -= sizeof(u32), image++) {
/* NOTE: Use the debugless read so we don't flood kernel log
* if IL_DL_IO is set */
il_wr(il, HBUS_TARG_MEM_RADDR,
- i + IWL39_RTC_INST_LOWER_BOUND);
+ i + IL39_RTC_INST_LOWER_BOUND);
val = _il_rd(il, HBUS_TARG_MEM_RDAT);
if (val != le32_to_cpu(*image)) {
#if 0 /* Enable this if you want to see details */
_il_wr(il, CSR_RESET, 0);
}
-#define IWL3945_UCODE_GET(item) \
+#define IL3945_UCODE_GET(item) \
static u32 il3945_ucode_get_##item(const struct il_ucode_header *ucode)\
{ \
return le32_to_cpu(ucode->v1.item); \
return (u8 *) ucode->v1.data;
}
-IWL3945_UCODE_GET(inst_size);
-IWL3945_UCODE_GET(data_size);
-IWL3945_UCODE_GET(init_size);
-IWL3945_UCODE_GET(init_data_size);
-IWL3945_UCODE_GET(boot_size);
+IL3945_UCODE_GET(inst_size);
+IL3945_UCODE_GET(data_size);
+IL3945_UCODE_GET(init_size);
+IL3945_UCODE_GET(init_data_size);
+IL3945_UCODE_GET(boot_size);
/**
* il3945_read_ucode - Read uCode images from disk file.
static int il3945_read_ucode(struct il_priv *il)
{
const struct il_ucode_header *ucode;
- int ret = -EINVAL, index;
+ int ret = -EINVAL, idx;
const struct firmware *ucode_raw;
/* firmware file name contains uCode/driver compatibility version */
const char *name_pre = il->cfg->fw_name_pre;
/* Ask kernel firmware_class module to get the boot firmware off disk.
* request_firmware() is synchronous, file is in memory on return. */
- for (index = api_max; index >= api_min; index--) {
- sprintf(buf, "%s%u%s", name_pre, index, ".ucode");
+ for (idx = api_max; idx >= api_min; idx--) {
+ sprintf(buf, "%s%u%s", name_pre, idx, ".ucode");
ret = request_firmware(&ucode_raw, buf, &il->pci_dev->dev);
if (ret < 0) {
IL_ERR("%s firmware file req failed: %d\n",
else
goto error;
} else {
- if (index < api_max)
+ if (idx < api_max)
IL_ERR("Loaded firmware %s, "
"which is deprecated. "
" Please use API v%u instead.\n",
}
/* Verify that uCode images will fit in card's SRAM */
- if (inst_size > IWL39_MAX_INST_SIZE) {
+ if (inst_size > IL39_MAX_INST_SIZE) {
D_INFO("uCode instr len %d too large to fit in\n",
inst_size);
ret = -EINVAL;
goto err_release;
}
- if (data_size > IWL39_MAX_DATA_SIZE) {
+ if (data_size > IL39_MAX_DATA_SIZE) {
D_INFO("uCode data len %d too large to fit in\n",
data_size);
ret = -EINVAL;
goto err_release;
}
- if (init_size > IWL39_MAX_INST_SIZE) {
+ if (init_size > IL39_MAX_INST_SIZE) {
D_INFO(
"uCode init instr len %d too large to fit in\n",
init_size);
ret = -EINVAL;
goto err_release;
}
- if (init_data_size > IWL39_MAX_DATA_SIZE) {
+ if (init_data_size > IL39_MAX_DATA_SIZE) {
D_INFO(
"uCode init data len %d too large to fit in\n",
init_data_size);
ret = -EINVAL;
goto err_release;
}
- if (boot_size > IWL39_MAX_BSM_SIZE) {
+ if (boot_size > IL39_MAX_BSM_SIZE) {
D_INFO(
"uCode boot instr len %d too large to fit in\n",
boot_size);
{
int thermal_spin = 0;
u32 rfkill;
- struct il_rxon_context *ctx = &il->contexts[IL_RXON_CTX_BSS];
+ struct il_rxon_context *ctx = &il->ctx;
D_INFO("Runtime Alive received.\n");
ieee80211_wake_queues(il->hw);
- il->active_rate = IL_RATES_MASK_3945;
+ il->active_rate = RATES_MASK_3945;
il_power_update_mode(il, true);
- if (il_is_associated(il, IL_RXON_CTX_BSS)) {
+ if (il_is_associated(il)) {
struct il3945_rxon_cmd *active_rxon =
(struct il3945_rxon_cmd *)(&ctx->active);
static int il3945_alloc_bcast_station(struct il_priv *il)
{
- struct il_rxon_context *ctx = &il->contexts[IL_RXON_CTX_BSS];
+ struct il_rxon_context *ctx = &il->ctx;
unsigned long flags;
u8 sta_id;
scan->quiet_plcp_th = IL_PLCP_QUIET_THRESH;
scan->quiet_time = IL_ACTIVE_QUIET_TIME;
- if (il_is_associated(il, IL_RXON_CTX_BSS)) {
+ if (il_is_associated(il)) {
u16 interval;
u32 extra;
u32 suspend_time = 100;
/* We don't build a direct scan probe request; the uCode will do
* that based on the direct_mask added to each channel entry */
scan->tx_cmd.tx_flags = TX_CMD_FLG_SEQ_CTL_MSK;
- scan->tx_cmd.sta_id = il->contexts[IL_RXON_CTX_BSS].bcast_sta_id;
+ scan->tx_cmd.sta_id = il->ctx.bcast_sta_id;
scan->tx_cmd.stop_time.life_time = TX_CMD_LIFE_TIME_INFINITE;
/* flags + rate selection */
switch (il->scan_band) {
case IEEE80211_BAND_2GHZ:
scan->flags = RXON_FLG_BAND_24G_MSK | RXON_FLG_AUTO_DETECT_MSK;
- scan->tx_cmd.rate = IL_RATE_1M_PLCP;
+ scan->tx_cmd.rate = RATE_1M_PLCP;
band = IEEE80211_BAND_2GHZ;
break;
case IEEE80211_BAND_5GHZ:
- scan->tx_cmd.rate = IL_RATE_6M_PLCP;
+ scan->tx_cmd.rate = RATE_6M_PLCP;
band = IEEE80211_BAND_5GHZ;
break;
default:
void il3945_post_scan(struct il_priv *il)
{
- struct il_rxon_context *ctx = &il->contexts[IL_RXON_CTX_BSS];
+ struct il_rxon_context *ctx = &il->ctx;
/*
* Since setting the RXON may have been deferred while
{
int rc = 0;
struct ieee80211_conf *conf = NULL;
- struct il_rxon_context *ctx = &il->contexts[IL_RXON_CTX_BSS];
+ struct il_rxon_context *ctx = &il->ctx;
if (!ctx->vif || !il->is_open)
return;
void il3945_config_ap(struct il_priv *il)
{
- struct il_rxon_context *ctx = &il->contexts[IL_RXON_CTX_BSS];
+ struct il_rxon_context *ctx = &il->ctx;
struct ieee80211_vif *vif = ctx->vif;
int rc = 0;
return;
/* The following should be done only at AP bring up */
- if (!(il_is_associated(il, IL_RXON_CTX_BSS))) {
+ if (!(il_is_associated(il))) {
/* RXON - unassoc (to set timing command) */
ctx->staging.filter_flags &= ~RXON_FILTER_ASSOC_MSK;
!(key->flags & IEEE80211_KEY_FLAG_PAIRWISE))
return -EOPNOTSUPP;
- static_key = !il_is_associated(il, IL_RXON_CTX_BSS);
+ static_key = !il_is_associated(il);
if (!static_key) {
sta_id = il_sta_id_or_broadcast(
- il, &il->contexts[IL_RXON_CTX_BSS], sta);
+ il, &il->ctx, sta);
if (sta_id == IL_INVALID_STATION)
return -EINVAL;
}
ret = il_add_station_common(il,
- &il->contexts[IL_RXON_CTX_BSS],
+ &il->ctx,
sta->addr, is_ap, sta, &sta_id);
if (ret) {
IL_ERR("Unable to add station %pM (%d)\n",
{
struct il_priv *il = hw->priv;
__le32 filter_or = 0, filter_nand = 0;
- struct il_rxon_context *ctx = &il->contexts[IL_RXON_CTX_BSS];
+ struct il_rxon_context *ctx = &il->ctx;
#define CHK(test, flag) do { \
if (*total_flags & (test)) \
*
*****************************************************************************/
-#ifdef CONFIG_IWLWIFI_LEGACY_DEBUG
+#ifdef CONFIG_IWLEGACY_DEBUG
/*
* The following adds a new attribute to the sysfs representation
static DEVICE_ATTR(debug_level, S_IWUSR | S_IRUGO,
il3945_show_debug_level, il3945_store_debug_level);
-#endif /* CONFIG_IWLWIFI_LEGACY_DEBUG */
+#endif /* CONFIG_IWLEGACY_DEBUG */
static ssize_t il3945_show_temperature(struct device *d,
struct device_attribute *attr, char *buf)
struct device_attribute *attr, char *buf)
{
struct il_priv *il = dev_get_drvdata(d);
- struct il_rxon_context *ctx = &il->contexts[IL_RXON_CTX_BSS];
+ struct il_rxon_context *ctx = &il->ctx;
return sprintf(buf, "0x%04X\n", ctx->active.flags);
}
{
struct il_priv *il = dev_get_drvdata(d);
u32 flags = simple_strtoul(buf, NULL, 0);
- struct il_rxon_context *ctx = &il->contexts[IL_RXON_CTX_BSS];
+ struct il_rxon_context *ctx = &il->ctx;
mutex_lock(&il->mutex);
if (le32_to_cpu(ctx->staging.flags) != flags) {
struct device_attribute *attr, char *buf)
{
struct il_priv *il = dev_get_drvdata(d);
- struct il_rxon_context *ctx = &il->contexts[IL_RXON_CTX_BSS];
+ struct il_rxon_context *ctx = &il->ctx;
return sprintf(buf, "0x%04X\n",
le32_to_cpu(ctx->active.filter_flags));
const char *buf, size_t count)
{
struct il_priv *il = dev_get_drvdata(d);
- struct il_rxon_context *ctx = &il->contexts[IL_RXON_CTX_BSS];
+ struct il_rxon_context *ctx = &il->ctx;
u32 filter_flags = simple_strtoul(buf, NULL, 0);
mutex_lock(&il->mutex);
il->measurement_status = 0;
spin_unlock_irqrestore(&il->lock, flags);
- while (size && (PAGE_SIZE - len)) {
+ while (size && PAGE_SIZE - len) {
hex_dump_to_buffer(data + ofs, size, 16, 1, buf + len,
PAGE_SIZE - len, 1);
len = strlen(buf);
const char *buf, size_t count)
{
struct il_priv *il = dev_get_drvdata(d);
- struct il_rxon_context *ctx = &il->contexts[IL_RXON_CTX_BSS];
+ struct il_rxon_context *ctx = &il->ctx;
struct ieee80211_measurement_params params = {
.channel = le16_to_cpu(ctx->active.channel),
.start_time = cpu_to_le64(il->_3945.last_tsf),
return count;
}
- if ((ant >= 0) && (ant <= 2)) {
+ if (ant >= 0 && ant <= 2) {
D_INFO("Setting antenna select to %d.\n", ant);
il3945_mod_params.antenna = (enum il3945_antenna)ant;
} else
&dev_attr_status.attr,
&dev_attr_temperature.attr,
&dev_attr_tx_power.attr,
-#ifdef CONFIG_IWLWIFI_LEGACY_DEBUG
+#ifdef CONFIG_IWLEGACY_DEBUG
&dev_attr_debug_level.attr,
#endif
NULL
return ret;
}
-#define IWL3945_MAX_PROBE_REQUEST 200
+#define IL3945_MAX_PROBE_REQUEST 200
static int il3945_setup_mac(struct il_priv *il)
{
IEEE80211_HW_SPECTRUM_MGMT;
hw->wiphy->interface_modes =
- il->contexts[IL_RXON_CTX_BSS].interface_modes;
+ il->ctx.interface_modes;
hw->wiphy->flags |= WIPHY_FLAG_CUSTOM_REGULATORY |
WIPHY_FLAG_DISABLE_BEACON_HINTS |
hw->wiphy->max_scan_ssids = PROBE_OPTION_MAX_3945;
/* we create the 802.11 header and a zero-length SSID element */
- hw->wiphy->max_scan_ie_len = IWL3945_MAX_PROBE_REQUEST - 24 - 2;
+ hw->wiphy->max_scan_ie_len = IL3945_MAX_PROBE_REQUEST - 24 - 2;
/* Default value; 4 EDCA QOS priorities */
hw->queues = 4;
static int il3945_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
{
- int err = 0, i;
+ int err = 0;
struct il_priv *il;
struct ieee80211_hw *hw;
struct il_cfg *cfg = (struct il_cfg *)(ent->driver_data);
il = hw->priv;
SET_IEEE80211_DEV(hw, &pdev->dev);
- il->cmd_queue = IWL39_CMD_QUEUE_NUM;
+ il->cmd_queue = IL39_CMD_QUEUE_NUM;
- /* 3945 has only one valid context */
- il->valid_contexts = BIT(IL_RXON_CTX_BSS);
+ il->ctx.ctxid = 0;
- for (i = 0; i < NUM_IL_RXON_CTX; i++)
- il->contexts[i].ctxid = i;
-
- il->contexts[IL_RXON_CTX_BSS].rxon_cmd = REPLY_RXON;
- il->contexts[IL_RXON_CTX_BSS].rxon_timing_cmd = REPLY_RXON_TIMING;
- il->contexts[IL_RXON_CTX_BSS].rxon_assoc_cmd = REPLY_RXON_ASSOC;
- il->contexts[IL_RXON_CTX_BSS].qos_cmd = REPLY_QOS_PARAM;
- il->contexts[IL_RXON_CTX_BSS].ap_sta_id = IL_AP_ID;
- il->contexts[IL_RXON_CTX_BSS].wep_key_cmd = REPLY_WEPKEY;
- il->contexts[IL_RXON_CTX_BSS].interface_modes =
+ il->ctx.rxon_cmd = REPLY_RXON;
+ il->ctx.rxon_timing_cmd = REPLY_RXON_TIMING;
+ il->ctx.rxon_assoc_cmd = REPLY_RXON_ASSOC;
+ il->ctx.qos_cmd = REPLY_QOS_PARAM;
+ il->ctx.ap_sta_id = IL_AP_ID;
+ il->ctx.wep_key_cmd = REPLY_WEPKEY;
+ il->ctx.interface_modes =
BIT(NL80211_IFTYPE_STATION) |
BIT(NL80211_IFTYPE_ADHOC);
- il->contexts[IL_RXON_CTX_BSS].ibss_devtype = RXON_DEV_TYPE_IBSS;
- il->contexts[IL_RXON_CTX_BSS].station_devtype = RXON_DEV_TYPE_ESS;
- il->contexts[IL_RXON_CTX_BSS].unused_devtype = RXON_DEV_TYPE_ESS;
+ il->ctx.ibss_devtype = RXON_DEV_TYPE_IBSS;
+ il->ctx.station_devtype = RXON_DEV_TYPE_ESS;
+ il->ctx.unused_devtype = RXON_DEV_TYPE_ESS;
/*
* Disabling hardware scan means that mac80211 will perform scans
il_set_rxon_channel(il,
&il->bands[IEEE80211_BAND_2GHZ].channels[5],
- &il->contexts[IL_RXON_CTX_BSS]);
+ &il->ctx);
il3945_setup_deferred_work(il);
il3945_setup_rx_handlers(il);
il_power_initialize(il);
il3945_rate_control_unregister();
}
-MODULE_FIRMWARE(IWL3945_MODULE_FIRMWARE(IWL3945_UCODE_API_MAX));
+MODULE_FIRMWARE(IL3945_MODULE_FIRMWARE(IL3945_UCODE_API_MAX));
module_param_named(antenna, il3945_mod_params.antenna, int, S_IRUGO);
MODULE_PARM_DESC(antenna, "select antenna (1=Main, 2=Aux, default 0 [both])");
module_param_named(disable_hw_scan, il3945_mod_params.disable_hw_scan,
int, S_IRUGO);
MODULE_PARM_DESC(disable_hw_scan, "disable hardware scanning (default 1)");
-#ifdef CONFIG_IWLWIFI_LEGACY_DEBUG
+#ifdef CONFIG_IWLEGACY_DEBUG
module_param_named(debug, il_debug_level, uint, S_IRUGO | S_IWUSR);
MODULE_PARM_DESC(debug, "debug output mask");
#endif