~ubuntu-branches/ubuntu/precise/linux-ti-omap4/precise

« back to all changes in this revision

Viewing changes to drivers/net/wireless/iwlwifi/iwl-helpers.h

  • Committer: Bazaar Package Importer
  • Author(s): Paolo Pisati
  • Date: 2011-06-29 15:23:51 UTC
  • mfrom: (26.1.1 natty-proposed)
  • Revision ID: james.westby@ubuntu.com-20110629152351-xs96tm303d95rpbk
Tags: 3.0.0-1200.2
* Rebased against 3.0.0-6.7
* BSP from TI based on 3.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/******************************************************************************
2
2
 *
3
 
 * Copyright(c) 2003 - 2010 Intel Corporation. All rights reserved.
 
3
 * Copyright(c) 2003 - 2011 Intel Corporation. All rights reserved.
4
4
 *
5
5
 * Portions of this file are derived from the ipw3945 project, as well
6
6
 * as portions of the ieee80211 subsystem header files.
64
64
        return --index & (n_bd - 1);
65
65
}
66
66
 
67
 
/* TODO: Move fw_desc functions to iwl-pci.ko */
68
 
static inline void iwl_free_fw_desc(struct pci_dev *pci_dev,
69
 
                                    struct fw_desc *desc)
70
 
{
71
 
        if (desc->v_addr)
72
 
                dma_free_coherent(&pci_dev->dev, desc->len,
73
 
                                  desc->v_addr, desc->p_addr);
74
 
        desc->v_addr = NULL;
75
 
        desc->len = 0;
76
 
}
77
 
 
78
 
static inline int iwl_alloc_fw_desc(struct pci_dev *pci_dev,
79
 
                                    struct fw_desc *desc)
80
 
{
81
 
        if (!desc->len) {
82
 
                desc->v_addr = NULL;
83
 
                return -EINVAL;
84
 
        }
85
 
 
86
 
        desc->v_addr = dma_alloc_coherent(&pci_dev->dev, desc->len,
87
 
                                          &desc->p_addr, GFP_KERNEL);
88
 
        return (desc->v_addr != NULL) ? 0 : -ENOMEM;
89
 
}
90
 
 
91
67
/*
92
68
 * we have 8 bits used like this:
93
69
 *
131
107
                        ieee80211_stop_queue(priv->hw, ac);
132
108
}
133
109
 
 
110
static inline void iwl_wake_any_queue(struct iwl_priv *priv,
 
111
                                      struct iwl_rxon_context *ctx)
 
112
{
 
113
        u8 ac;
 
114
 
 
115
        for (ac = 0; ac < AC_NUM; ac++) {
 
116
                IWL_DEBUG_INFO(priv, "Queue Status: Q[%d] %s\n",
 
117
                        ac, (atomic_read(&priv->queue_stop_count[ac]) > 0)
 
118
                              ? "stopped" : "awake");
 
119
                iwl_wake_queue(priv, &priv->txq[ctx->ac_to_queue[ac]]);
 
120
        }
 
121
}
 
122
 
134
123
#define ieee80211_stop_queue DO_NOT_USE_ieee80211_stop_queue
135
124
#define ieee80211_wake_queue DO_NOT_USE_ieee80211_wake_queue
136
125