It still holds a pointer to iwl_priv. But hopefully this will disappear at some point.
Also add the multiple inclusion protection to iwl-trans.h that was forgotten.
Move iwl-trans structures to iwl-trans.h
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
return -EFAULT;
}
- return trans_send_cmd(priv, &hcmd);
+ return trans_send_cmd(&priv->trans, &hcmd);
}
static struct iwl_lib_ops iwl5000_lib = {
return -EFAULT;
}
- return trans_send_cmd(priv, &hcmd);
+ return trans_send_cmd(&priv->trans, &hcmd);
}
static struct iwl_lib_ops iwl6000_lib = {
hcmd.len[0] = priv->calib_results[i].buf_len;
hcmd.data[0] = priv->calib_results[i].buf;
hcmd.dataflags[0] = IWL_HCMD_DFL_NOCOPY;
- ret = trans_send_cmd(priv, &hcmd);
+ ret = trans_send_cmd(&priv->trans, &hcmd);
if (ret) {
IWL_ERR(priv, "Error %d iteration %d\n",
ret, i);
memcpy(&(priv->sensitivity_tbl[0]), &(cmd.table[0]),
sizeof(u16)*HD_TABLE_SIZE);
- return trans_send_cmd(priv, &cmd_out);
+ return trans_send_cmd(&priv->trans, &cmd_out);
}
/* Prepare a SENSITIVITY_CMD, send to uCode if values have changed */
&(cmd.enhance_table[HD_INA_NON_SQUARE_DET_OFDM_INDEX]),
sizeof(u16)*ENHANCE_HD_TABLE_ENTRIES);
- return trans_send_cmd(priv, &cmd_out);
+ return trans_send_cmd(&priv->trans, &cmd_out);
}
void iwl_init_sensitivity(struct iwl_priv *priv)
priv->_agn.phy_calib_chain_noise_gain_cmd);
cmd.delta_gain_1 = data->delta_gain_code[1];
cmd.delta_gain_2 = data->delta_gain_code[2];
- trans_send_cmd_pdu(priv, REPLY_PHY_CALIBRATION_CMD,
+ trans_send_cmd_pdu(&priv->trans, REPLY_PHY_CALIBRATION_CMD,
CMD_ASYNC, sizeof(cmd), &cmd);
data->radio_write = 1;
else
tx_ant_cfg_cmd = REPLY_TX_POWER_DBM_CMD;
- return trans_send_cmd_pdu(priv, tx_ant_cfg_cmd, CMD_SYNC,
+ return trans_send_cmd_pdu(&priv->trans, tx_ant_cfg_cmd, CMD_SYNC,
sizeof(tx_power_cmd), &tx_power_cmd);
}
if (ret)
return ret;
- ret = trans_send_cmd(priv, &cmd);
+ ret = trans_send_cmd(&priv->trans, &cmd);
if (ret) {
clear_bit(STATUS_SCAN_HW, &priv->status);
iwlagn_set_pan_params(priv);
flush_cmd.fifo_control);
flush_cmd.flush_control = cpu_to_le16(flush_control);
- return trans_send_cmd(priv, &cmd);
+ return trans_send_cmd(&priv->trans, &cmd);
}
void iwlagn_dev_txfifo_flush(struct iwl_priv *priv, u16 flush_control)
if (priv->cfg->bt_params->bt_session_2) {
memcpy(&bt_cmd_2000.basic, &basic,
sizeof(basic));
- ret = trans_send_cmd_pdu(priv, REPLY_BT_CONFIG,
+ ret = trans_send_cmd_pdu(&priv->trans, REPLY_BT_CONFIG,
CMD_SYNC, sizeof(bt_cmd_2000), &bt_cmd_2000);
} else {
memcpy(&bt_cmd_6000.basic, &basic,
sizeof(basic));
- ret = trans_send_cmd_pdu(priv, REPLY_BT_CONFIG,
+ ret = trans_send_cmd_pdu(&priv->trans, REPLY_BT_CONFIG,
CMD_SYNC, sizeof(bt_cmd_6000), &bt_cmd_6000);
}
if (ret)
int ret;
send->filter_flags &= ~RXON_FILTER_ASSOC_MSK;
- ret = trans_send_cmd_pdu(priv, ctx->rxon_cmd,
+ ret = trans_send_cmd_pdu(&priv->trans, ctx->rxon_cmd,
CMD_SYNC, sizeof(*send), send);
send->filter_flags = old_filter;
send->filter_flags &= ~RXON_FILTER_ASSOC_MSK;
send->dev_type = RXON_DEV_TYPE_P2P;
- ret = trans_send_cmd_pdu(priv, ctx->rxon_cmd,
+ ret = trans_send_cmd_pdu(&priv->trans, ctx->rxon_cmd,
CMD_SYNC, sizeof(*send), send);
send->filter_flags = old_filter;
int ret;
send->filter_flags &= ~RXON_FILTER_ASSOC_MSK;
- ret = trans_send_cmd_pdu(priv, ctx->rxon_cmd, CMD_SYNC,
+ ret = trans_send_cmd_pdu(&priv->trans, ctx->rxon_cmd, CMD_SYNC,
sizeof(*send), send);
send->filter_flags = old_filter;
ctx->qos_data.qos_active,
ctx->qos_data.def_qos_parm.qos_flags);
- ret = trans_send_cmd_pdu(priv, ctx->qos_cmd, CMD_SYNC,
+ ret = trans_send_cmd_pdu(&priv->trans, ctx->qos_cmd, CMD_SYNC,
sizeof(struct iwl_qosparam_cmd),
&ctx->qos_data.def_qos_parm);
if (ret)
ctx->staging.ofdm_ht_triple_stream_basic_rates;
rxon_assoc.acquisition_data = ctx->staging.acquisition_data;
- ret = trans_send_cmd_pdu(priv, ctx->rxon_assoc_cmd,
+ ret = trans_send_cmd_pdu(&priv->trans, ctx->rxon_assoc_cmd,
CMD_ASYNC, sizeof(rxon_assoc), &rxon_assoc);
return ret;
}
* Associated RXON doesn't clear the station table in uCode,
* so we don't need to restore stations etc. after this.
*/
- ret = trans_send_cmd_pdu(priv, ctx->rxon_cmd, CMD_SYNC,
+ ret = trans_send_cmd_pdu(&priv->trans, ctx->rxon_cmd, CMD_SYNC,
sizeof(struct iwl_rxon_cmd), &ctx->staging);
if (ret) {
IWL_ERR(priv, "Error setting new RXON (%d)\n", ret);
cmd.slots[0].width = cpu_to_le16(slot0);
cmd.slots[1].width = cpu_to_le16(slot1);
- ret = trans_send_cmd_pdu(priv, REPLY_WIPAN_PARAMS, CMD_SYNC,
+ ret = trans_send_cmd_pdu(&priv->trans, REPLY_WIPAN_PARAMS, CMD_SYNC,
sizeof(cmd), &cmd);
if (ret)
IWL_ERR(priv, "Error setting PAN parameters (%d)\n", ret);
memset(&cmd, 0, sizeof(cmd));
iwl_set_calib_hdr(&cmd.hdr,
priv->_agn.phy_calib_chain_noise_reset_cmd);
- ret = trans_send_cmd_pdu(priv,
+ ret = trans_send_cmd_pdu(&priv->trans,
REPLY_PHY_CALIBRATION_CMD,
CMD_SYNC, sizeof(cmd), &cmd);
if (ret)
cmd.len[0] = cmd_size;
if (not_empty || send_if_empty)
- return trans_send_cmd(priv, &cmd);
+ return trans_send_cmd(&priv->trans, &cmd);
else
return 0;
}
}
}
- tx_cmd = trans_get_tx_cmd(priv, txq_id);
+ tx_cmd = trans_get_tx_cmd(&priv->trans, txq_id);
if (unlikely(!tx_cmd))
goto drop_unlock_sta;
iwl_update_stats(priv, true, fc, len);
- if (trans_tx(priv, skb, tx_cmd, txq_id, fc, is_agg, ctx))
+ if (trans_tx(&priv->trans, skb, tx_cmd, txq_id, fc, is_agg, ctx))
goto drop_unlock_sta;
if (ieee80211_is_data_qos(fc)) {
* to deactivate the uCode queue, just return "success" to allow
* mac80211 to clean up it own data.
*/
- trans_txq_agg_disable(priv, txq_id, ssn, tx_fifo_id);
+ trans_txq_agg_disable(&priv->trans, txq_id, ssn, tx_fifo_id);
spin_unlock_irqrestore(&priv->lock, flags);
ieee80211_stop_tx_ba_cb_irqsafe(vif, sta->addr, tid);
u16 ssn = SEQ_TO_SN(tid_data->seq_number);
int tx_fifo = get_fifo_from_tid(ctx, tid);
IWL_DEBUG_HT(priv, "HW queue empty: continue DELBA flow\n");
- trans_txq_agg_disable(priv, txq_id, ssn, tx_fifo);
+ trans_txq_agg_disable(&priv->trans, txq_id,
+ ssn, tx_fifo);
tid_data->agg.state = IWL_AGG_OFF;
ieee80211_stop_tx_ba_cb_irqsafe(ctx->vif, addr, tid);
}
calib_cfg_cmd.ucd_calib_cfg.flags =
IWL_CALIB_CFG_FLAG_SEND_COMPLETE_NTFY_MSK;
- return trans_send_cmd(priv, &cmd);
+ return trans_send_cmd(&priv->trans, &cmd);
}
void iwlagn_rx_calib_result(struct iwl_priv *priv,
/* coexistence is disabled */
memset(&coex_cmd, 0, sizeof(coex_cmd));
}
- return trans_send_cmd_pdu(priv,
+ return trans_send_cmd_pdu(&priv->trans,
COEX_PRIORITY_TABLE_CMD, CMD_SYNC,
sizeof(coex_cmd), &coex_cmd);
}
memcpy(prio_tbl_cmd.prio_tbl, iwlagn_bt_prio_tbl,
sizeof(iwlagn_bt_prio_tbl));
- if (trans_send_cmd_pdu(priv,
+ if (trans_send_cmd_pdu(&priv->trans,
REPLY_BT_COEX_PRIO_TABLE, CMD_SYNC,
sizeof(prio_tbl_cmd), &prio_tbl_cmd))
IWL_ERR(priv, "failed to send BT prio tbl command\n");
env_cmd.action = action;
env_cmd.type = type;
- ret = trans_send_cmd_pdu(priv,
+ ret = trans_send_cmd_pdu(&priv->trans,
REPLY_BT_COEX_PROT_ENV, CMD_SYNC,
sizeof(env_cmd), &env_cmd);
if (ret)
{
int ret;
- trans_tx_start(priv);
+ trans_tx_start(&priv->trans);
ret = iwlagn_send_wimax_coex(priv);
if (ret)
int ret;
enum iwlagn_ucode_type old_type;
- ret = trans_start_device(priv);
+ ret = trans_start_device(&priv->trans);
if (ret)
return ret;
return ret;
}
- trans_kick_nic(priv);
+ trans_kick_nic(&priv->trans);
/*
* Some things may run in the background now, but we
iwlagn_remove_notification(priv, &calib_wait);
out:
/* Whatever happened, stop the device */
- trans_stop_device(priv);
+ trans_stop_device(&priv->trans);
return ret;
}
cmd.data[1] = priv->beacon_skb->data;
cmd.dataflags[1] = IWL_HCMD_DFL_NOCOPY;
- return trans_send_cmd(priv, &cmd);
+ return trans_send_cmd(&priv->trans, &cmd);
}
static void iwl_bg_beacon_update(struct work_struct *work)
adv_cmd.critical_temperature_exit =
cpu_to_le32(priv->hw_params.ct_kill_exit_threshold);
- ret = trans_send_cmd_pdu(priv,
+ ret = trans_send_cmd_pdu(&priv->trans,
REPLY_CT_KILL_CONFIG_CMD,
CMD_SYNC, sizeof(adv_cmd), &adv_cmd);
if (ret)
cmd.critical_temperature_R =
cpu_to_le32(priv->hw_params.ct_kill_threshold);
- ret = trans_send_cmd_pdu(priv,
+ ret = trans_send_cmd_pdu(&priv->trans,
REPLY_CT_KILL_CONFIG_CMD,
CMD_SYNC, sizeof(cmd), &cmd);
if (ret)
calib_cfg_cmd.ucd_calib_cfg.once.is_enable = IWL_CALIB_INIT_CFG_ALL;
calib_cfg_cmd.ucd_calib_cfg.once.start = cpu_to_le32(cfg);
- return trans_send_cmd(priv, &cmd);
+ return trans_send_cmd(&priv->trans, &cmd);
}
if (IWL_UCODE_API(priv->ucode_ver) > 1) {
IWL_DEBUG_HC(priv, "select valid tx ant: %u\n", valid_tx_ant);
- return trans_send_cmd_pdu(priv,
+ return trans_send_cmd_pdu(&priv->trans,
TX_ANT_CONFIGURATION_CMD,
CMD_SYNC,
sizeof(struct iwl_tx_ant_config_cmd),
test_bit(STATUS_EXIT_PENDING, &priv->status) <<
STATUS_EXIT_PENDING;
- trans_stop_device(priv);
+ trans_stop_device(&priv->trans);
dev_kfree_skb(priv->beacon_skb);
priv->beacon_skb = NULL;
case IEEE80211_AMPDU_TX_OPERATIONAL:
buf_size = min_t(int, buf_size, LINK_QUAL_AGG_FRAME_LIMIT_DEF);
- trans_txq_agg_setup(priv, iwl_sta_id(sta), tid, buf_size);
+ trans_txq_agg_setup(&priv->trans, iwl_sta_id(sta), tid,
+ buf_size);
/*
* If the limit is 0, then it wasn't initialised yet,
priv->cfg = cfg;
priv->inta_mask = CSR_INI_SET_MASK;
- err = iwl_trans_register(priv);
+ err = iwl_trans_register(&priv->trans, priv);
if (err)
goto out_free_priv;
IWL_INFO(priv, "Detected %s, REV=0x%X\n",
priv->cfg->name, hw_rev);
- if (trans_prepare_card_hw(priv)) {
+ if (trans_prepare_card_hw(&priv->trans)) {
err = -EIO;
IWL_WARN(priv, "Failed, HW not ready\n");
goto out_free_traffic_mem;
iwl_eeprom_free(priv);
out_free_traffic_mem:
iwl_free_traffic_mem(priv);
- trans_free(priv);
+ trans_free(&priv->trans);
out_free_priv:
ieee80211_free_hw(priv->hw);
out:
iwl_disable_interrupts(priv);
spin_unlock_irqrestore(&priv->lock, flags);
- trans_sync_irq(priv);
+ trans_sync_irq(&priv->trans);
iwl_dealloc_ucode(priv);
- trans_rx_free(priv);
- trans_tx_free(priv);
+ trans_rx_free(&priv->trans);
+ trans_tx_free(&priv->trans);
iwl_eeprom_free(priv);
priv->workqueue = NULL;
iwl_free_traffic_mem(priv);
- trans_free(priv);
+ trans_free(&priv->trans);
priv->bus.ops->set_drv_data(&priv->bus, NULL);
le32_to_cpu(ctx->timing.beacon_init_val),
le16_to_cpu(ctx->timing.atim_window));
- return trans_send_cmd_pdu(priv, ctx->rxon_timing_cmd,
+ return trans_send_cmd_pdu(&priv->trans, ctx->rxon_timing_cmd,
CMD_SYNC, sizeof(ctx->timing), &ctx->timing);
}
IWL_DEBUG_INFO(priv, "BT coex %s\n",
(bt_cmd.flags == BT_COEX_DISABLE) ? "disable" : "active");
- if (trans_send_cmd_pdu(priv, REPLY_BT_CONFIG,
+ if (trans_send_cmd_pdu(&priv->trans, REPLY_BT_CONFIG,
CMD_SYNC, sizeof(struct iwl_bt_cmd), &bt_cmd))
IWL_ERR(priv, "failed to send BT Coex Config\n");
}
};
if (flags & CMD_ASYNC)
- return trans_send_cmd_pdu(priv, REPLY_STATISTICS_CMD,
+ return trans_send_cmd_pdu(&priv->trans, REPLY_STATISTICS_CMD,
CMD_ASYNC,
sizeof(struct iwl_statistics_cmd),
&statistics_cmd);
else
- return trans_send_cmd_pdu(priv, REPLY_STATISTICS_CMD,
+ return trans_send_cmd_pdu(&priv->trans, REPLY_STATISTICS_CMD,
CMD_SYNC,
sizeof(struct iwl_statistics_cmd),
&statistics_cmd);
#include "iwl-power.h"
#include "iwl-agn-rs.h"
#include "iwl-agn-tt.h"
+#include "iwl-trans.h"
#define DRV_NAME "iwlagn"
unsigned int irq;
};
-struct iwl_trans;
-
-/**
- * struct iwl_trans_ops - transport specific operations
- * @start_device: allocates and inits all the resources for the transport
- * layer.
- * @prepare_card_hw: claim the ownership on the HW. Will be called during
- * probe.
- * @tx_start: starts and configures all the Tx fifo - usually done once the fw
- * is alive.
- * @stop_device:stops the whole device (embedded CPU put to reset)
- * @rx_free: frees the rx memory
- * @tx_free: frees the tx memory
- * @send_cmd:send a host command
- * @send_cmd_pdu:send a host command: flags can be CMD_*
- * @get_tx_cmd: returns a pointer to a new Tx cmd for the upper layer use
- * @tx: send an skb
- * @txq_agg_setup: setup a tx queue for AMPDU - will be called once the HW is
- * ready and a successful ADDBA response has been received.
- * @txq_agg_disable: de-configure a Tx queue to send AMPDUs
- * @kick_nic: remove the RESET from the embedded CPU and let it run
- * @sync_irq: the upper layer will typically disable interrupt and call this
- * handler. After this handler returns, it is guaranteed that all
- * the ISR / tasklet etc... have finished running and the transport
- * layer shall not pass any Rx.
- * @free: release all the ressource for the transport layer itself such as
- * irq, tasklet etc...
- */
-struct iwl_trans_ops {
-
- int (*start_device)(struct iwl_priv *priv);
- int (*prepare_card_hw)(struct iwl_priv *priv);
- void (*stop_device)(struct iwl_priv *priv);
- void (*tx_start)(struct iwl_priv *priv);
- void (*tx_free)(struct iwl_priv *priv);
- void (*rx_free)(struct iwl_priv *priv);
-
- int (*send_cmd)(struct iwl_priv *priv, struct iwl_host_cmd *cmd);
-
- int (*send_cmd_pdu)(struct iwl_priv *priv, u8 id, u32 flags, u16 len,
- const void *data);
- struct iwl_tx_cmd * (*get_tx_cmd)(struct iwl_priv *priv, int txq_id);
- int (*tx)(struct iwl_priv *priv, struct sk_buff *skb,
- struct iwl_tx_cmd *tx_cmd, int txq_id, __le16 fc, bool ampdu,
- struct iwl_rxon_context *ctx);
-
- int (*txq_agg_disable)(struct iwl_priv *priv, u16 txq_id,
- u16 ssn_idx, u8 tx_fifo);
- void (*txq_agg_setup)(struct iwl_priv *priv, int sta_id, int tid,
- int frame_limit);
-
- void (*kick_nic)(struct iwl_priv *priv);
-
- void (*sync_irq)(struct iwl_priv *priv);
- void (*free)(struct iwl_priv *priv);
-};
-
-struct iwl_trans {
- const struct iwl_trans_ops *ops;
-};
-
/* uCode ownership */
#define IWL_OWNERSHIP_DRIVER 0
#define IWL_OWNERSHIP_TM 1
if (reg != (reg & CSR_LED_BSM_CTRL_MSK))
iwl_write32(priv, CSR_LED_REG, reg & CSR_LED_BSM_CTRL_MSK);
- return trans_send_cmd(priv, &cmd);
+ return trans_send_cmd(&priv->trans, &cmd);
}
/* Set led pattern command */
le32_to_cpu(cmd->sleep_interval[3]),
le32_to_cpu(cmd->sleep_interval[4]));
- return trans_send_cmd_pdu(priv, POWER_TABLE_CMD, CMD_SYNC,
+ return trans_send_cmd_pdu(&priv->trans, POWER_TABLE_CMD, CMD_SYNC,
sizeof(struct iwl_powertable_cmd), cmd);
}
test_bit(STATUS_EXIT_PENDING, &priv->status))
return -EIO;
- ret = trans_send_cmd(priv, &cmd);
+ ret = trans_send_cmd(&priv->trans, &cmd);
if (ret)
return ret;
}
cmd.len[0] = iwlagn_build_addsta_hcmd(sta, data);
- ret = trans_send_cmd(priv, &cmd);
+ ret = trans_send_cmd(&priv->trans, &cmd);
if (ret || (flags & CMD_ASYNC))
return ret;
cmd.flags |= CMD_WANT_SKB;
- ret = trans_send_cmd(priv, &cmd);
+ ret = trans_send_cmd(&priv->trans, &cmd);
if (ret)
return ret;
return -EINVAL;
if (is_lq_table_valid(priv, ctx, lq))
- ret = trans_send_cmd(priv, &cmd);
+ ret = trans_send_cmd(&priv->trans, &cmd);
else
ret = -EINVAL;
IWL_INFO(priv, "testmode ucode command ID 0x%x, flags 0x%x,"
" len %d\n", cmd.id, cmd.flags, cmd.len[0]);
/* ok, let's submit the command to ucode */
- return trans_send_cmd(priv, &cmd);
+ return trans_send_cmd(&priv->trans, &cmd);
}
case IWL_TM_CMD_APP2DEV_CFG_INIT_CALIB:
iwl_testmode_cfg_init_calib(priv);
- trans_stop_device(priv);
+ trans_stop_device(&priv->trans);
break;
case IWL_TM_CMD_APP2DEV_LOAD_RUNTIME_FW:
return 0;
error:
- trans_tx_free(priv);
+ trans_tx_free(&priv->trans);
return ret;
}
error:
/*Upon error, free only if we allocated something */
if (alloc)
- trans_tx_free(priv);
+ trans_tx_free(&priv->trans);
return ret;
}
spin_lock_irqsave(&priv->lock, flags);
iwl_disable_interrupts(priv);
spin_unlock_irqrestore(&priv->lock, flags);
- trans_sync_irq(priv);
+ trans_sync_irq(&priv->trans);
/* device going down, Stop using ICT table */
iwl_disable_ict(priv);
.free = iwl_trans_free,
};
-int iwl_trans_register(struct iwl_priv *priv)
+int iwl_trans_register(struct iwl_trans *trans, struct iwl_priv *priv)
{
int err;
priv->trans.ops = &trans_ops;
+ priv->trans.priv = priv;
iwl_alloc_isr_ict(priv);
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*****************************************************************************/
+#ifndef __iwl_trans_h__
+#define __iwl_trans_h__
/*This file includes the declaration that are exported from the transport
* layer */
-static inline int trans_start_device(struct iwl_priv *priv)
+struct iwl_priv;
+struct iwl_rxon_context;
+struct iwl_host_cmd;
+
+/**
+ * struct iwl_trans_ops - transport specific operations
+ * @start_device: allocates and inits all the resources for the transport
+ * layer.
+ * @prepare_card_hw: claim the ownership on the HW. Will be called during
+ * probe.
+ * @tx_start: starts and configures all the Tx fifo - usually done once the fw
+ * is alive.
+ * @stop_device:stops the whole device (embedded CPU put to reset)
+ * @rx_free: frees the rx memory
+ * @tx_free: frees the tx memory
+ * @send_cmd:send a host command
+ * @send_cmd_pdu:send a host command: flags can be CMD_*
+ * @get_tx_cmd: returns a pointer to a new Tx cmd for the upper layer use
+ * @tx: send an skb
+ * @txq_agg_setup: setup a tx queue for AMPDU - will be called once the HW is
+ * ready and a successful ADDBA response has been received.
+ * @txq_agg_disable: de-configure a Tx queue to send AMPDUs
+ * @kick_nic: remove the RESET from the embedded CPU and let it run
+ * @sync_irq: the upper layer will typically disable interrupt and call this
+ * handler. After this handler returns, it is guaranteed that all
+ * the ISR / tasklet etc... have finished running and the transport
+ * layer shall not pass any Rx.
+ * @free: release all the ressource for the transport layer itself such as
+ * irq, tasklet etc...
+ */
+struct iwl_trans_ops {
+
+ int (*start_device)(struct iwl_priv *priv);
+ int (*prepare_card_hw)(struct iwl_priv *priv);
+ void (*stop_device)(struct iwl_priv *priv);
+ void (*tx_start)(struct iwl_priv *priv);
+ void (*tx_free)(struct iwl_priv *priv);
+ void (*rx_free)(struct iwl_priv *priv);
+
+ int (*send_cmd)(struct iwl_priv *priv, struct iwl_host_cmd *cmd);
+
+ int (*send_cmd_pdu)(struct iwl_priv *priv, u8 id, u32 flags, u16 len,
+ const void *data);
+ struct iwl_tx_cmd * (*get_tx_cmd)(struct iwl_priv *priv, int txq_id);
+ int (*tx)(struct iwl_priv *priv, struct sk_buff *skb,
+ struct iwl_tx_cmd *tx_cmd, int txq_id, __le16 fc, bool ampdu,
+ struct iwl_rxon_context *ctx);
+
+ int (*txq_agg_disable)(struct iwl_priv *priv, u16 txq_id,
+ u16 ssn_idx, u8 tx_fifo);
+ void (*txq_agg_setup)(struct iwl_priv *priv, int sta_id, int tid,
+ int frame_limit);
+
+ void (*kick_nic)(struct iwl_priv *priv);
+
+ void (*sync_irq)(struct iwl_priv *priv);
+ void (*free)(struct iwl_priv *priv);
+};
+
+struct iwl_trans {
+ const struct iwl_trans_ops *ops;
+ struct iwl_priv *priv;
+};
+
+static inline int trans_start_device(struct iwl_trans *trans)
{
- return priv->trans.ops->start_device(priv);
+ return trans->ops->start_device(trans->priv);
}
-static inline int trans_prepare_card_hw(struct iwl_priv *priv)
+static inline int trans_prepare_card_hw(struct iwl_trans *trans)
{
- return priv->trans.ops->prepare_card_hw(priv);
+ return trans->ops->prepare_card_hw(trans->priv);
}
-static inline void trans_stop_device(struct iwl_priv *priv)
+static inline void trans_stop_device(struct iwl_trans *trans)
{
- priv->trans.ops->stop_device(priv);
+ trans->ops->stop_device(trans->priv);
}
-static inline void trans_tx_start(struct iwl_priv *priv)
+static inline void trans_tx_start(struct iwl_trans *trans)
{
- priv->trans.ops->tx_start(priv);
+ trans->ops->tx_start(trans->priv);
}
-static inline void trans_rx_free(struct iwl_priv *priv)
+static inline void trans_rx_free(struct iwl_trans *trans)
{
- priv->trans.ops->rx_free(priv);
+ trans->ops->rx_free(trans->priv);
}
-static inline void trans_tx_free(struct iwl_priv *priv)
+static inline void trans_tx_free(struct iwl_trans *trans)
{
- priv->trans.ops->tx_free(priv);
+ trans->ops->tx_free(trans->priv);
}
-static inline int trans_send_cmd(struct iwl_priv *priv,
+static inline int trans_send_cmd(struct iwl_trans *trans,
struct iwl_host_cmd *cmd)
{
- return priv->trans.ops->send_cmd(priv, cmd);
+ return trans->ops->send_cmd(trans->priv, cmd);
}
-static inline int trans_send_cmd_pdu(struct iwl_priv *priv, u8 id, u32 flags,
+static inline int trans_send_cmd_pdu(struct iwl_trans *trans, u8 id, u32 flags,
u16 len, const void *data)
{
- return priv->trans.ops->send_cmd_pdu(priv, id, flags, len, data);
+ return trans->ops->send_cmd_pdu(trans->priv, id, flags, len, data);
}
-static inline struct iwl_tx_cmd *trans_get_tx_cmd(struct iwl_priv *priv,
+static inline struct iwl_tx_cmd *trans_get_tx_cmd(struct iwl_trans *trans,
int txq_id)
{
- return priv->trans.ops->get_tx_cmd(priv, txq_id);
+ return trans->ops->get_tx_cmd(trans->priv, txq_id);
}
-static inline int trans_tx(struct iwl_priv *priv, struct sk_buff *skb,
+static inline int trans_tx(struct iwl_trans *trans, struct sk_buff *skb,
struct iwl_tx_cmd *tx_cmd, int txq_id, __le16 fc, bool ampdu,
struct iwl_rxon_context *ctx)
{
- return priv->trans.ops->tx(priv, skb, tx_cmd, txq_id, fc, ampdu, ctx);
+ return trans->ops->tx(trans->priv, skb, tx_cmd, txq_id, fc, ampdu, ctx);
}
-static inline int trans_txq_agg_disable(struct iwl_priv *priv, u16 txq_id,
+static inline int trans_txq_agg_disable(struct iwl_trans *trans, u16 txq_id,
u16 ssn_idx, u8 tx_fifo)
{
- return priv->trans.ops->txq_agg_disable(priv, txq_id, ssn_idx, tx_fifo);
+ return trans->ops->txq_agg_disable(trans->priv, txq_id,
+ ssn_idx, tx_fifo);
}
-static inline void trans_txq_agg_setup(struct iwl_priv *priv, int sta_id,
+static inline void trans_txq_agg_setup(struct iwl_trans *trans, int sta_id,
int tid, int frame_limit)
{
- priv->trans.ops->txq_agg_setup(priv, sta_id, tid, frame_limit);
+ trans->ops->txq_agg_setup(trans->priv, sta_id, tid, frame_limit);
}
-static inline void trans_kick_nic(struct iwl_priv *priv)
+static inline void trans_kick_nic(struct iwl_trans *trans)
{
- priv->trans.ops->kick_nic(priv);
+ trans->ops->kick_nic(trans->priv);
}
-static inline void trans_sync_irq(struct iwl_priv *priv)
+static inline void trans_sync_irq(struct iwl_trans *trans)
{
- priv->trans.ops->sync_irq(priv);
+ trans->ops->sync_irq(trans->priv);
}
-static inline void trans_free(struct iwl_priv *priv)
+static inline void trans_free(struct iwl_trans *trans)
{
- priv->trans.ops->free(priv);
+ trans->ops->free(trans->priv);
}
-int iwl_trans_register(struct iwl_priv *priv);
+int iwl_trans_register(struct iwl_trans *trans, struct iwl_priv *priv);
/*TODO: this functions should NOT be exported from trans module - export it
* until the reclaim flow will be brought to the transport module too */
+
+struct iwl_tx_queue;
void iwlagn_txq_inval_byte_cnt_tbl(struct iwl_priv *priv,
struct iwl_tx_queue *txq);
+
+#endif /* __iwl_trans_h__ */