Commit 07874db4 authored by Jérôme Pouiller's avatar Jérôme Pouiller Committed by Greg Kroah-Hartman

staging: wfx: prefix structs tx_policy and hwbus_ops with wfx_

All the types related to a driver should use the same prefix.
Signed-off-by: default avatarJérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20220113085524.1110708-20-Jerome.Pouiller@silabs.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 9d3586fe
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
#define WFX_REG_SET_GEN_R_W 0x6 #define WFX_REG_SET_GEN_R_W 0x6
#define WFX_REG_FRAME_OUT 0x7 #define WFX_REG_FRAME_OUT 0x7
struct hwbus_ops { struct wfx_hwbus_ops {
int (*copy_from_io)(void *bus_priv, unsigned int addr, int (*copy_from_io)(void *bus_priv, unsigned int addr,
void *dst, size_t count); void *dst, size_t count);
int (*copy_to_io)(void *bus_priv, unsigned int addr, int (*copy_to_io)(void *bus_priv, unsigned int addr,
......
...@@ -159,7 +159,7 @@ static size_t wfx_sdio_align_size(void *priv, size_t size) ...@@ -159,7 +159,7 @@ static size_t wfx_sdio_align_size(void *priv, size_t size)
return sdio_align_size(bus->func, size); return sdio_align_size(bus->func, size);
} }
static const struct hwbus_ops wfx_sdio_hwbus_ops = { static const struct wfx_hwbus_ops wfx_sdio_hwbus_ops = {
.copy_from_io = wfx_sdio_copy_from_io, .copy_from_io = wfx_sdio_copy_from_io,
.copy_to_io = wfx_sdio_copy_to_io, .copy_to_io = wfx_sdio_copy_to_io,
.irq_subscribe = wfx_sdio_irq_subscribe, .irq_subscribe = wfx_sdio_irq_subscribe,
......
...@@ -168,7 +168,7 @@ static size_t wfx_spi_align_size(void *priv, size_t size) ...@@ -168,7 +168,7 @@ static size_t wfx_spi_align_size(void *priv, size_t size)
return ALIGN(size, 4); return ALIGN(size, 4);
} }
static const struct hwbus_ops wfx_spi_hwbus_ops = { static const struct wfx_hwbus_ops wfx_spi_hwbus_ops = {
.copy_from_io = wfx_spi_copy_from_io, .copy_from_io = wfx_spi_copy_from_io,
.copy_to_io = wfx_spi_copy_to_io, .copy_to_io = wfx_spi_copy_to_io,
.irq_subscribe = wfx_spi_irq_subscribe, .irq_subscribe = wfx_spi_irq_subscribe,
......
...@@ -44,7 +44,7 @@ static int wfx_get_hw_rate(struct wfx_dev *wdev, ...@@ -44,7 +44,7 @@ static int wfx_get_hw_rate(struct wfx_dev *wdev,
/* TX policy cache implementation */ /* TX policy cache implementation */
static void wfx_tx_policy_build(struct wfx_vif *wvif, struct tx_policy *policy, static void wfx_tx_policy_build(struct wfx_vif *wvif, struct wfx_tx_policy *policy,
struct ieee80211_tx_rate *rates) struct ieee80211_tx_rate *rates)
{ {
struct wfx_dev *wdev = wvif->wdev; struct wfx_dev *wdev = wvif->wdev;
...@@ -66,16 +66,16 @@ static void wfx_tx_policy_build(struct wfx_vif *wvif, struct tx_policy *policy, ...@@ -66,16 +66,16 @@ static void wfx_tx_policy_build(struct wfx_vif *wvif, struct tx_policy *policy,
} }
} }
static bool wfx_tx_policy_is_equal(const struct tx_policy *a, static bool wfx_tx_policy_is_equal(const struct wfx_tx_policy *a,
const struct tx_policy *b) const struct wfx_tx_policy *b)
{ {
return !memcmp(a->rates, b->rates, sizeof(a->rates)); return !memcmp(a->rates, b->rates, sizeof(a->rates));
} }
static int wfx_tx_policy_find(struct tx_policy_cache *cache, static int wfx_tx_policy_find(struct wfx_tx_policy_cache *cache,
struct tx_policy *wanted) struct wfx_tx_policy *wanted)
{ {
struct tx_policy *it; struct wfx_tx_policy *it;
list_for_each_entry(it, &cache->used, link) list_for_each_entry(it, &cache->used, link)
if (wfx_tx_policy_is_equal(wanted, it)) if (wfx_tx_policy_is_equal(wanted, it))
...@@ -86,15 +86,15 @@ static int wfx_tx_policy_find(struct tx_policy_cache *cache, ...@@ -86,15 +86,15 @@ static int wfx_tx_policy_find(struct tx_policy_cache *cache,
return -1; return -1;
} }
static void wfx_tx_policy_use(struct tx_policy_cache *cache, static void wfx_tx_policy_use(struct wfx_tx_policy_cache *cache,
struct tx_policy *entry) struct wfx_tx_policy *entry)
{ {
++entry->usage_count; ++entry->usage_count;
list_move(&entry->link, &cache->used); list_move(&entry->link, &cache->used);
} }
static int wfx_tx_policy_release(struct tx_policy_cache *cache, static int wfx_tx_policy_release(struct wfx_tx_policy_cache *cache,
struct tx_policy *entry) struct wfx_tx_policy *entry)
{ {
int ret = --entry->usage_count; int ret = --entry->usage_count;
...@@ -107,9 +107,9 @@ static int wfx_tx_policy_get(struct wfx_vif *wvif, ...@@ -107,9 +107,9 @@ static int wfx_tx_policy_get(struct wfx_vif *wvif,
struct ieee80211_tx_rate *rates, bool *renew) struct ieee80211_tx_rate *rates, bool *renew)
{ {
int idx; int idx;
struct tx_policy_cache *cache = &wvif->tx_policy_cache; struct wfx_tx_policy_cache *cache = &wvif->tx_policy_cache;
struct tx_policy wanted; struct wfx_tx_policy wanted;
struct tx_policy *entry; struct wfx_tx_policy *entry;
wfx_tx_policy_build(wvif, &wanted, rates); wfx_tx_policy_build(wvif, &wanted, rates);
...@@ -127,7 +127,7 @@ static int wfx_tx_policy_get(struct wfx_vif *wvif, ...@@ -127,7 +127,7 @@ static int wfx_tx_policy_get(struct wfx_vif *wvif,
* entry in "free" list * entry in "free" list
*/ */
*renew = true; *renew = true;
entry = list_entry(cache->free.prev, struct tx_policy, link); entry = list_entry(cache->free.prev, struct wfx_tx_policy, link);
memcpy(entry->rates, wanted.rates, sizeof(entry->rates)); memcpy(entry->rates, wanted.rates, sizeof(entry->rates));
entry->uploaded = false; entry->uploaded = false;
entry->usage_count = 0; entry->usage_count = 0;
...@@ -143,7 +143,7 @@ static int wfx_tx_policy_get(struct wfx_vif *wvif, ...@@ -143,7 +143,7 @@ static int wfx_tx_policy_get(struct wfx_vif *wvif,
static void wfx_tx_policy_put(struct wfx_vif *wvif, int idx) static void wfx_tx_policy_put(struct wfx_vif *wvif, int idx)
{ {
int usage, locked; int usage, locked;
struct tx_policy_cache *cache = &wvif->tx_policy_cache; struct wfx_tx_policy_cache *cache = &wvif->tx_policy_cache;
if (idx == HIF_TX_RETRY_POLICY_INVALID) if (idx == HIF_TX_RETRY_POLICY_INVALID)
return; return;
...@@ -157,7 +157,7 @@ static void wfx_tx_policy_put(struct wfx_vif *wvif, int idx) ...@@ -157,7 +157,7 @@ static void wfx_tx_policy_put(struct wfx_vif *wvif, int idx)
static int wfx_tx_policy_upload(struct wfx_vif *wvif) static int wfx_tx_policy_upload(struct wfx_vif *wvif)
{ {
struct tx_policy *policies = wvif->tx_policy_cache.cache; struct wfx_tx_policy *policies = wvif->tx_policy_cache.cache;
u8 tmp_rates[12]; u8 tmp_rates[12];
int i, is_used; int i, is_used;
...@@ -192,7 +192,7 @@ void wfx_tx_policy_upload_work(struct work_struct *work) ...@@ -192,7 +192,7 @@ void wfx_tx_policy_upload_work(struct work_struct *work)
void wfx_tx_policy_init(struct wfx_vif *wvif) void wfx_tx_policy_init(struct wfx_vif *wvif)
{ {
struct tx_policy_cache *cache = &wvif->tx_policy_cache; struct wfx_tx_policy_cache *cache = &wvif->tx_policy_cache;
int i; int i;
memset(cache, 0, sizeof(*cache)); memset(cache, 0, sizeof(*cache));
...@@ -435,8 +435,8 @@ void wfx_tx(struct ieee80211_hw *hw, struct ieee80211_tx_control *control, ...@@ -435,8 +435,8 @@ void wfx_tx(struct ieee80211_hw *hw, struct ieee80211_tx_control *control,
static void wfx_skb_dtor(struct wfx_vif *wvif, struct sk_buff *skb) static void wfx_skb_dtor(struct wfx_vif *wvif, struct sk_buff *skb)
{ {
struct wfx_hif_msg *hif = (struct hif_msg *)skb->data; struct wfx_hif_msg *hif = (struct wfx_hif_msg *)skb->data;
struct wfx_hif_req_tx *req = (struct hif_req_tx *)hif->body; struct wfx_hif_req_tx *req = (struct wfx_hif_req_tx *)hif->body;
unsigned int offset = sizeof(struct wfx_hif_msg) + unsigned int offset = sizeof(struct wfx_hif_msg) +
sizeof(struct wfx_hif_req_tx) + sizeof(struct wfx_hif_req_tx) +
req->fc_offset; req->fc_offset;
......
...@@ -18,15 +18,15 @@ struct wfx_tx_priv; ...@@ -18,15 +18,15 @@ struct wfx_tx_priv;
struct wfx_dev; struct wfx_dev;
struct wfx_vif; struct wfx_vif;
struct tx_policy { struct wfx_tx_policy {
struct list_head link; struct list_head link;
int usage_count; int usage_count;
u8 rates[12]; u8 rates[12];
bool uploaded; bool uploaded;
}; };
struct tx_policy_cache { struct wfx_tx_policy_cache {
struct tx_policy cache[HIF_TX_RETRY_POLICY_MAX]; struct wfx_tx_policy cache[HIF_TX_RETRY_POLICY_MAX];
/* FIXME: use a trees and drop hash from tx_policy */ /* FIXME: use a trees and drop hash from tx_policy */
struct list_head used; struct list_head used;
struct list_head free; struct list_head free;
...@@ -59,8 +59,8 @@ static inline struct wfx_tx_priv *wfx_skb_tx_priv(struct sk_buff *skb) ...@@ -59,8 +59,8 @@ static inline struct wfx_tx_priv *wfx_skb_tx_priv(struct sk_buff *skb)
static inline struct wfx_hif_req_tx *wfx_skb_txreq(struct sk_buff *skb) static inline struct wfx_hif_req_tx *wfx_skb_txreq(struct sk_buff *skb)
{ {
struct wfx_hif_msg *hif = (struct hif_msg *)skb->data; struct wfx_hif_msg *hif = (struct wfx_hif_msg *)skb->data;
struct wfx_hif_req_tx *req = (struct hif_req_tx *)hif->body; struct wfx_hif_req_tx *req = (struct wfx_hif_req_tx *)hif->body;
return req; return req;
} }
......
...@@ -110,7 +110,7 @@ static int wfx_hif_receive_indication(struct wfx_dev *wdev, ...@@ -110,7 +110,7 @@ static int wfx_hif_receive_indication(struct wfx_dev *wdev,
__func__, hif->interface); __func__, hif->interface);
return -EIO; return -EIO;
} }
skb_pull(skb, sizeof(struct wfx_hif_msg) + sizeof(struct hif_ind_rx)); skb_pull(skb, sizeof(struct wfx_hif_msg) + sizeof(struct wfx_hif_ind_rx));
wfx_rx_cb(wvif, body, skb); wfx_rx_cb(wvif, body, skb);
return 0; return 0;
...@@ -380,7 +380,7 @@ static const struct { ...@@ -380,7 +380,7 @@ static const struct {
void wfx_handle_rx(struct wfx_dev *wdev, struct sk_buff *skb) void wfx_handle_rx(struct wfx_dev *wdev, struct sk_buff *skb)
{ {
int i; int i;
const struct wfx_hif_msg *hif = (const struct hif_msg *)skb->data; const struct wfx_hif_msg *hif = (const struct wfx_hif_msg *)skb->data;
int hif_id = hif->id; int hif_id = hif->id;
if (hif_id == HIF_IND_ID_RX) { if (hif_id == HIF_IND_ID_RX) {
......
...@@ -262,7 +262,7 @@ static void wfx_free_common(void *data) ...@@ -262,7 +262,7 @@ static void wfx_free_common(void *data)
struct wfx_dev *wfx_init_common(struct device *dev, struct wfx_dev *wfx_init_common(struct device *dev,
const struct wfx_platform_data *pdata, const struct wfx_platform_data *pdata,
const struct hwbus_ops *hwbus_ops, const struct wfx_hwbus_ops *hwbus_ops,
void *hwbus_priv) void *hwbus_priv)
{ {
struct ieee80211_hw *hw; struct ieee80211_hw *hw;
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
#include "hif_api_general.h" #include "hif_api_general.h"
struct wfx_dev; struct wfx_dev;
struct hwbus_ops; struct wfx_hwbus_ops;
struct wfx_platform_data { struct wfx_platform_data {
/* Keyset and ".sec" extension will be appended to this string */ /* Keyset and ".sec" extension will be appended to this string */
...@@ -31,7 +31,7 @@ struct wfx_platform_data { ...@@ -31,7 +31,7 @@ struct wfx_platform_data {
struct wfx_dev *wfx_init_common(struct device *dev, struct wfx_dev *wfx_init_common(struct device *dev,
const struct wfx_platform_data *pdata, const struct wfx_platform_data *pdata,
const struct hwbus_ops *hwbus_ops, const struct wfx_hwbus_ops *hwbus_ops,
void *hwbus_priv); void *hwbus_priv);
int wfx_probe(struct wfx_dev *wdev); int wfx_probe(struct wfx_dev *wdev);
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
#define USEC_PER_TXOP 32 /* see struct ieee80211_tx_queue_params */ #define USEC_PER_TXOP 32 /* see struct ieee80211_tx_queue_params */
#define USEC_PER_TU 1024 #define USEC_PER_TU 1024
struct hwbus_ops; struct wfx_hwbus_ops;
struct wfx_dev { struct wfx_dev {
struct wfx_platform_data pdata; struct wfx_platform_data pdata;
...@@ -33,7 +33,7 @@ struct wfx_dev { ...@@ -33,7 +33,7 @@ struct wfx_dev {
struct ieee80211_hw *hw; struct ieee80211_hw *hw;
struct ieee80211_vif *vif[2]; struct ieee80211_vif *vif[2];
struct mac_address addresses[2]; struct mac_address addresses[2];
const struct hwbus_ops *hwbus_ops; const struct wfx_hwbus_ops *hwbus_ops;
void *hwbus_priv; void *hwbus_priv;
u8 keyset; u8 keyset;
...@@ -74,7 +74,7 @@ struct wfx_vif { ...@@ -74,7 +74,7 @@ struct wfx_vif {
struct delayed_work beacon_loss_work; struct delayed_work beacon_loss_work;
struct wfx_queue tx_queue[4]; struct wfx_queue tx_queue[4];
struct tx_policy_cache tx_policy_cache; struct wfx_tx_policy_cache tx_policy_cache;
struct work_struct tx_policy_upload_work; struct work_struct tx_policy_upload_work;
struct work_struct update_tim_work; struct work_struct update_tim_work;
......
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