From 7c1f4203a2883c50e2d754b176fcfcd5be34549b Mon Sep 17 00:00:00 2001 From: Ali Bahar Date: Sun, 4 Sep 2011 03:14:05 +0800 Subject: [PATCH] staging: r8712u: Merging Realtek's latest (v2.6.6). Renamed _netdev_priv. Renamed _netdev_priv to netdev_priv. Signed-off-by: Ali Bahar Signed-off-by: Larry Finger Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8712/os_intfs.c | 10 +-- drivers/staging/rtl8712/osdep_service.h | 5 -- drivers/staging/rtl8712/rtl871x_ioctl_linux.c | 68 +++++++++---------- drivers/staging/rtl8712/usb_intf.c | 2 +- drivers/staging/rtl8712/xmit_linux.c | 2 +- 5 files changed, 41 insertions(+), 46 deletions(-) diff --git a/drivers/staging/rtl8712/os_intfs.c b/drivers/staging/rtl8712/os_intfs.c index 6697941e2321..90949cfacd6d 100644 --- a/drivers/staging/rtl8712/os_intfs.c +++ b/drivers/staging/rtl8712/os_intfs.c @@ -177,7 +177,7 @@ static uint loadparam(struct _adapter *padapter, struct net_device *pnetdev) static int r871x_net_set_mac_address(struct net_device *pnetdev, void *p) { - struct _adapter *padapter = (struct _adapter *)_netdev_priv(pnetdev); + struct _adapter *padapter = (struct _adapter *)netdev_priv(pnetdev); struct sockaddr *addr = p; if (padapter->bup == false) @@ -187,7 +187,7 @@ static int r871x_net_set_mac_address(struct net_device *pnetdev, void *p) static struct net_device_stats *r871x_net_get_stats(struct net_device *pnetdev) { - struct _adapter *padapter = (struct _adapter *) _netdev_priv(pnetdev); + struct _adapter *padapter = (struct _adapter *) netdev_priv(pnetdev); struct xmit_priv *pxmitpriv = &(padapter->xmitpriv); struct recv_priv *precvpriv = &(padapter->recvpriv); @@ -221,7 +221,7 @@ struct net_device *r8712_init_netdev(void) strcpy(ifname, "wlan%d"); dev_alloc_name(pnetdev, ifname); } - padapter = (struct _adapter *) _netdev_priv(pnetdev); + padapter = (struct _adapter *) netdev_priv(pnetdev); padapter->pnetdev = pnetdev; printk(KERN_INFO "r8712u: register rtl8712_netdev_ops to" " netdev_ops\n"); @@ -383,7 +383,7 @@ static void enable_video_mode(struct _adapter *padapter, int cbw40_value) */ static int netdev_open(struct net_device *pnetdev) { - struct _adapter *padapter = (struct _adapter *)_netdev_priv(pnetdev); + struct _adapter *padapter = (struct _adapter *)netdev_priv(pnetdev); if (padapter->bup == false) { padapter->bDriverStopped = false; @@ -448,7 +448,7 @@ netdev_open_error: */ static int netdev_close(struct net_device *pnetdev) { - struct _adapter *padapter = (struct _adapter *) _netdev_priv(pnetdev); + struct _adapter *padapter = (struct _adapter *) netdev_priv(pnetdev); /* Close LED*/ padapter->ledpriv.LedControlHandler(padapter, LED_CTL_POWER_OFF); diff --git a/drivers/staging/rtl8712/osdep_service.h b/drivers/staging/rtl8712/osdep_service.h index e85774c11630..60e586c7d608 100644 --- a/drivers/staging/rtl8712/osdep_service.h +++ b/drivers/staging/rtl8712/osdep_service.h @@ -78,11 +78,6 @@ struct __queue { spin_lock_init(&((pqueue)->lock)); \ } while (0) -static inline void *_netdev_priv(struct net_device *dev) -{ - return netdev_priv(dev); -} - static inline void os_free_netdev(struct net_device *dev) { free_netdev(dev); diff --git a/drivers/staging/rtl8712/rtl871x_ioctl_linux.c b/drivers/staging/rtl8712/rtl871x_ioctl_linux.c index d310a6174b97..ba700815ead0 100644 --- a/drivers/staging/rtl8712/rtl871x_ioctl_linux.c +++ b/drivers/staging/rtl8712/rtl871x_ioctl_linux.c @@ -363,7 +363,7 @@ static inline char *translate_scan(struct _adapter *padapter, static int wpa_set_auth_algs(struct net_device *dev, u32 value) { - struct _adapter *padapter = (struct _adapter *) _netdev_priv(dev); + struct _adapter *padapter = (struct _adapter *) netdev_priv(dev); int ret = 0; if ((value & AUTH_ALG_SHARED_KEY) && (value & AUTH_ALG_OPEN_SYSTEM)) { @@ -395,7 +395,7 @@ static int wpa_set_encryption(struct net_device *dev, struct ieee_param *param, int ret = 0; u32 wep_key_idx, wep_key_len = 0; struct NDIS_802_11_WEP *pwep = NULL; - struct _adapter *padapter = (struct _adapter *)_netdev_priv(dev); + struct _adapter *padapter = (struct _adapter *)netdev_priv(dev); struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct security_priv *psecuritypriv = &padapter->securitypriv; @@ -637,7 +637,7 @@ static int r8711_wx_get_name(struct net_device *dev, struct iw_request_info *info, union iwreq_data *wrqu, char *extra) { - struct _adapter *padapter = (struct _adapter *)_netdev_priv(dev); + struct _adapter *padapter = (struct _adapter *)netdev_priv(dev); u32 ht_ielen = 0; char *p; u8 ht_cap = false; @@ -693,7 +693,7 @@ static int r8711_wx_set_freq(struct net_device *dev, struct iw_request_info *info, union iwreq_data *wrqu, char *extra) { - struct _adapter *padapter = (struct _adapter *)_netdev_priv(dev); + struct _adapter *padapter = (struct _adapter *)netdev_priv(dev); struct iw_freq *fwrq = &wrqu->freq; int rc = 0; @@ -727,7 +727,7 @@ static int r8711_wx_get_freq(struct net_device *dev, struct iw_request_info *info, union iwreq_data *wrqu, char *extra) { - struct _adapter *padapter = (struct _adapter *)_netdev_priv(dev); + struct _adapter *padapter = (struct _adapter *)netdev_priv(dev); struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct ndis_wlan_bssid_ex *pcur_bss = &pmlmepriv->cur_network.network; @@ -745,7 +745,7 @@ static int r8711_wx_set_mode(struct net_device *dev, struct iw_request_info *a, union iwreq_data *wrqu, char *b) { - struct _adapter *padapter = (struct _adapter *)_netdev_priv(dev); + struct _adapter *padapter = (struct _adapter *)netdev_priv(dev); enum NDIS_802_11_NETWORK_INFRASTRUCTURE networkType; switch (wrqu->mode) { @@ -776,7 +776,7 @@ static int r8711_wx_set_mode(struct net_device *dev, static int r8711_wx_get_mode(struct net_device *dev, struct iw_request_info *a, union iwreq_data *wrqu, char *b) { - struct _adapter *padapter = (struct _adapter *)_netdev_priv(dev); + struct _adapter *padapter = (struct _adapter *)netdev_priv(dev); struct mlme_priv *pmlmepriv = &padapter->mlmepriv; if (check_fwstate(pmlmepriv, WIFI_STATION_STATE) == true) @@ -795,7 +795,7 @@ static int r871x_wx_set_pmkid(struct net_device *dev, struct iw_request_info *a, union iwreq_data *wrqu, char *extra) { - struct _adapter *padapter = (struct _adapter *)_netdev_priv(dev); + struct _adapter *padapter = (struct _adapter *)netdev_priv(dev); struct security_priv *psecuritypriv = &padapter->securitypriv; struct iw_pmksa *pPMK = (struct iw_pmksa *) extra; u8 strZeroMacAddress[ETH_ALEN] = {0x00}; @@ -989,7 +989,7 @@ static int r8711_wx_set_wap(struct net_device *dev, char *extra) { int ret = -EINPROGRESS; - struct _adapter *padapter = (struct _adapter *) _netdev_priv(dev); + struct _adapter *padapter = (struct _adapter *) netdev_priv(dev); struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct __queue *queue = &pmlmepriv->scanned_queue; struct sockaddr *temp = (struct sockaddr *)awrq; @@ -1039,7 +1039,7 @@ static int r8711_wx_get_wap(struct net_device *dev, struct iw_request_info *info, union iwreq_data *wrqu, char *extra) { - struct _adapter *padapter = (struct _adapter *)_netdev_priv(dev); + struct _adapter *padapter = (struct _adapter *)netdev_priv(dev); struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct ndis_wlan_bssid_ex *pcur_bss = &pmlmepriv->cur_network.network; @@ -1058,7 +1058,7 @@ static int r871x_wx_set_mlme(struct net_device *dev, { int ret = 0; u16 reason; - struct _adapter *padapter = (struct _adapter *)_netdev_priv(dev); + struct _adapter *padapter = (struct _adapter *)netdev_priv(dev); struct iw_mlme *mlme = (struct iw_mlme *) extra; if (mlme == NULL) @@ -1091,7 +1091,7 @@ static int r8711_wx_set_scan(struct net_device *dev, struct iw_request_info *a, union iwreq_data *wrqu, char *extra) { - struct _adapter *padapter = (struct _adapter *)_netdev_priv(dev); + struct _adapter *padapter = (struct _adapter *)netdev_priv(dev); struct mlme_priv *pmlmepriv = &padapter->mlmepriv; u8 status = true; @@ -1139,7 +1139,7 @@ static int r8711_wx_get_scan(struct net_device *dev, struct iw_request_info *a, union iwreq_data *wrqu, char *extra) { - struct _adapter *padapter = (struct _adapter *)_netdev_priv(dev); + struct _adapter *padapter = (struct _adapter *)netdev_priv(dev); struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct __queue *queue = &pmlmepriv->scanned_queue; struct wlan_network *pnetwork = NULL; @@ -1193,7 +1193,7 @@ static int r8711_wx_set_essid(struct net_device *dev, struct iw_request_info *a, union iwreq_data *wrqu, char *extra) { - struct _adapter *padapter = (struct _adapter *)_netdev_priv(dev); + struct _adapter *padapter = (struct _adapter *)netdev_priv(dev); struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct __queue *queue = &pmlmepriv->scanned_queue; struct wlan_network *pnetwork = NULL; @@ -1246,7 +1246,7 @@ static int r8711_wx_get_essid(struct net_device *dev, struct iw_request_info *a, union iwreq_data *wrqu, char *extra) { - struct _adapter *padapter = (struct _adapter *)_netdev_priv(dev); + struct _adapter *padapter = (struct _adapter *)netdev_priv(dev); struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct ndis_wlan_bssid_ex *pcur_bss = &pmlmepriv->cur_network.network; u32 len, ret = 0; @@ -1265,7 +1265,7 @@ static int r8711_wx_set_rate(struct net_device *dev, struct iw_request_info *a, union iwreq_data *wrqu, char *extra) { - struct _adapter *padapter = (struct _adapter *)_netdev_priv(dev); + struct _adapter *padapter = (struct _adapter *)netdev_priv(dev); u32 target_rate = wrqu->bitrate.value; u32 fixed = wrqu->bitrate.fixed; u32 ratevalue = 0; @@ -1337,7 +1337,7 @@ static int r8711_wx_get_rate(struct net_device *dev, struct iw_request_info *info, union iwreq_data *wrqu, char *extra) { - struct _adapter *padapter = (struct _adapter *)_netdev_priv(dev); + struct _adapter *padapter = (struct _adapter *)netdev_priv(dev); struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct ndis_wlan_bssid_ex *pcur_bss = &pmlmepriv->cur_network.network; struct ieee80211_ht_cap *pht_capie; @@ -1396,7 +1396,7 @@ static int r8711_wx_get_rts(struct net_device *dev, struct iw_request_info *info, union iwreq_data *wrqu, char *extra) { - struct _adapter *padapter = (struct _adapter *)_netdev_priv(dev); + struct _adapter *padapter = (struct _adapter *)netdev_priv(dev); wrqu->rts.value = padapter->registrypriv.rts_thresh; wrqu->rts.fixed = 0; /* no auto select */ @@ -1407,7 +1407,7 @@ static int r8711_wx_set_frag(struct net_device *dev, struct iw_request_info *info, union iwreq_data *wrqu, char *extra) { - struct _adapter *padapter = (struct _adapter *)_netdev_priv(dev); + struct _adapter *padapter = (struct _adapter *)netdev_priv(dev); if (wrqu->frag.disabled) padapter->xmitpriv.frag_len = MAX_FRAG_THRESHOLD; @@ -1424,7 +1424,7 @@ static int r8711_wx_get_frag(struct net_device *dev, struct iw_request_info *info, union iwreq_data *wrqu, char *extra) { - struct _adapter *padapter = (struct _adapter *) _netdev_priv(dev); + struct _adapter *padapter = (struct _adapter *) netdev_priv(dev); wrqu->frag.value = padapter->xmitpriv.frag_len; wrqu->frag.fixed = 0; /* no auto select */ @@ -1450,7 +1450,7 @@ static int r8711_wx_set_enc(struct net_device *dev, struct NDIS_802_11_WEP wep; enum NDIS_802_11_AUTHENTICATION_MODE authmode; struct iw_point *erq = &(wrqu->encoding); - struct _adapter *padapter = (struct _adapter *) _netdev_priv(dev); + struct _adapter *padapter = (struct _adapter *) netdev_priv(dev); key = erq->flags & IW_ENCODE_INDEX; memset(&wep, 0, sizeof(struct NDIS_802_11_WEP)); @@ -1544,7 +1544,7 @@ static int r8711_wx_get_enc(struct net_device *dev, union iwreq_data *wrqu, char *keybuf) { uint key, ret = 0; - struct _adapter *padapter = (struct _adapter *) _netdev_priv(dev); + struct _adapter *padapter = (struct _adapter *) netdev_priv(dev); struct iw_point *erq = &(wrqu->encoding); struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); @@ -1616,7 +1616,7 @@ static int r871x_wx_set_gen_ie(struct net_device *dev, struct iw_request_info *info, union iwreq_data *wrqu, char *extra) { - struct _adapter *padapter = (struct _adapter *)_netdev_priv(dev); + struct _adapter *padapter = (struct _adapter *)netdev_priv(dev); return r871x_set_wpa_ie(padapter, extra, wrqu->data.length); } @@ -1625,7 +1625,7 @@ static int r871x_wx_set_auth(struct net_device *dev, struct iw_request_info *info, union iwreq_data *wrqu, char *extra) { - struct _adapter *padapter = (struct _adapter *)_netdev_priv(dev); + struct _adapter *padapter = (struct _adapter *)netdev_priv(dev); struct iw_param *param = (struct iw_param *)&(wrqu->param); int paramid; int paramval; @@ -1771,7 +1771,7 @@ static int r8711_wx_read32(struct net_device *dev, struct iw_request_info *info, union iwreq_data *wrqu, char *keybuf) { - struct _adapter *padapter = (struct _adapter *) _netdev_priv(dev); + struct _adapter *padapter = (struct _adapter *) netdev_priv(dev); u32 addr; u32 data32; @@ -1788,7 +1788,7 @@ static int r8711_wx_write32(struct net_device *dev, struct iw_request_info *info, union iwreq_data *wrqu, char *keybuf) { - struct _adapter *padapter = (struct _adapter *) _netdev_priv(dev); + struct _adapter *padapter = (struct _adapter *) netdev_priv(dev); u32 addr; u32 data32; @@ -1816,7 +1816,7 @@ static int r871x_mp_ioctl_hdl(struct net_device *dev, struct iw_request_info *info, union iwreq_data *wrqu, char *extra) { - struct _adapter *padapter = (struct _adapter *)_netdev_priv(dev); + struct _adapter *padapter = (struct _adapter *)netdev_priv(dev); struct iw_point *p = &wrqu->data; struct oid_par_priv oid_par; struct mp_ioctl_handler *phandler; @@ -1899,7 +1899,7 @@ static int r871x_get_ap_info(struct net_device *dev, struct iw_request_info *info, union iwreq_data *wrqu, char *extra) { - struct _adapter *padapter = (struct _adapter *)_netdev_priv(dev); + struct _adapter *padapter = (struct _adapter *)netdev_priv(dev); struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct __queue *queue = &pmlmepriv->scanned_queue; struct iw_point *pdata = &wrqu->data; @@ -1970,7 +1970,7 @@ static int r871x_set_pid(struct net_device *dev, struct iw_request_info *info, union iwreq_data *wrqu, char *extra) { - struct _adapter *padapter = (struct _adapter *) _netdev_priv(dev); + struct _adapter *padapter = (struct _adapter *) netdev_priv(dev); struct iw_point *pdata = &wrqu->data; if ((padapter->bDriverStopped) || (pdata == NULL)) @@ -1984,7 +1984,7 @@ static int r871x_wps_start(struct net_device *dev, struct iw_request_info *info, union iwreq_data *wrqu, char *extra) { - struct _adapter *padapter = (struct _adapter *)_netdev_priv(dev); + struct _adapter *padapter = (struct _adapter *)netdev_priv(dev); struct iw_point *pdata = &wrqu->data; u32 u32wps_start = 0; @@ -2008,7 +2008,7 @@ static int r871x_wps_start(struct net_device *dev, static int wpa_set_param(struct net_device *dev, u8 name, u32 value) { - struct _adapter *padapter = (struct _adapter *) _netdev_priv(dev); + struct _adapter *padapter = (struct _adapter *) netdev_priv(dev); switch (name) { case IEEE_PARAM_WPA_ENABLED: @@ -2061,7 +2061,7 @@ static int wpa_set_param(struct net_device *dev, u8 name, u32 value) static int wpa_mlme(struct net_device *dev, u32 command, u32 reason) { - struct _adapter *padapter = (struct _adapter *) _netdev_priv(dev); + struct _adapter *padapter = (struct _adapter *) netdev_priv(dev); switch (command) { case IEEE_MLME_STA_DEAUTH: @@ -2082,7 +2082,7 @@ static int wpa_supplicant_ioctl(struct net_device *dev, struct iw_point *p) { struct ieee_param *param; int ret = 0; - struct _adapter *padapter = (struct _adapter *) _netdev_priv(dev); + struct _adapter *padapter = (struct _adapter *) netdev_priv(dev); if (p->length < sizeof(struct ieee_param) || !p->pointer) return -EINVAL; @@ -2234,7 +2234,7 @@ static iw_handler r8711_private_handler[] = { static struct iw_statistics *r871x_get_wireless_stats(struct net_device *dev) { - struct _adapter *padapter = (struct _adapter *) _netdev_priv(dev); + struct _adapter *padapter = (struct _adapter *) netdev_priv(dev); struct iw_statistics *piwstats = &padapter->iwstats; int tmp_level = 0; int tmp_qual = 0; diff --git a/drivers/staging/rtl8712/usb_intf.c b/drivers/staging/rtl8712/usb_intf.c index 21ce2af447b5..e590ebd3a452 100644 --- a/drivers/staging/rtl8712/usb_intf.c +++ b/drivers/staging/rtl8712/usb_intf.c @@ -378,7 +378,7 @@ static int r871xu_drv_init(struct usb_interface *pusb_intf, pnetdev = r8712_init_netdev(); if (!pnetdev) goto error; - padapter = (struct _adapter *)_netdev_priv(pnetdev); + padapter = (struct _adapter *)netdev_priv(pnetdev); disable_ht_for_spec_devid(pdid, padapter); pdvobjpriv = &padapter->dvobjpriv; pdvobjpriv->padapter = padapter; diff --git a/drivers/staging/rtl8712/xmit_linux.c b/drivers/staging/rtl8712/xmit_linux.c index 7dea8b5b7e75..3efebeb4bcc6 100644 --- a/drivers/staging/rtl8712/xmit_linux.c +++ b/drivers/staging/rtl8712/xmit_linux.c @@ -146,7 +146,7 @@ void r8712_xmit_complete(struct _adapter *padapter, struct xmit_frame *pxframe) int r8712_xmit_entry(_pkt *pkt, struct net_device *pnetdev) { struct xmit_frame *pxmitframe = NULL; - struct _adapter *padapter = (struct _adapter *)_netdev_priv(pnetdev); + struct _adapter *padapter = (struct _adapter *)netdev_priv(pnetdev); struct xmit_priv *pxmitpriv = &(padapter->xmitpriv); int ret = 0; -- 2.39.5