iwlwifi: handle shared memory Rx index access
[deliverable/linux.git] / drivers / net / wireless / iwlwifi / iwl-5000.c
index feffcafe1495f7cd84af4cf7c39da7ea9fa46e91..d6b91f7e0b1b25262db60c025fb543b2cbbadfa4 100644 (file)
@@ -362,6 +362,8 @@ static int iwl5000_alloc_shared_mem(struct iwl_priv *priv)
 
        memset(priv->shared_virt, 0, sizeof(struct iwl5000_shared));
 
+       priv->rb_closed_offset = offsetof(struct iwl5000_shared, rb_closed);
+
        return 0;
 }
 
@@ -374,6 +376,12 @@ static void iwl5000_free_shared_mem(struct iwl_priv *priv)
                                    priv->shared_phys);
 }
 
+static int iwl5000_shared_mem_rx_idx(struct iwl_priv *priv)
+{
+       struct iwl5000_shared *s = priv->shared_virt;
+       return le32_to_cpu(s->rb_closed) & 0xFFF;
+}
+
 /**
  * iwl5000_txq_update_byte_cnt_tbl - Set up entry in Tx byte-count array
  */
@@ -466,6 +474,7 @@ static struct iwl_lib_ops iwl5000_lib = {
        .set_hw_params = iwl5000_hw_set_hw_params,
        .alloc_shared_mem = iwl5000_alloc_shared_mem,
        .free_shared_mem = iwl5000_free_shared_mem,
+       .shared_mem_rx_idx = iwl5000_shared_mem_rx_idx,
        .txq_update_byte_cnt_tbl = iwl5000_txq_update_byte_cnt_tbl,
        .disable_tx_fifo = iwl5000_disable_tx_fifo,
        .apm_ops = {
This page took 0.025871 seconds and 5 git commands to generate.