Commit c2d79b48 authored by Winkler, Tomas's avatar Winkler, Tomas Committed by John W. Linville

iwlwifi: use iwl_cmd instead of iwl3945_cmd

This patch makes use of iwl_cmd instead of iwl3945_cmd and related
structures which were just the same.
Signed-off-by: default avatarTomas Winkler <tomas.winkler@intel.com>
Signed-off-by: default avatarZhu Yi <yi.zhu@intel.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 15b1687c
...@@ -68,7 +68,7 @@ static const struct { ...@@ -68,7 +68,7 @@ static const struct {
#define IWL_SOLID_BLINK_IDX (ARRAY_SIZE(blink_tbl) - 1) #define IWL_SOLID_BLINK_IDX (ARRAY_SIZE(blink_tbl) - 1)
static int iwl3945_led_cmd_callback(struct iwl_priv *priv, static int iwl3945_led_cmd_callback(struct iwl_priv *priv,
struct iwl3945_cmd *cmd, struct iwl_cmd *cmd,
struct sk_buff *skb) struct sk_buff *skb)
{ {
return 1; return 1;
...@@ -83,7 +83,7 @@ static inline int iwl3945_brightness_to_idx(enum led_brightness brightness) ...@@ -83,7 +83,7 @@ static inline int iwl3945_brightness_to_idx(enum led_brightness brightness)
static int iwl_send_led_cmd(struct iwl_priv *priv, static int iwl_send_led_cmd(struct iwl_priv *priv,
struct iwl_led_cmd *led_cmd) struct iwl_led_cmd *led_cmd)
{ {
struct iwl3945_host_cmd cmd = { struct iwl_host_cmd cmd = {
.id = REPLY_LEDS_CMD, .id = REPLY_LEDS_CMD,
.len = sizeof(struct iwl_led_cmd), .len = sizeof(struct iwl_led_cmd),
.data = led_cmd, .data = led_cmd,
......
...@@ -826,8 +826,7 @@ u8 iwl3945_hw_find_station(struct iwl_priv *priv, const u8 *addr) ...@@ -826,8 +826,7 @@ u8 iwl3945_hw_find_station(struct iwl_priv *priv, const u8 *addr)
* iwl3945_hw_build_tx_cmd_rate - Add rate portion to TX_CMD: * iwl3945_hw_build_tx_cmd_rate - Add rate portion to TX_CMD:
* *
*/ */
void iwl3945_hw_build_tx_cmd_rate(struct iwl_priv *priv, void iwl3945_hw_build_tx_cmd_rate(struct iwl_priv *priv, struct iwl_cmd *cmd,
struct iwl3945_cmd *cmd,
struct ieee80211_tx_info *info, struct ieee80211_tx_info *info,
struct ieee80211_hdr *hdr, int sta_id, int tx_id) struct ieee80211_hdr *hdr, int sta_id, int tx_id)
{ {
...@@ -839,9 +838,10 @@ void iwl3945_hw_build_tx_cmd_rate(struct iwl_priv *priv, ...@@ -839,9 +838,10 @@ void iwl3945_hw_build_tx_cmd_rate(struct iwl_priv *priv,
u8 data_retry_limit; u8 data_retry_limit;
__le32 tx_flags; __le32 tx_flags;
__le16 fc = hdr->frame_control; __le16 fc = hdr->frame_control;
struct iwl3945_tx_cmd *tx = (struct iwl3945_tx_cmd *)cmd->cmd.payload;
rate = iwl3945_rates[rate_index].plcp; rate = iwl3945_rates[rate_index].plcp;
tx_flags = cmd->cmd.tx.tx_flags; tx_flags = tx->tx_flags;
/* We need to figure out how to get the sta->supp_rates while /* We need to figure out how to get the sta->supp_rates while
* in this running context */ * in this running context */
...@@ -878,22 +878,22 @@ void iwl3945_hw_build_tx_cmd_rate(struct iwl_priv *priv, ...@@ -878,22 +878,22 @@ void iwl3945_hw_build_tx_cmd_rate(struct iwl_priv *priv,
} }
} }
cmd->cmd.tx.rts_retry_limit = rts_retry_limit; tx->rts_retry_limit = rts_retry_limit;
cmd->cmd.tx.data_retry_limit = data_retry_limit; tx->data_retry_limit = data_retry_limit;
cmd->cmd.tx.rate = rate; tx->rate = rate;
cmd->cmd.tx.tx_flags = tx_flags; tx->tx_flags = tx_flags;
/* OFDM */ /* OFDM */
cmd->cmd.tx.supp_rates[0] = tx->supp_rates[0] =
((rate_mask & IWL_OFDM_RATES_MASK) >> IWL_FIRST_OFDM_RATE) & 0xFF; ((rate_mask & IWL_OFDM_RATES_MASK) >> IWL_FIRST_OFDM_RATE) & 0xFF;
/* CCK */ /* CCK */
cmd->cmd.tx.supp_rates[1] = (rate_mask & 0xF); tx->supp_rates[1] = (rate_mask & 0xF);
IWL_DEBUG_RATE("Tx sta id: %d, rate: %d (plcp), flags: 0x%4X " IWL_DEBUG_RATE("Tx sta id: %d, rate: %d (plcp), flags: 0x%4X "
"cck/ofdm mask: 0x%x/0x%x\n", sta_id, "cck/ofdm mask: 0x%x/0x%x\n", sta_id,
cmd->cmd.tx.rate, le32_to_cpu(cmd->cmd.tx.tx_flags), tx->rate, le32_to_cpu(tx->tx_flags),
cmd->cmd.tx.supp_rates[1], cmd->cmd.tx.supp_rates[0]); tx->supp_rates[1], tx->supp_rates[0]);
} }
u8 iwl3945_sync_sta(struct iwl_priv *priv, int sta_id, u16 tx_rate, u8 flags) u8 iwl3945_sync_sta(struct iwl_priv *priv, int sta_id, u16 tx_rate, u8 flags)
......
...@@ -147,62 +147,6 @@ struct iwl3945_frame { ...@@ -147,62 +147,6 @@ struct iwl3945_frame {
#define SN_TO_SEQ(ssn) (((ssn) << 4) & IEEE80211_SCTL_SEQ) #define SN_TO_SEQ(ssn) (((ssn) << 4) & IEEE80211_SCTL_SEQ)
#define MAX_SN ((IEEE80211_SCTL_SEQ) >> 4) #define MAX_SN ((IEEE80211_SCTL_SEQ) >> 4)
struct iwl3945_cmd;
struct iwl_priv;
struct iwl3945_cmd_meta {
struct iwl3945_cmd_meta *source;
union {
struct sk_buff *skb;
int (*callback)(struct iwl_priv *priv,
struct iwl3945_cmd *cmd, struct sk_buff *skb);
} __attribute__ ((packed)) u;
/* The CMD_SIZE_HUGE flag bit indicates that the command
* structure is stored at the end of the shared queue memory. */
u32 flags;
} __attribute__ ((packed));
/**
* struct iwl3945_cmd
*
* For allocation of the command and tx queues, this establishes the overall
* size of the largest command we send to uCode, except for a scan command
* (which is relatively huge; space is allocated separately).
*/
struct iwl3945_cmd {
struct iwl3945_cmd_meta meta;
struct iwl_cmd_header hdr;
union {
struct iwl3945_addsta_cmd addsta;
struct iwl_led_cmd led;
u32 flags;
u8 val8;
u16 val16;
u32 val32;
struct iwl_bt_cmd bt;
struct iwl_rxon_time_cmd rxon_time;
struct iwl_powertable_cmd powertable;
struct iwl_qosparam_cmd qosparam;
struct iwl3945_tx_cmd tx;
struct iwl3945_tx_beacon_cmd tx_beacon;
struct iwl3945_rxon_assoc_cmd rxon_assoc;
u8 *indirect;
u8 payload[360];
} __attribute__ ((packed)) cmd;
} __attribute__ ((packed));
struct iwl3945_host_cmd {
u8 id;
u16 len;
struct iwl3945_cmd_meta meta;
const void *data;
};
#define TFD39_MAX_PAYLOAD_SIZE (sizeof(struct iwl3945_cmd) - \
sizeof(struct iwl3945_cmd_meta))
/* /*
* RX related structures and functions * RX related structures and functions
*/ */
...@@ -288,7 +232,7 @@ extern void iwl3945_tx_queue_free(struct iwl_priv *priv, struct iwl3945_tx_queue ...@@ -288,7 +232,7 @@ extern void iwl3945_tx_queue_free(struct iwl_priv *priv, struct iwl3945_tx_queue
extern int iwl3945_send_cmd_pdu(struct iwl_priv *priv, u8 id, u16 len, extern int iwl3945_send_cmd_pdu(struct iwl_priv *priv, u8 id, u16 len,
const void *data); const void *data);
extern int __must_check iwl3945_send_cmd(struct iwl_priv *priv, extern int __must_check iwl3945_send_cmd(struct iwl_priv *priv,
struct iwl3945_host_cmd *cmd); struct iwl_host_cmd *cmd);
extern unsigned int iwl3945_fill_beacon_frame(struct iwl_priv *priv, extern unsigned int iwl3945_fill_beacon_frame(struct iwl_priv *priv,
struct ieee80211_hdr *hdr,int left); struct ieee80211_hdr *hdr,int left);
extern int iwl3945_rx_queue_update_write_ptr(struct iwl_priv *priv, extern int iwl3945_rx_queue_update_write_ptr(struct iwl_priv *priv,
...@@ -340,8 +284,7 @@ extern int iwl3945_hw_tx_queue_init(struct iwl_priv *priv, ...@@ -340,8 +284,7 @@ extern int iwl3945_hw_tx_queue_init(struct iwl_priv *priv,
extern unsigned int iwl3945_hw_get_beacon_cmd(struct iwl_priv *priv, extern unsigned int iwl3945_hw_get_beacon_cmd(struct iwl_priv *priv,
struct iwl3945_frame *frame, u8 rate); struct iwl3945_frame *frame, u8 rate);
extern int iwl3945_hw_get_rx_read(struct iwl_priv *priv); extern int iwl3945_hw_get_rx_read(struct iwl_priv *priv);
extern void iwl3945_hw_build_tx_cmd_rate(struct iwl_priv *priv, void iwl3945_hw_build_tx_cmd_rate(struct iwl_priv *priv, struct iwl_cmd *cmd,
struct iwl3945_cmd *cmd,
struct ieee80211_tx_info *info, struct ieee80211_tx_info *info,
struct ieee80211_hdr *hdr, struct ieee80211_hdr *hdr,
int sta_id, int tx_id); int sta_id, int tx_id);
......
...@@ -240,7 +240,7 @@ struct iwl_channel_info { ...@@ -240,7 +240,7 @@ struct iwl_channel_info {
struct iwl3945_tx_queue { struct iwl3945_tx_queue {
struct iwl_queue q; struct iwl_queue q;
struct iwl3945_tfd_frame *bd; struct iwl3945_tfd_frame *bd;
struct iwl3945_cmd *cmd; struct iwl_cmd *cmd;
dma_addr_t dma_addr_cmd; dma_addr_t dma_addr_cmd;
struct iwl3945_tx_info *txb; struct iwl3945_tx_info *txb;
int need_update; int need_update;
......
...@@ -232,7 +232,7 @@ int iwl3945_tx_queue_init(struct iwl_priv *priv, ...@@ -232,7 +232,7 @@ int iwl3945_tx_queue_init(struct iwl_priv *priv,
* For data Tx queues (all other queues), no super-size command * For data Tx queues (all other queues), no super-size command
* space is needed. * space is needed.
*/ */
len = sizeof(struct iwl3945_cmd) * slots_num; len = sizeof(struct iwl_cmd) * slots_num;
if (txq_id == IWL_CMD_QUEUE_NUM) if (txq_id == IWL_CMD_QUEUE_NUM)
len += IWL_MAX_SCAN_SIZE; len += IWL_MAX_SCAN_SIZE;
txq->cmd = pci_alloc_consistent(dev, len, &txq->dma_addr_cmd); txq->cmd = pci_alloc_consistent(dev, len, &txq->dma_addr_cmd);
...@@ -283,7 +283,7 @@ void iwl3945_tx_queue_free(struct iwl_priv *priv, struct iwl3945_tx_queue *txq) ...@@ -283,7 +283,7 @@ void iwl3945_tx_queue_free(struct iwl_priv *priv, struct iwl3945_tx_queue *txq)
q->read_ptr = iwl_queue_inc_wrap(q->read_ptr, q->n_bd)) q->read_ptr = iwl_queue_inc_wrap(q->read_ptr, q->n_bd))
iwl3945_hw_txq_free_tfd(priv, txq); iwl3945_hw_txq_free_tfd(priv, txq);
len = sizeof(struct iwl3945_cmd) * q->n_window; len = sizeof(struct iwl_cmd) * q->n_window;
if (q->id == IWL_CMD_QUEUE_NUM) if (q->id == IWL_CMD_QUEUE_NUM)
len += IWL_MAX_SCAN_SIZE; len += IWL_MAX_SCAN_SIZE;
...@@ -500,13 +500,13 @@ static inline int iwl3945_is_ready_rf(struct iwl_priv *priv) ...@@ -500,13 +500,13 @@ static inline int iwl3945_is_ready_rf(struct iwl_priv *priv)
* failed. On success, it turns the index (> 0) of command in the * failed. On success, it turns the index (> 0) of command in the
* command queue. * command queue.
*/ */
static int iwl3945_enqueue_hcmd(struct iwl_priv *priv, struct iwl3945_host_cmd *cmd) static int iwl3945_enqueue_hcmd(struct iwl_priv *priv, struct iwl_host_cmd *cmd)
{ {
struct iwl3945_tx_queue *txq = &priv->txq39[IWL_CMD_QUEUE_NUM]; struct iwl3945_tx_queue *txq = &priv->txq39[IWL_CMD_QUEUE_NUM];
struct iwl_queue *q = &txq->q; struct iwl_queue *q = &txq->q;
struct iwl3945_tfd_frame *tfd; struct iwl3945_tfd_frame *tfd;
u32 *control_flags; u32 *control_flags;
struct iwl3945_cmd *out_cmd; struct iwl_cmd *out_cmd;
u32 idx; u32 idx;
u16 fix_size = (u16)(cmd->len + sizeof(out_cmd->hdr)); u16 fix_size = (u16)(cmd->len + sizeof(out_cmd->hdr));
dma_addr_t phys_addr; dma_addr_t phys_addr;
...@@ -518,7 +518,7 @@ static int iwl3945_enqueue_hcmd(struct iwl_priv *priv, struct iwl3945_host_cmd * ...@@ -518,7 +518,7 @@ static int iwl3945_enqueue_hcmd(struct iwl_priv *priv, struct iwl3945_host_cmd *
/* If any of the command structures end up being larger than /* If any of the command structures end up being larger than
* the TFD_MAX_PAYLOAD_SIZE, and it sent as a 'small' command then * the TFD_MAX_PAYLOAD_SIZE, and it sent as a 'small' command then
* we will need to increase the size of the TFD entries */ * we will need to increase the size of the TFD entries */
BUG_ON((fix_size > TFD39_MAX_PAYLOAD_SIZE) && BUG_ON((fix_size > TFD_MAX_PAYLOAD_SIZE) &&
!(cmd->meta.flags & CMD_SIZE_HUGE)); !(cmd->meta.flags & CMD_SIZE_HUGE));
...@@ -556,7 +556,7 @@ static int iwl3945_enqueue_hcmd(struct iwl_priv *priv, struct iwl3945_host_cmd * ...@@ -556,7 +556,7 @@ static int iwl3945_enqueue_hcmd(struct iwl_priv *priv, struct iwl3945_host_cmd *
out_cmd->hdr.sequence |= SEQ_HUGE_FRAME; out_cmd->hdr.sequence |= SEQ_HUGE_FRAME;
phys_addr = txq->dma_addr_cmd + sizeof(txq->cmd[0]) * idx + phys_addr = txq->dma_addr_cmd + sizeof(txq->cmd[0]) * idx +
offsetof(struct iwl3945_cmd, hdr); offsetof(struct iwl_cmd, hdr);
iwl3945_hw_txq_attach_buf_to_tfd(priv, tfd, phys_addr, fix_size); iwl3945_hw_txq_attach_buf_to_tfd(priv, tfd, phys_addr, fix_size);
pad = U32_PAD(cmd->len); pad = U32_PAD(cmd->len);
...@@ -579,7 +579,8 @@ static int iwl3945_enqueue_hcmd(struct iwl_priv *priv, struct iwl3945_host_cmd * ...@@ -579,7 +579,8 @@ static int iwl3945_enqueue_hcmd(struct iwl_priv *priv, struct iwl3945_host_cmd *
return ret ? ret : idx; return ret ? ret : idx;
} }
static int iwl3945_send_cmd_async(struct iwl_priv *priv, struct iwl3945_host_cmd *cmd) static int iwl3945_send_cmd_async(struct iwl_priv *priv,
struct iwl_host_cmd *cmd)
{ {
int ret; int ret;
...@@ -604,7 +605,8 @@ static int iwl3945_send_cmd_async(struct iwl_priv *priv, struct iwl3945_host_cmd ...@@ -604,7 +605,8 @@ static int iwl3945_send_cmd_async(struct iwl_priv *priv, struct iwl3945_host_cmd
return 0; return 0;
} }
static int iwl3945_send_cmd_sync(struct iwl_priv *priv, struct iwl3945_host_cmd *cmd) static int iwl3945_send_cmd_sync(struct iwl_priv *priv,
struct iwl_host_cmd *cmd)
{ {
int cmd_idx; int cmd_idx;
int ret; int ret;
...@@ -675,7 +677,7 @@ static int iwl3945_send_cmd_sync(struct iwl_priv *priv, struct iwl3945_host_cmd ...@@ -675,7 +677,7 @@ static int iwl3945_send_cmd_sync(struct iwl_priv *priv, struct iwl3945_host_cmd
cancel: cancel:
if (cmd->meta.flags & CMD_WANT_SKB) { if (cmd->meta.flags & CMD_WANT_SKB) {
struct iwl3945_cmd *qcmd; struct iwl_cmd *qcmd;
/* Cancel the CMD_WANT_SKB flag for the cmd in the /* Cancel the CMD_WANT_SKB flag for the cmd in the
* TX cmd queue. Otherwise in case the cmd comes * TX cmd queue. Otherwise in case the cmd comes
...@@ -694,7 +696,7 @@ static int iwl3945_send_cmd_sync(struct iwl_priv *priv, struct iwl3945_host_cmd ...@@ -694,7 +696,7 @@ static int iwl3945_send_cmd_sync(struct iwl_priv *priv, struct iwl3945_host_cmd
return ret; return ret;
} }
int iwl3945_send_cmd(struct iwl_priv *priv, struct iwl3945_host_cmd *cmd) int iwl3945_send_cmd(struct iwl_priv *priv, struct iwl_host_cmd *cmd)
{ {
if (cmd->meta.flags & CMD_ASYNC) if (cmd->meta.flags & CMD_ASYNC)
return iwl3945_send_cmd_async(priv, cmd); return iwl3945_send_cmd_async(priv, cmd);
...@@ -704,7 +706,7 @@ int iwl3945_send_cmd(struct iwl_priv *priv, struct iwl3945_host_cmd *cmd) ...@@ -704,7 +706,7 @@ int iwl3945_send_cmd(struct iwl_priv *priv, struct iwl3945_host_cmd *cmd)
int iwl3945_send_cmd_pdu(struct iwl_priv *priv, u8 id, u16 len, const void *data) int iwl3945_send_cmd_pdu(struct iwl_priv *priv, u8 id, u16 len, const void *data)
{ {
struct iwl3945_host_cmd cmd = { struct iwl_host_cmd cmd = {
.id = id, .id = id,
.len = len, .len = len,
.data = data, .data = data,
...@@ -715,7 +717,7 @@ int iwl3945_send_cmd_pdu(struct iwl_priv *priv, u8 id, u16 len, const void *data ...@@ -715,7 +717,7 @@ int iwl3945_send_cmd_pdu(struct iwl_priv *priv, u8 id, u16 len, const void *data
static int __must_check iwl3945_send_cmd_u32(struct iwl_priv *priv, u8 id, u32 val) static int __must_check iwl3945_send_cmd_u32(struct iwl_priv *priv, u8 id, u32 val)
{ {
struct iwl3945_host_cmd cmd = { struct iwl_host_cmd cmd = {
.id = id, .id = id,
.len = sizeof(val), .len = sizeof(val),
.data = &val, .data = &val,
...@@ -894,7 +896,7 @@ static int iwl3945_send_rxon_assoc(struct iwl_priv *priv) ...@@ -894,7 +896,7 @@ static int iwl3945_send_rxon_assoc(struct iwl_priv *priv)
int rc = 0; int rc = 0;
struct iwl_rx_packet *res = NULL; struct iwl_rx_packet *res = NULL;
struct iwl3945_rxon_assoc_cmd rxon_assoc; struct iwl3945_rxon_assoc_cmd rxon_assoc;
struct iwl3945_host_cmd cmd = { struct iwl_host_cmd cmd = {
.id = REPLY_RXON_ASSOC, .id = REPLY_RXON_ASSOC,
.len = sizeof(rxon_assoc), .len = sizeof(rxon_assoc),
.meta.flags = CMD_WANT_SKB, .meta.flags = CMD_WANT_SKB,
...@@ -1077,7 +1079,7 @@ static int iwl3945_send_scan_abort(struct iwl_priv *priv) ...@@ -1077,7 +1079,7 @@ static int iwl3945_send_scan_abort(struct iwl_priv *priv)
{ {
int rc = 0; int rc = 0;
struct iwl_rx_packet *res; struct iwl_rx_packet *res;
struct iwl3945_host_cmd cmd = { struct iwl_host_cmd cmd = {
.id = REPLY_SCAN_ABORT_CMD, .id = REPLY_SCAN_ABORT_CMD,
.meta.flags = CMD_WANT_SKB, .meta.flags = CMD_WANT_SKB,
}; };
...@@ -1115,7 +1117,7 @@ static int iwl3945_send_scan_abort(struct iwl_priv *priv) ...@@ -1115,7 +1117,7 @@ static int iwl3945_send_scan_abort(struct iwl_priv *priv)
} }
static int iwl3945_card_state_sync_callback(struct iwl_priv *priv, static int iwl3945_card_state_sync_callback(struct iwl_priv *priv,
struct iwl3945_cmd *cmd, struct iwl_cmd *cmd,
struct sk_buff *skb) struct sk_buff *skb)
{ {
return 1; return 1;
...@@ -1133,7 +1135,7 @@ static int iwl3945_card_state_sync_callback(struct iwl_priv *priv, ...@@ -1133,7 +1135,7 @@ static int iwl3945_card_state_sync_callback(struct iwl_priv *priv,
*/ */
static int iwl3945_send_card_state(struct iwl_priv *priv, u32 flags, u8 meta_flag) static int iwl3945_send_card_state(struct iwl_priv *priv, u32 flags, u8 meta_flag)
{ {
struct iwl3945_host_cmd cmd = { struct iwl_host_cmd cmd = {
.id = REPLY_CARD_STATE_CMD, .id = REPLY_CARD_STATE_CMD,
.len = sizeof(u32), .len = sizeof(u32),
.data = &flags, .data = &flags,
...@@ -1147,7 +1149,7 @@ static int iwl3945_send_card_state(struct iwl_priv *priv, u32 flags, u8 meta_fla ...@@ -1147,7 +1149,7 @@ static int iwl3945_send_card_state(struct iwl_priv *priv, u32 flags, u8 meta_fla
} }
static int iwl3945_add_sta_sync_callback(struct iwl_priv *priv, static int iwl3945_add_sta_sync_callback(struct iwl_priv *priv,
struct iwl3945_cmd *cmd, struct sk_buff *skb) struct iwl_cmd *cmd, struct sk_buff *skb)
{ {
struct iwl_rx_packet *res = NULL; struct iwl_rx_packet *res = NULL;
...@@ -1179,7 +1181,7 @@ int iwl3945_send_add_station(struct iwl_priv *priv, ...@@ -1179,7 +1181,7 @@ int iwl3945_send_add_station(struct iwl_priv *priv,
{ {
struct iwl_rx_packet *res = NULL; struct iwl_rx_packet *res = NULL;
int rc = 0; int rc = 0;
struct iwl3945_host_cmd cmd = { struct iwl_host_cmd cmd = {
.id = REPLY_ADD_STA, .id = REPLY_ADD_STA,
.len = sizeof(struct iwl3945_addsta_cmd), .len = sizeof(struct iwl3945_addsta_cmd),
.meta.flags = flags, .meta.flags = flags,
...@@ -2202,7 +2204,7 @@ static int iwl3945_set_mode(struct iwl_priv *priv, int mode) ...@@ -2202,7 +2204,7 @@ static int iwl3945_set_mode(struct iwl_priv *priv, int mode)
static void iwl3945_build_tx_cmd_hwcrypto(struct iwl_priv *priv, static void iwl3945_build_tx_cmd_hwcrypto(struct iwl_priv *priv,
struct ieee80211_tx_info *info, struct ieee80211_tx_info *info,
struct iwl3945_cmd *cmd, struct iwl_cmd *cmd,
struct sk_buff *skb_frag, struct sk_buff *skb_frag,
int last_frag) int last_frag)
{ {
...@@ -2251,7 +2253,7 @@ static void iwl3945_build_tx_cmd_hwcrypto(struct iwl_priv *priv, ...@@ -2251,7 +2253,7 @@ static void iwl3945_build_tx_cmd_hwcrypto(struct iwl_priv *priv,
* handle build REPLY_TX command notification. * handle build REPLY_TX command notification.
*/ */
static void iwl3945_build_tx_cmd_basic(struct iwl_priv *priv, static void iwl3945_build_tx_cmd_basic(struct iwl_priv *priv,
struct iwl3945_cmd *cmd, struct iwl_cmd *cmd,
struct ieee80211_tx_info *info, struct ieee80211_tx_info *info,
struct ieee80211_hdr *hdr, struct ieee80211_hdr *hdr,
int is_unicast, u8 std_id) int is_unicast, u8 std_id)
...@@ -2386,7 +2388,7 @@ static int iwl3945_tx_skb(struct iwl_priv *priv, struct sk_buff *skb) ...@@ -2386,7 +2388,7 @@ static int iwl3945_tx_skb(struct iwl_priv *priv, struct sk_buff *skb)
struct iwl_queue *q = NULL; struct iwl_queue *q = NULL;
dma_addr_t phys_addr; dma_addr_t phys_addr;
dma_addr_t txcmd_phys; dma_addr_t txcmd_phys;
struct iwl3945_cmd *out_cmd = NULL; struct iwl_cmd *out_cmd = NULL;
u16 len, idx, len_org, hdr_len; u16 len, idx, len_org, hdr_len;
u8 id; u8 id;
u8 unicast; u8 unicast;
...@@ -2514,8 +2516,8 @@ static int iwl3945_tx_skb(struct iwl_priv *priv, struct sk_buff *skb) ...@@ -2514,8 +2516,8 @@ static int iwl3945_tx_skb(struct iwl_priv *priv, struct sk_buff *skb)
/* Physical address of this Tx command's header (not MAC header!), /* Physical address of this Tx command's header (not MAC header!),
* within command buffer array. */ * within command buffer array. */
txcmd_phys = txq->dma_addr_cmd + sizeof(struct iwl3945_cmd) * idx + txcmd_phys = txq->dma_addr_cmd + sizeof(struct iwl_cmd) * idx +
offsetof(struct iwl3945_cmd, hdr); offsetof(struct iwl_cmd, hdr);
/* Add buffer containing Tx command and MAC(!) header to TFD's /* Add buffer containing Tx command and MAC(!) header to TFD's
* first entry */ * first entry */
...@@ -2793,7 +2795,7 @@ static int iwl3945_get_measurement(struct iwl_priv *priv, ...@@ -2793,7 +2795,7 @@ static int iwl3945_get_measurement(struct iwl_priv *priv,
{ {
struct iwl_spectrum_cmd spectrum; struct iwl_spectrum_cmd spectrum;
struct iwl_rx_packet *res; struct iwl_rx_packet *res;
struct iwl3945_host_cmd cmd = { struct iwl_host_cmd cmd = {
.id = REPLY_SPECTRUM_MEASUREMENT_CMD, .id = REPLY_SPECTRUM_MEASUREMENT_CMD,
.data = (void *)&spectrum, .data = (void *)&spectrum,
.meta.flags = CMD_WANT_SKB, .meta.flags = CMD_WANT_SKB,
...@@ -3271,7 +3273,7 @@ static void iwl3945_tx_cmd_complete(struct iwl_priv *priv, ...@@ -3271,7 +3273,7 @@ static void iwl3945_tx_cmd_complete(struct iwl_priv *priv,
int index = SEQ_TO_INDEX(sequence); int index = SEQ_TO_INDEX(sequence);
int huge = !!(pkt->hdr.sequence & SEQ_HUGE_FRAME); int huge = !!(pkt->hdr.sequence & SEQ_HUGE_FRAME);
int cmd_index; int cmd_index;
struct iwl3945_cmd *cmd; struct iwl_cmd *cmd;
BUG_ON(txq_id != IWL_CMD_QUEUE_NUM); BUG_ON(txq_id != IWL_CMD_QUEUE_NUM);
...@@ -5974,7 +5976,7 @@ static void iwl3945_bg_request_scan(struct work_struct *data) ...@@ -5974,7 +5976,7 @@ static void iwl3945_bg_request_scan(struct work_struct *data)
{ {
struct iwl_priv *priv = struct iwl_priv *priv =
container_of(data, struct iwl_priv, request_scan); container_of(data, struct iwl_priv, request_scan);
struct iwl3945_host_cmd cmd = { struct iwl_host_cmd cmd = {
.id = REPLY_SCAN_CMD, .id = REPLY_SCAN_CMD,
.len = sizeof(struct iwl3945_scan_cmd), .len = sizeof(struct iwl3945_scan_cmd),
.meta.flags = CMD_SIZE_HUGE, .meta.flags = CMD_SIZE_HUGE,
......
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