Skip to content

Commit

Permalink
netdevice: safe convert to netdev_priv() #part-4
Browse files Browse the repository at this point in the history
We have some reasons to kill netdev->priv:
1. netdev->priv is equal to netdev_priv().
2. netdev_priv() wraps the calculation of netdev->priv's offset, obviously
   netdev_priv() is more flexible than netdev->priv.
But we cann't kill netdev->priv, because so many drivers reference to it
directly.

This patch is a safe convert for netdev->priv to netdev_priv(netdev).
Since all of the netdev->priv is only for read.
But it is too big to be sent in one mail.
I split it to 4 parts and make every part smaller than 100,000 bytes,
which is max size allowed by vger.

Signed-off-by: Wang Chen <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Wang Chen authored and davem330 committed Nov 13, 2008
1 parent 8f15ea4 commit 524ad0a
Show file tree
Hide file tree
Showing 13 changed files with 153 additions and 153 deletions.
72 changes: 36 additions & 36 deletions drivers/net/wireless/libertas/wext.c
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ static int lbs_get_name(struct net_device *dev, struct iw_request_info *info,
static int lbs_get_freq(struct net_device *dev, struct iw_request_info *info,
struct iw_freq *fwrq, char *extra)
{
struct lbs_private *priv = dev->priv;
struct lbs_private *priv = netdev_priv(dev);
struct chan_freq_power *cfp;

lbs_deb_enter(LBS_DEB_WEXT);
Expand All @@ -189,7 +189,7 @@ static int lbs_get_freq(struct net_device *dev, struct iw_request_info *info,
static int lbs_get_wap(struct net_device *dev, struct iw_request_info *info,
struct sockaddr *awrq, char *extra)
{
struct lbs_private *priv = dev->priv;
struct lbs_private *priv = netdev_priv(dev);

lbs_deb_enter(LBS_DEB_WEXT);

Expand All @@ -207,7 +207,7 @@ static int lbs_get_wap(struct net_device *dev, struct iw_request_info *info,
static int lbs_set_nick(struct net_device *dev, struct iw_request_info *info,
struct iw_point *dwrq, char *extra)
{
struct lbs_private *priv = dev->priv;
struct lbs_private *priv = netdev_priv(dev);

lbs_deb_enter(LBS_DEB_WEXT);

Expand All @@ -231,7 +231,7 @@ static int lbs_set_nick(struct net_device *dev, struct iw_request_info *info,
static int lbs_get_nick(struct net_device *dev, struct iw_request_info *info,
struct iw_point *dwrq, char *extra)
{
struct lbs_private *priv = dev->priv;
struct lbs_private *priv = netdev_priv(dev);

lbs_deb_enter(LBS_DEB_WEXT);

Expand All @@ -248,7 +248,7 @@ static int lbs_get_nick(struct net_device *dev, struct iw_request_info *info,
static int mesh_get_nick(struct net_device *dev, struct iw_request_info *info,
struct iw_point *dwrq, char *extra)
{
struct lbs_private *priv = dev->priv;
struct lbs_private *priv = netdev_priv(dev);

lbs_deb_enter(LBS_DEB_WEXT);

Expand All @@ -273,7 +273,7 @@ static int lbs_set_rts(struct net_device *dev, struct iw_request_info *info,
struct iw_param *vwrq, char *extra)
{
int ret = 0;
struct lbs_private *priv = dev->priv;
struct lbs_private *priv = netdev_priv(dev);
u32 val = vwrq->value;

lbs_deb_enter(LBS_DEB_WEXT);
Expand All @@ -293,7 +293,7 @@ static int lbs_set_rts(struct net_device *dev, struct iw_request_info *info,
static int lbs_get_rts(struct net_device *dev, struct iw_request_info *info,
struct iw_param *vwrq, char *extra)
{
struct lbs_private *priv = dev->priv;
struct lbs_private *priv = netdev_priv(dev);
int ret = 0;
u16 val = 0;

Expand All @@ -315,7 +315,7 @@ static int lbs_get_rts(struct net_device *dev, struct iw_request_info *info,
static int lbs_set_frag(struct net_device *dev, struct iw_request_info *info,
struct iw_param *vwrq, char *extra)
{
struct lbs_private *priv = dev->priv;
struct lbs_private *priv = netdev_priv(dev);
int ret = 0;
u32 val = vwrq->value;

Expand All @@ -336,7 +336,7 @@ static int lbs_set_frag(struct net_device *dev, struct iw_request_info *info,
static int lbs_get_frag(struct net_device *dev, struct iw_request_info *info,
struct iw_param *vwrq, char *extra)
{
struct lbs_private *priv = dev->priv;
struct lbs_private *priv = netdev_priv(dev);
int ret = 0;
u16 val = 0;

Expand All @@ -359,7 +359,7 @@ static int lbs_get_frag(struct net_device *dev, struct iw_request_info *info,
static int lbs_get_mode(struct net_device *dev,
struct iw_request_info *info, u32 * uwrq, char *extra)
{
struct lbs_private *priv = dev->priv;
struct lbs_private *priv = netdev_priv(dev);

lbs_deb_enter(LBS_DEB_WEXT);

Expand All @@ -385,7 +385,7 @@ static int lbs_get_txpow(struct net_device *dev,
struct iw_request_info *info,
struct iw_param *vwrq, char *extra)
{
struct lbs_private *priv = dev->priv;
struct lbs_private *priv = netdev_priv(dev);
s16 curlevel = 0;
int ret = 0;

Expand Down Expand Up @@ -418,7 +418,7 @@ static int lbs_get_txpow(struct net_device *dev,
static int lbs_set_retry(struct net_device *dev, struct iw_request_info *info,
struct iw_param *vwrq, char *extra)
{
struct lbs_private *priv = dev->priv;
struct lbs_private *priv = netdev_priv(dev);
int ret = 0;
u16 slimit = 0, llimit = 0;

Expand Down Expand Up @@ -466,7 +466,7 @@ static int lbs_set_retry(struct net_device *dev, struct iw_request_info *info,
static int lbs_get_retry(struct net_device *dev, struct iw_request_info *info,
struct iw_param *vwrq, char *extra)
{
struct lbs_private *priv = dev->priv;
struct lbs_private *priv = netdev_priv(dev);
int ret = 0;
u16 val = 0;

Expand Down Expand Up @@ -542,7 +542,7 @@ static int lbs_get_range(struct net_device *dev, struct iw_request_info *info,
struct iw_point *dwrq, char *extra)
{
int i, j;
struct lbs_private *priv = dev->priv;
struct lbs_private *priv = netdev_priv(dev);
struct iw_range *range = (struct iw_range *)extra;
struct chan_freq_power *cfp;
u8 rates[MAX_RATES + 1];
Expand Down Expand Up @@ -708,7 +708,7 @@ static int lbs_get_range(struct net_device *dev, struct iw_request_info *info,
static int lbs_set_power(struct net_device *dev, struct iw_request_info *info,
struct iw_param *vwrq, char *extra)
{
struct lbs_private *priv = dev->priv;
struct lbs_private *priv = netdev_priv(dev);

lbs_deb_enter(LBS_DEB_WEXT);

Expand Down Expand Up @@ -758,7 +758,7 @@ static int lbs_set_power(struct net_device *dev, struct iw_request_info *info,
static int lbs_get_power(struct net_device *dev, struct iw_request_info *info,
struct iw_param *vwrq, char *extra)
{
struct lbs_private *priv = dev->priv;
struct lbs_private *priv = netdev_priv(dev);

lbs_deb_enter(LBS_DEB_WEXT);

Expand All @@ -781,7 +781,7 @@ static struct iw_statistics *lbs_get_wireless_stats(struct net_device *dev)
EXCELLENT = 95,
PERFECT = 100
};
struct lbs_private *priv = dev->priv;
struct lbs_private *priv = netdev_priv(dev);
u32 rssi_qual;
u32 tx_qual;
u32 quality = 0;
Expand Down Expand Up @@ -886,7 +886,7 @@ static int lbs_set_freq(struct net_device *dev, struct iw_request_info *info,
struct iw_freq *fwrq, char *extra)
{
int ret = -EINVAL;
struct lbs_private *priv = dev->priv;
struct lbs_private *priv = netdev_priv(dev);
struct chan_freq_power *cfp;
struct assoc_request * assoc_req;

Expand Down Expand Up @@ -943,7 +943,7 @@ static int lbs_mesh_set_freq(struct net_device *dev,
struct iw_request_info *info,
struct iw_freq *fwrq, char *extra)
{
struct lbs_private *priv = dev->priv;
struct lbs_private *priv = netdev_priv(dev);
struct chan_freq_power *cfp;
int ret = -EINVAL;

Expand Down Expand Up @@ -994,7 +994,7 @@ static int lbs_mesh_set_freq(struct net_device *dev,
static int lbs_set_rate(struct net_device *dev, struct iw_request_info *info,
struct iw_param *vwrq, char *extra)
{
struct lbs_private *priv = dev->priv;
struct lbs_private *priv = netdev_priv(dev);
u8 new_rate = 0;
int ret = -EINVAL;
u8 rates[MAX_RATES + 1];
Expand Down Expand Up @@ -1054,7 +1054,7 @@ static int lbs_set_rate(struct net_device *dev, struct iw_request_info *info,
static int lbs_get_rate(struct net_device *dev, struct iw_request_info *info,
struct iw_param *vwrq, char *extra)
{
struct lbs_private *priv = dev->priv;
struct lbs_private *priv = netdev_priv(dev);

lbs_deb_enter(LBS_DEB_WEXT);

Expand All @@ -1079,7 +1079,7 @@ static int lbs_set_mode(struct net_device *dev,
struct iw_request_info *info, u32 * uwrq, char *extra)
{
int ret = 0;
struct lbs_private *priv = dev->priv;
struct lbs_private *priv = netdev_priv(dev);
struct assoc_request * assoc_req;

lbs_deb_enter(LBS_DEB_WEXT);
Expand Down Expand Up @@ -1124,7 +1124,7 @@ static int lbs_get_encode(struct net_device *dev,
struct iw_request_info *info,
struct iw_point *dwrq, u8 * extra)
{
struct lbs_private *priv = dev->priv;
struct lbs_private *priv = netdev_priv(dev);
int index = (dwrq->flags & IW_ENCODE_INDEX) - 1;

lbs_deb_enter(LBS_DEB_WEXT);
Expand Down Expand Up @@ -1319,7 +1319,7 @@ static int lbs_set_encode(struct net_device *dev,
struct iw_point *dwrq, char *extra)
{
int ret = 0;
struct lbs_private *priv = dev->priv;
struct lbs_private *priv = netdev_priv(dev);
struct assoc_request * assoc_req;
u16 is_default = 0, index = 0, set_tx_key = 0;

Expand Down Expand Up @@ -1395,7 +1395,7 @@ static int lbs_get_encodeext(struct net_device *dev,
char *extra)
{
int ret = -EINVAL;
struct lbs_private *priv = dev->priv;
struct lbs_private *priv = netdev_priv(dev);
struct iw_encode_ext *ext = (struct iw_encode_ext *)extra;
int index, max_key_len;

Expand Down Expand Up @@ -1501,7 +1501,7 @@ static int lbs_set_encodeext(struct net_device *dev,
char *extra)
{
int ret = 0;
struct lbs_private *priv = dev->priv;
struct lbs_private *priv = netdev_priv(dev);
struct iw_encode_ext *ext = (struct iw_encode_ext *)extra;
int alg = ext->alg;
struct assoc_request * assoc_req;
Expand Down Expand Up @@ -1639,7 +1639,7 @@ static int lbs_set_genie(struct net_device *dev,
struct iw_point *dwrq,
char *extra)
{
struct lbs_private *priv = dev->priv;
struct lbs_private *priv = netdev_priv(dev);
int ret = 0;
struct assoc_request * assoc_req;

Expand Down Expand Up @@ -1685,7 +1685,7 @@ static int lbs_get_genie(struct net_device *dev,
char *extra)
{
int ret = 0;
struct lbs_private *priv = dev->priv;
struct lbs_private *priv = netdev_priv(dev);

lbs_deb_enter(LBS_DEB_WEXT);

Expand Down Expand Up @@ -1713,7 +1713,7 @@ static int lbs_set_auth(struct net_device *dev,
struct iw_param *dwrq,
char *extra)
{
struct lbs_private *priv = dev->priv;
struct lbs_private *priv = netdev_priv(dev);
struct assoc_request * assoc_req;
int ret = 0;
int updated = 0;
Expand Down Expand Up @@ -1816,7 +1816,7 @@ static int lbs_get_auth(struct net_device *dev,
char *extra)
{
int ret = 0;
struct lbs_private *priv = dev->priv;
struct lbs_private *priv = netdev_priv(dev);

lbs_deb_enter(LBS_DEB_WEXT);

Expand Down Expand Up @@ -1857,7 +1857,7 @@ static int lbs_set_txpow(struct net_device *dev, struct iw_request_info *info,
struct iw_param *vwrq, char *extra)
{
int ret = 0;
struct lbs_private *priv = dev->priv;
struct lbs_private *priv = netdev_priv(dev);
s16 dbm = (s16) vwrq->value;

lbs_deb_enter(LBS_DEB_WEXT);
Expand Down Expand Up @@ -1936,7 +1936,7 @@ static int lbs_set_txpow(struct net_device *dev, struct iw_request_info *info,
static int lbs_get_essid(struct net_device *dev, struct iw_request_info *info,
struct iw_point *dwrq, char *extra)
{
struct lbs_private *priv = dev->priv;
struct lbs_private *priv = netdev_priv(dev);

lbs_deb_enter(LBS_DEB_WEXT);

Expand Down Expand Up @@ -1971,7 +1971,7 @@ static int lbs_get_essid(struct net_device *dev, struct iw_request_info *info,
static int lbs_set_essid(struct net_device *dev, struct iw_request_info *info,
struct iw_point *dwrq, char *extra)
{
struct lbs_private *priv = dev->priv;
struct lbs_private *priv = netdev_priv(dev);
int ret = 0;
u8 ssid[IW_ESSID_MAX_SIZE];
u8 ssid_len = 0;
Expand Down Expand Up @@ -2040,7 +2040,7 @@ static int lbs_mesh_get_essid(struct net_device *dev,
struct iw_request_info *info,
struct iw_point *dwrq, char *extra)
{
struct lbs_private *priv = dev->priv;
struct lbs_private *priv = netdev_priv(dev);

lbs_deb_enter(LBS_DEB_WEXT);

Expand All @@ -2058,7 +2058,7 @@ static int lbs_mesh_set_essid(struct net_device *dev,
struct iw_request_info *info,
struct iw_point *dwrq, char *extra)
{
struct lbs_private *priv = dev->priv;
struct lbs_private *priv = netdev_priv(dev);
int ret = 0;

lbs_deb_enter(LBS_DEB_WEXT);
Expand Down Expand Up @@ -2102,7 +2102,7 @@ static int lbs_mesh_set_essid(struct net_device *dev,
static int lbs_set_wap(struct net_device *dev, struct iw_request_info *info,
struct sockaddr *awrq, char *extra)
{
struct lbs_private *priv = dev->priv;
struct lbs_private *priv = netdev_priv(dev);
struct assoc_request * assoc_req;
int ret = 0;

Expand Down
Loading

0 comments on commit 524ad0a

Please sign in to comment.