#include <linux/export.h>
#include <linux/firmware.h>
#include <linux/etherdevice.h>
#include <asm/div64.h>
#include <net/mac80211.h>
#include "p54.h"
#include "lmac.h"
#ifdef P54_MM_DEBUG
static void p54_dump_tx_queue(struct p54_common *priv)
{
unsigned long flags;
struct ieee80211_tx_info *info;
struct p54_tx_info *range;
struct sk_buff *skb;
struct p54_hdr *hdr;
unsigned int i = 0;
u32 prev_addr;
u32 largest_hole = 0, free;
spin_lock_irqsave(&priv->tx_queue.lock, flags);
wiphy_debug(priv->hw->wiphy, "/ --- tx queue dump (%d entries) ---\n",
skb_queue_len(&priv->tx_queue));
prev_addr = priv->rx_start;
skb_queue_walk(&priv->tx_queue, skb) {
info = IEEE80211_SKB_CB(skb);
range = (void *) info->rate_driver_data;
hdr = (void *) skb->data;
free = range->start_addr - prev_addr;
wiphy_debug(priv->hw->wiphy,
"| [%02d] => [skb:%p skb_len:0x%04x "
"hdr:{flags:%02x len:%04x req_id:%04x type:%02x} "
"mem:{start:%04x end:%04x, free:%d}]\n",
i++, skb, skb->len,
le16_to_cpu(hdr->flags), le16_to_cpu(hdr->len),
le32_to_cpu(hdr->req_id), le16_to_cpu(hdr->type),
range->start_addr, range->end_addr, free);
prev_addr = range->end_addr;
largest_hole = max(largest_hole, free);
}
free = priv->rx_end - prev_addr;
largest_hole = max(largest_hole, free);
wiphy_debug(priv->hw->wiphy,
"\\ --- [free: %d], largest free block: %d ---\n",
free, largest_hole);
spin_unlock_irqrestore(&priv->tx_queue.lock, flags);
}
#endif
static int p54_assign_address(struct p54_common *priv, struct sk_buff *skb)
{ … }
static void p54_tx_pending(struct p54_common *priv)
{ … }
static void p54_wake_queues(struct p54_common *priv)
{ … }
static int p54_tx_qos_accounting_alloc(struct p54_common *priv,
struct sk_buff *skb,
const u16 p54_queue)
{ … }
static void p54_tx_qos_accounting_free(struct p54_common *priv,
struct sk_buff *skb)
{ … }
void p54_free_skb(struct ieee80211_hw *dev, struct sk_buff *skb)
{ … }
EXPORT_SYMBOL_GPL(…);
static struct sk_buff *p54_find_and_unlink_skb(struct p54_common *priv,
const __le32 req_id)
{ … }
void p54_tx(struct p54_common *priv, struct sk_buff *skb)
{ … }
static int p54_rssi_to_dbm(struct p54_common *priv, int rssi)
{ … }
static void p54_pspoll_workaround(struct p54_common *priv, struct sk_buff *skb)
{ … }
static int p54_rx_data(struct p54_common *priv, struct sk_buff *skb)
{ … }
static void p54_rx_frame_sent(struct p54_common *priv, struct sk_buff *skb)
{ … }
static void p54_rx_eeprom_readback(struct p54_common *priv,
struct sk_buff *skb)
{ … }
static void p54_rx_stats(struct p54_common *priv, struct sk_buff *skb)
{ … }
static void p54_rx_trap(struct p54_common *priv, struct sk_buff *skb)
{ … }
static int p54_rx_control(struct p54_common *priv, struct sk_buff *skb)
{ … }
int p54_rx(struct ieee80211_hw *dev, struct sk_buff *skb)
{ … }
EXPORT_SYMBOL_GPL(…);
static void p54_tx_80211_header(struct p54_common *priv, struct sk_buff *skb,
struct ieee80211_tx_info *info,
struct ieee80211_sta *sta,
u8 *queue, u32 *extra_len, u16 *flags, u16 *aid,
bool *burst_possible)
{ … }
static u8 p54_convert_algo(u32 cipher)
{ … }
void p54_tx_80211(struct ieee80211_hw *dev,
struct ieee80211_tx_control *control,
struct sk_buff *skb)
{ … }