Re: [PATCH] staging:rtl8723au: core: Fix Warning reported by checkpatch.

2014-11-07 Thread Jes Sorensen
"Sharma, Sanjeev"  writes:
> -Original Message-
> From: Greg KH [mailto:gre...@linuxfoundation.org] 
> Sent: Thursday, November 06, 2014 9:13 PM
> To: Sharma, Sanjeev
> Cc: larry.fin...@lwfinger.net; jes.soren...@redhat.com;
> de...@driverdev.osuosl.org; linux-wirel...@vger.kernel.org;
> linux-ker...@vger.kernel.org
> Subject: Re: [PATCH] staging:rtl8723au: core: Fix Warning reported by
> checkpatch.
>
> On Thu, Nov 06, 2014 at 12:06:36PM +0530, Sanjeev Sharma wrote:
>> This is a patch to the rtw_cmd.c file that fixes following Warning by 
>> introducing temporary structure.
>> 
>> WARNING: line over 80 characters
>> 
>> Signed-off-by: Sanjeev Sharma 
>> ---
>>  drivers/staging/rtl8723au/core/rtw_cmd.c | 123 
>> +++
>>  1 file changed, 60 insertions(+), 63 deletions(-)
>
> Same as the other patch, give us a hint as to the warning in the subject.
>
> This patch is Fix of Warning introduced in Previous patch while fixing " 
> ERROR: spaces required around that '>' (ctx:WxV)".Can I mentioned dependency 
> or hint in subject line or do we have
> another way to described these type of fix.(One patch introduced another 
> Warning/Error)

When replying to these messages, please do it properly with proper
quoting. Do NOT resend other peoples' emails with just an
"-Original Message-" line and no comments and no indentation of
the message you respond to.

If you have any questions, please read:
https://www.ietf.org/rfc/rfc1855.txt

Jes

>
>> 
>> diff --git a/drivers/staging/rtl8723au/core/rtw_cmd.c 
>> b/drivers/staging/rtl8723au/core/rtw_cmd.c
>> index 4eaa502..6186575 100644
>> --- a/drivers/staging/rtl8723au/core/rtw_cmd.c
>> +++ b/drivers/staging/rtl8723au/core/rtw_cmd.c
>> @@ -919,34 +919,34 @@ static void traffic_status_watchdog(struct rtw_adapter 
>> *padapter)
>>  u8 bHigherBusyTxTraffic = false;
>>  struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
>>  int BusyThreshold = 100;
>> +struct rt_link_detect *ldi = &pmlmepriv->LinkDetectInfo;
>> +
>>  /*  */
>>  /*  Determine if our traffic is busy now */
>>  /*  */
>>  if (check_fwstate(pmlmepriv, _FW_LINKED)) {
>>  if (rtl8723a_BT_coexist(padapter))
>>  BusyThreshold = 50;
>> -else if (pmlmepriv->LinkDetectInfo.bBusyTraffic)
>> +else if (ldi->bBusyTraffic)
>>  BusyThreshold = 75;
>>  /*  if we raise bBusyTraffic in last watchdog, using
>>  lower threshold. */
>> -if (pmlmepriv->LinkDetectInfo.NumRxOkInPeriod > BusyThreshold ||
>> -pmlmepriv->LinkDetectInfo.NumTxOkInPeriod > BusyThreshold) {
>> +if (ldi->NumRxOkInPeriod > BusyThreshold ||
>> +ldi->NumTxOkInPeriod > BusyThreshold) {
>>  bBusyTraffic = true;
>>  
>> -if (pmlmepriv->LinkDetectInfo.NumRxOkInPeriod >
>> -pmlmepriv->LinkDetectInfo.NumTxOkInPeriod)
>> +if (ldi->NumRxOkInPeriod > ldi->NumTxOkInPeriod)
>>  bRxBusyTraffic = true;
>>  else
>>  bTxBusyTraffic = true;
>>  }
>>  
>>  /*  Higher Tx/Rx data. */
>> -if (pmlmepriv->LinkDetectInfo.NumRxOkInPeriod > 4000 ||
>> -pmlmepriv->LinkDetectInfo.NumTxOkInPeriod > 4000) {
>> +if (ldi->NumRxOkInPeriod > 4000 ||
>> +ldi->NumTxOkInPeriod > 4000) {
>>  bHigherBusyTraffic = true;
>>  
>> -if (pmlmepriv->LinkDetectInfo.NumRxOkInPeriod >
>> -pmlmepriv->LinkDetectInfo.NumTxOkInPeriod)
>> +if (ldi->NumRxOkInPeriod > ldi->NumTxOkInPeriod)
>>  bHigherBusyRxTraffic = true;
>>  else
>>  bHigherBusyTxTraffic = true;
>> @@ -955,9 +955,9 @@ static void traffic_status_watchdog(struct rtw_adapter 
>> *padapter)
>>  if (!rtl8723a_BT_coexist(padapter) ||
>>  !rtl8723a_BT_using_antenna_1(padapter)) {
>>  /*  check traffic for  powersaving. */
>> -if (((pmlmepriv->LinkDetectInfo.NumRxUnicastOkInPeriod +
>> -  pmlmepriv->LinkDetectInfo.NumTxOkInPeriod) > 8) ||
>> -pmlmepriv->LinkDetectInfo.NumRxUnicastOkInPeriod >2)
>> +if (((ldi->NumRxUnicastOkInPeriod +
>> +  ldi->NumTxOkInPeriod) > 8) ||
>> +ldi->NumRxUnicastOkInPeriod > 2)
>>  bEnterPS = false;
>>  else
>>  bEnterPS = true;
>> @@ -971,15 +971,15 @@ static void traffic_status_watchdog(struct rtw_adapter 
>> *padapter)
>>  } else
>>  LPS_Leave23a(padapter);
>>  
>> -pmlmepriv->LinkDetectInfo.NumRxOkInPeriod = 0;
>> -pmlmepriv->LinkDe

Re: [PATCH] staging: rtl8723au: change typecast to match type returned by htons()

2014-11-10 Thread Jes Sorensen
Chris Ruffin  writes:
> Using a u16 pointer typecast for a result from htons() results in the 
> following warning from sparse:
>
> drivers/staging/rtl8723au/core/rtw_xmit.c:1279:36: warning: incorrect type in 
> assignment (different base types)
> drivers/staging/rtl8723au/core/rtw_xmit.c:1279:36:expected unsigned short 
> [unsigned] [short] [usertype] 
> drivers/staging/rtl8723au/core/rtw_xmit.c:1279:36:got restricted __be16 
> [usertype] 
>
> This patch fixes the issue by using an endian-specific typecast
> that will always match the type returned by htons().
>
> Signed-off-by: Chris Ruffin 
> ---
>  drivers/staging/rtl8723au/core/rtw_xmit.c |2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Looks fine to me

Signed-off-by: Jes Sorensen 

>
> diff --git a/drivers/staging/rtl8723au/core/rtw_xmit.c 
> b/drivers/staging/rtl8723au/core/rtw_xmit.c
> index a0f7e27..44ef55c 100644
> --- a/drivers/staging/rtl8723au/core/rtw_xmit.c
> +++ b/drivers/staging/rtl8723au/core/rtw_xmit.c
> @@ -1276,7 +1276,7 @@ s32 rtw_put_snap23a(u8 *data, u16 h_proto)
>   snap->oui[0] = oui[0];
>   snap->oui[1] = oui[1];
>   snap->oui[2] = oui[2];
> - *(u16 *)(data + SNAP_SIZE) = htons(h_proto);
> + *(__be16 *)(data + SNAP_SIZE) = htons(h_proto);
>   return SNAP_SIZE + sizeof(u16);
>  }
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: rtl8723au: change typecast to match type returned by htons()

2014-11-10 Thread Jes Sorensen
Arend van Spriel  writes:
> On 10-11-14 21:21, Jes Sorensen wrote:
>> Chris Ruffin  writes:
>>> Using a u16 pointer typecast for a result from htons() results in
>>> the following warning from sparse:
>>>
>>> drivers/staging/rtl8723au/core/rtw_xmit.c:1279:36: warning:
>>> incorrect type in assignment (different base types)
>>> drivers/staging/rtl8723au/core/rtw_xmit.c:1279:36: expected
>>> unsigned short [unsigned] [short] [usertype] 
>>> drivers/staging/rtl8723au/core/rtw_xmit.c:1279:36: got restricted
>>> __be16 [usertype] 
>>>
>>> This patch fixes the issue by using an endian-specific typecast
>>> that will always match the type returned by htons().
>>>
>>> Signed-off-by: Chris Ruffin 
>>> ---
>>>  drivers/staging/rtl8723au/core/rtw_xmit.c |2 +-
>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>> 
>> Looks fine to me
>> 
>> Signed-off-by: Jes Sorensen 
>> 
>>>
>>> diff --git a/drivers/staging/rtl8723au/core/rtw_xmit.c
>>> b/drivers/staging/rtl8723au/core/rtw_xmit.c
>>> index a0f7e27..44ef55c 100644
>>> --- a/drivers/staging/rtl8723au/core/rtw_xmit.c
>>> +++ b/drivers/staging/rtl8723au/core/rtw_xmit.c
>>> @@ -1276,7 +1276,7 @@ s32 rtw_put_snap23a(u8 *data, u16 h_proto)
>>> snap->oui[0] = oui[0];
>>> snap->oui[1] = oui[1];
>>> snap->oui[2] = oui[2];
>>> -   *(u16 *)(data + SNAP_SIZE) = htons(h_proto);
>>> +   *(__be16 *)(data + SNAP_SIZE) = htons(h_proto);
>
> Could (data + SNAP_SIZE) be on a unaligned address?

It shouldn't but probably better to take it into account. I am moving
things around in this code right now, so I'll just fix it in a follow-on
patch to this one.

Cheers,
Jes
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 00/10] staging: rtl8723au: Fixes and remove dead code

2014-11-10 Thread Jes . Sorensen
From: Jes Sorensen 

Hi,

Here's a set of patches removing a pile of unused code from the
rtl8723au drivers. It also includes an alignment issue pointed out by
Arend van Spriel.

Note this set goes on top of Chris Ruffin's patch:
staging: rtl8723au: change typecast to match type returned by htons()

Cheers,
Jes

Jes Sorensen (10):
  staging: rtl8723au: Remove unused
rtw_calculate_wlan_pkt_size_by_attribue23a()
  staging rtl8723au: rtw_put_smap23a(): Use common SNAP header defines
  staging: rtl8723au: rtw_put_snap23a(): Use put_unaligned to set
protocol
  staging: rtl8723au: rtw_put_snap23a(): Make it static
  staging: rtl8723au: portctrl(): Remove a pile of unnecessary clutter
  staging: rtl8723au: rtw_dump_xframe(): Use proper ETH_P_* types
  staging: rtl8723au: pxmitframe->frame_tag is never set to a value > 8
  staging: rtl8723au: Remove unused rtl8723a_update_txdesc() and child
functions
  staging: rtl8723au: Remove no-op function Hal_InitChannelPlan23a()
  staging: rtl8723au: Remove sw led handling

 drivers/staging/rtl8723au/Makefile|2 -
 drivers/staging/rtl8723au/core/rtw_cmd.c  |6 -
 drivers/staging/rtl8723au/core/rtw_led.c  | 1865 -
 drivers/staging/rtl8723au/core/rtw_mlme.c |5 -
 drivers/staging/rtl8723au/core/rtw_recv.c |   43 +-
 drivers/staging/rtl8723au/core/rtw_xmit.c |   63 +-
 drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c |  252 ---
 drivers/staging/rtl8723au/hal/rtl8723au_led.c |  124 --
 drivers/staging/rtl8723au/hal/rtl8723au_xmit.c|   19 +-
 drivers/staging/rtl8723au/hal/usb_halinit.c   |   22 -
 drivers/staging/rtl8723au/include/drv_types.h |2 -
 drivers/staging/rtl8723au/include/rtl8723a_hal.h  |2 -
 drivers/staging/rtl8723au/include/rtl8723a_led.h  |   30 -
 drivers/staging/rtl8723au/include/rtl8723a_xmit.h |1 -
 drivers/staging/rtl8723au/include/rtw_cmd.h   |1 -
 drivers/staging/rtl8723au/include/rtw_led.h   |  181 --
 drivers/staging/rtl8723au/include/rtw_xmit.h  |3 -
 drivers/staging/rtl8723au/os_dep/os_intfs.c   |   11 -
 drivers/staging/rtl8723au/os_dep/usb_intf.c   |2 -
 19 files changed, 30 insertions(+), 2604 deletions(-)
 delete mode 100644 drivers/staging/rtl8723au/core/rtw_led.c
 delete mode 100644 drivers/staging/rtl8723au/hal/rtl8723au_led.c
 delete mode 100644 drivers/staging/rtl8723au/include/rtl8723a_led.h
 delete mode 100644 drivers/staging/rtl8723au/include/rtw_led.h

-- 
1.9.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 09/10] staging: rtl8723au: Remove no-op function Hal_InitChannelPlan23a()

2014-11-10 Thread Jes . Sorensen
From: Jes Sorensen 

Signed-off-by: Jes Sorensen 
---
 drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c | 4 
 drivers/staging/rtl8723au/hal/usb_halinit.c   | 4 
 drivers/staging/rtl8723au/include/rtl8723a_hal.h  | 2 --
 3 files changed, 10 deletions(-)

diff --git a/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c 
b/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c
index 8196a33..5c143fc 100644
--- a/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c
+++ b/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c
@@ -1954,10 +1954,6 @@ Hal_EfuseParseThermalMeter_8723A(struct rtw_adapter 
*padapter,
  pHalData->EEPROMThermalMeter);
 }
 
-void Hal_InitChannelPlan23a(struct rtw_adapter *padapter)
-{
-}
-
 static void rtl8723a_cal_txdesc_chksum(struct tx_desc *ptxdesc)
 {
u16 *usPtr = (u16 *) ptxdesc;
diff --git a/drivers/staging/rtl8723au/hal/usb_halinit.c 
b/drivers/staging/rtl8723au/hal/usb_halinit.c
index adc2953..1c7ce85 100644
--- a/drivers/staging/rtl8723au/hal/usb_halinit.c
+++ b/drivers/staging/rtl8723au/hal/usb_halinit.c
@@ -1276,10 +1276,6 @@ static void readAdapterInfo(struct rtw_adapter *padapter)
   pEEPROM->bautoload_fail_flag);
Hal_EfuseParseXtal_8723A(padapter, hwinfo,
 pEEPROM->bautoload_fail_flag);
-   /*  */
-   /*  The following part initialize some vars by PG info. */
-   /*  */
-   Hal_InitChannelPlan23a(padapter);
 
/* hal_CustomizedBehavior_8723U(Adapter); */
 
diff --git a/drivers/staging/rtl8723au/include/rtl8723a_hal.h 
b/drivers/staging/rtl8723au/include/rtl8723a_hal.h
index ee203a5..72af134 100644
--- a/drivers/staging/rtl8723au/include/rtl8723a_hal.h
+++ b/drivers/staging/rtl8723au/include/rtl8723a_hal.h
@@ -518,8 +518,6 @@ void Hal_EfuseParseRateIndicationOption(struct rtw_adapter 
*padapter, u8 *hwinfo
 void Hal_EfuseParseXtal_8723A(struct rtw_adapter *pAdapter, u8 *hwinfo, u8 
AutoLoadFail);
 void Hal_EfuseParseThermalMeter_8723A(struct rtw_adapter *padapter, u8 
*hwinfo, bool AutoLoadFail);
 
-void Hal_InitChannelPlan23a(struct rtw_adapter *padapter);
-
 /*  register */
 void SetBcnCtrlReg23a(struct rtw_adapter *padapter, u8 SetBits, u8 ClearBits);
 void rtl8723a_InitBeaconParameters(struct rtw_adapter *padapter);
-- 
1.9.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 01/10] staging: rtl8723au: Remove unused rtw_calculate_wlan_pkt_size_by_attribue23a()

2014-11-10 Thread Jes . Sorensen
From: Jes Sorensen 

Signed-off-by: Jes Sorensen 
---
 drivers/staging/rtl8723au/core/rtw_xmit.c| 17 -
 drivers/staging/rtl8723au/include/rtw_xmit.h |  2 --
 2 files changed, 19 deletions(-)

diff --git a/drivers/staging/rtl8723au/core/rtw_xmit.c 
b/drivers/staging/rtl8723au/core/rtw_xmit.c
index 44ef55c..b9ee983 100644
--- a/drivers/staging/rtl8723au/core/rtw_xmit.c
+++ b/drivers/staging/rtl8723au/core/rtw_xmit.c
@@ -1043,23 +1043,6 @@ s32 rtw_txframes_sta_ac_pending23a(struct rtw_adapter 
*padapter,
 }
 
 /*
- * Calculate wlan 802.11 packet MAX size from pkt_attrib
- * This function doesn't consider fragment case
- */
-u32 rtw_calculate_wlan_pkt_size_by_attribue23a(struct pkt_attrib *pattrib)
-{
-   u32 len = 0;
-
-   len = pattrib->hdrlen + pattrib->iv_len; /*  WLAN Header and IV */
-   len += SNAP_SIZE + sizeof(u16); /*  LLC */
-   len += pattrib->pktlen;
-   if (pattrib->encrypt == WLAN_CIPHER_SUITE_TKIP) len += 8; /*  MIC */
-   len += ((pattrib->bswenc) ? pattrib->icv_len : 0); /*  ICV */
-
-   return len;
-}
-
-/*
 
 This sub-routine will perform all the following:
 
diff --git a/drivers/staging/rtl8723au/include/rtw_xmit.h 
b/drivers/staging/rtl8723au/include/rtw_xmit.h
index 73e5f9c..3618432 100644
--- a/drivers/staging/rtl8723au/include/rtw_xmit.h
+++ b/drivers/staging/rtl8723au/include/rtw_xmit.h
@@ -354,8 +354,6 @@ struct xmit_frame *rtw_dequeue_xframe23a(struct xmit_priv 
*pxmitpriv,
  struct hw_xmit *phwxmit_i, int entry);
 s32 rtw_xmit23a_classifier(struct rtw_adapter *padapter,
struct xmit_frame *pxmitframe);
-u32 rtw_calculate_wlan_pkt_size_by_attribue23a(struct pkt_attrib *pattrib);
-#define rtw_wlan_pkt_size(f) 
rtw_calculate_wlan_pkt_size_by_attribue23a(&f->attrib)
 s32 rtw_xmitframe_coalesce23a(struct rtw_adapter *padapter, struct sk_buff 
*pkt,
  struct xmit_frame *pxmitframe);
 s32 _rtw_init_hw_txqueue(struct hw_txqueue *phw_txqueue, u8 ac_tag);
-- 
1.9.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 05/10] staging: rtl8723au: portctrl(): Remove a pile of unnecessary clutter

2014-11-10 Thread Jes . Sorensen
From: Jes Sorensen 

Signed-off-by: Jes Sorensen 
---
 drivers/staging/rtl8723au/core/rtw_recv.c | 40 ---
 1 file changed, 4 insertions(+), 36 deletions(-)

diff --git a/drivers/staging/rtl8723au/core/rtw_recv.c 
b/drivers/staging/rtl8723au/core/rtw_recv.c
index de98da5..9d65393 100644
--- a/drivers/staging/rtl8723au/core/rtw_recv.c
+++ b/drivers/staging/rtl8723au/core/rtw_recv.c
@@ -568,59 +568,27 @@ static struct recv_frame *portctrl(struct rtw_adapter 
*adapter,
 ("portctrl:adapter->securitypriv.dot11AuthAlgrthm ="
  "%d\n", adapter->securitypriv.dot11AuthAlgrthm));
 
+   prtnframe = precv_frame;
+
if (auth_alg == dot11AuthAlgrthm_8021X) {
/* get ether_type */
ptr = pfhdr->pkt->data + pfhdr->attrib.hdrlen;
 
ether_type = (ptr[6] << 8) | ptr[7];
 
-   if ((psta != NULL) && (psta->ieee8021x_blocked)) {
+   if (psta && psta->ieee8021x_blocked) {
/* blocked */
/* only accept EAPOL frame */
RT_TRACE(_module_rtl871x_recv_c_, _drv_info_,
 ("portctrl:psta->ieee8021x_blocked =="
  "1\n"));
 
-   if (ether_type == eapol_type) {
-   prtnframe = precv_frame;
-   } else {
+   if (ether_type != eapol_type) {
/* free this frame */
rtw_free_recvframe23a(precv_frame);
prtnframe = NULL;
}
-   } else {
-   /* allowed */
-   /* check decryption status, and decrypt the frame if 
needed */
-   RT_TRACE(_module_rtl871x_recv_c_, _drv_info_,
-("portctrl:psta->ieee8021x_blocked =="
- "0\n"));
-   RT_TRACE(_module_rtl871x_recv_c_, _drv_info_,
-("portctrl:precv_frame->hdr.attrib.privacy ="
- "%x\n", precv_frame->attrib.privacy));
-
-   if (pattrib->bdecrypted == 0) {
-   RT_TRACE(_module_rtl871x_recv_c_, _drv_info_,
-("portctrl:prxstat->decrypted =%x\n",
- pattrib->bdecrypted));
-   }
-
-   prtnframe = precv_frame;
-   /* check is the EAPOL frame or not (Rekey) */
-   if (ether_type == eapol_type) {
-   RT_TRACE(_module_rtl871x_recv_c_, _drv_notice_,
-("portctrl:ether_type == "
- "0x888e\n"));
-   /* check Rekey */
-
-   prtnframe = precv_frame;
-   } else {
-   RT_TRACE(_module_rtl871x_recv_c_, _drv_info_,
-("portctrl:ether_type = 0x%04x"
- "\n", ether_type));
-   }
}
-   } else {
-   prtnframe = precv_frame;
}
 
return prtnframe;
-- 
1.9.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 07/10] staging: rtl8723au: pxmitframe->frame_tag is never set to a value > 8

2014-11-10 Thread Jes . Sorensen
From: Jes Sorensen 

No point of masking out high bits since we never set the value to
anything exceeding bits 0-3.

Signed-off-by: Jes Sorensen 
---
 drivers/staging/rtl8723au/core/rtw_xmit.c  |  2 +-
 drivers/staging/rtl8723au/hal/rtl8723au_xmit.c | 11 ++-
 2 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/rtl8723au/core/rtw_xmit.c 
b/drivers/staging/rtl8723au/core/rtw_xmit.c
index 5cbfab4..1f4ebb3 100644
--- a/drivers/staging/rtl8723au/core/rtw_xmit.c
+++ b/drivers/staging/rtl8723au/core/rtw_xmit.c
@@ -1291,7 +1291,7 @@ void rtw_count_tx_stats23a(struct rtw_adapter *padapter, 
struct xmit_frame *pxmi
struct xmit_priv*pxmitpriv = &padapter->xmitpriv;
struct mlme_priv*pmlmepriv = &padapter->mlmepriv;
 
-   if ((pxmitframe->frame_tag&0x0f) == DATA_FRAMETAG) {
+   if (pxmitframe->frame_tag == DATA_FRAMETAG) {
pxmitpriv->tx_bytes += sz;
pmlmepriv->LinkDetectInfo.NumTxOkInPeriod++;
 
diff --git a/drivers/staging/rtl8723au/hal/rtl8723au_xmit.c 
b/drivers/staging/rtl8723au/hal/rtl8723au_xmit.c
index cf31d29..9cdd9e5 100644
--- a/drivers/staging/rtl8723au/hal/rtl8723au_xmit.c
+++ b/drivers/staging/rtl8723au/hal/rtl8723au_xmit.c
@@ -163,7 +163,7 @@ static s32 update_txdesc(struct xmit_frame *pxmitframe, u8 
*pmem, s32 sz, u8 bag
 
memset(ptxdesc, 0, sizeof(struct tx_desc));
 
-   if ((pxmitframe->frame_tag&0x0f) == DATA_FRAMETAG) {
+   if (pxmitframe->frame_tag == DATA_FRAMETAG) {
/* offset 4 */
ptxdesc->txdw1 |= cpu_to_le32(pattrib->mac_id&0x1f);
 
@@ -215,7 +215,7 @@ static s32 update_txdesc(struct xmit_frame *pxmitframe, u8 
*pmem, s32 sz, u8 bag
 
ptxdesc->txdw5 |= 
cpu_to_le32(MRateToHwRate23a(pmlmeext->tx_rate));
}
-   } else if ((pxmitframe->frame_tag&0x0f) == MGNT_FRAMETAG) {
+   } else if (pxmitframe->frame_tag == MGNT_FRAMETAG) {
/* offset 4 */
ptxdesc->txdw1 |= cpu_to_le32(pattrib->mac_id&0x1f);
 
@@ -240,10 +240,11 @@ static s32 update_txdesc(struct xmit_frame *pxmitframe, 
u8 *pmem, s32 sz, u8 bag
ptxdesc->txdw5 |= cpu_to_le32(0x0018);/* retry limit = 6 */
 
ptxdesc->txdw5 |= 
cpu_to_le32(MRateToHwRate23a(pmlmeext->tx_rate));
-   } else if ((pxmitframe->frame_tag&0x0f) == TXAGG_FRAMETAG) {
+   } else if (pxmitframe->frame_tag == TXAGG_FRAMETAG) {
DBG_8723A("pxmitframe->frame_tag == TXAGG_FRAMETAG\n");
} else {
-   DBG_8723A("pxmitframe->frame_tag = %d\n", 
pxmitframe->frame_tag);
+   DBG_8723A("pxmitframe->frame_tag = %d\n",
+ pxmitframe->frame_tag);
 
/* offset 4 */
ptxdesc->txdw1 |= cpu_to_le32((4)&0x1f);/* CAM_ID(MAC_ID) */
@@ -392,7 +393,7 @@ bool rtl8723au_xmitframe_complete(struct rtw_adapter 
*padapter,
 
pxmitbuf->priv_data = pxmitframe;
 
-   if ((pxmitframe->frame_tag&0x0f) == DATA_FRAMETAG) {
+   if (pxmitframe->frame_tag == DATA_FRAMETAG) {
if (pxmitframe->attrib.priority <= 15)/* TID0~15 */
res = rtw_xmitframe_coalesce23a(padapter, 
pxmitframe->pkt, pxmitframe);
 
-- 
1.9.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 04/10] staging: rtl8723au: rtw_put_snap23a(): Make it static

2014-11-10 Thread Jes . Sorensen
From: Jes Sorensen 

Signed-off-by: Jes Sorensen 
---
 drivers/staging/rtl8723au/core/rtw_xmit.c| 40 ++--
 drivers/staging/rtl8723au/include/rtw_xmit.h |  1 -
 2 files changed, 20 insertions(+), 21 deletions(-)

diff --git a/drivers/staging/rtl8723au/core/rtw_xmit.c 
b/drivers/staging/rtl8723au/core/rtw_xmit.c
index f8b1243..5cbfab4 100644
--- a/drivers/staging/rtl8723au/core/rtw_xmit.c
+++ b/drivers/staging/rtl8723au/core/rtw_xmit.c
@@ -1039,6 +1039,25 @@ s32 rtw_txframes_sta_ac_pending23a(struct rtw_adapter 
*padapter,
return ptxservq->qcnt;
 }
 
+/* Logical Link Control(LLC) SubNetwork Attachment Point(SNAP) header
+ * IEEE LLC/SNAP header contains 8 octets
+ * First 3 octets comprise the LLC portion
+ * SNAP portion, 5 octets, is divided into two fields:
+ * Organizationally Unique Identifier(OUI), 3 octets,
+ * type, defined by that organization, 2 octets.
+ */
+static int rtw_put_snap(u8 *data, u16 h_proto)
+{
+   if (h_proto == ETH_P_IPX || h_proto == ETH_P_AARP)
+   ether_addr_copy(data, bridge_tunnel_header);
+   else
+   ether_addr_copy(data, rfc1042_header);
+
+   data += ETH_ALEN;
+   put_unaligned_be16(h_proto, data);
+   return ETH_ALEN + sizeof(u16);
+}
+
 /*
 
 This sub-routine will perform all the following:
@@ -1162,7 +1181,7 @@ int rtw_xmitframe_coalesce23a(struct rtw_adapter 
*padapter, struct sk_buff *skb,
mpdu_len -= pattrib->iv_len;
}
if (frg_inx == 0) {
-   llc_sz = rtw_put_snap23a(pframe, pattrib->ether_type);
+   llc_sz = rtw_put_snap(pframe, pattrib->ether_type);
pframe += llc_sz;
mpdu_len -= llc_sz;
}
@@ -1232,25 +1251,6 @@ exit:
return res;
 }
 
-/* Logical Link Control(LLC) SubNetwork Attachment Point(SNAP) header
- * IEEE LLC/SNAP header contains 8 octets
- * First 3 octets comprise the LLC portion
- * SNAP portion, 5 octets, is divided into two fields:
- * Organizationally Unique Identifier(OUI), 3 octets,
- * type, defined by that organization, 2 octets.
- */
-s32 rtw_put_snap23a(u8 *data, u16 h_proto)
-{
-   if (h_proto == ETH_P_IPX || h_proto == ETH_P_AARP)
-   ether_addr_copy(data, bridge_tunnel_header);
-   else
-   ether_addr_copy(data, rfc1042_header);
-
-   data += ETH_ALEN;
-   put_unaligned_be16(h_proto, data);
-   return ETH_ALEN + sizeof(u16);
-}
-
 void rtw_update_protection23a(struct rtw_adapter *padapter, u8 *ie, uint 
ie_len)
 {
struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
diff --git a/drivers/staging/rtl8723au/include/rtw_xmit.h 
b/drivers/staging/rtl8723au/include/rtw_xmit.h
index 3618432..87097c4 100644
--- a/drivers/staging/rtl8723au/include/rtw_xmit.h
+++ b/drivers/staging/rtl8723au/include/rtw_xmit.h
@@ -340,7 +340,6 @@ s32 rtw_free_xmitbuf23a(struct xmit_priv *pxmitpriv, struct 
xmit_buf *pxmitbuf);
 void rtw_count_tx_stats23a(struct rtw_adapter *padapter,
struct xmit_frame *pxmitframe, int sz);
 void rtw_update_protection23a(struct rtw_adapter *padapter, u8 *ie, uint 
ie_len);
-s32 rtw_put_snap23a(u8 *data, u16 h_proto);
 struct xmit_frame *rtw_alloc_xmitframe23a_ext(struct xmit_priv *pxmitpriv);
 struct xmit_frame *rtw_alloc_xmitframe23a_once(struct xmit_priv *pxmitpriv);
 s32 rtw_free_xmitframe23a(struct xmit_priv *pxmitpriv,
-- 
1.9.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 06/10] staging: rtl8723au: rtw_dump_xframe(): Use proper ETH_P_* types

2014-11-10 Thread Jes . Sorensen
From: Jes Sorensen 

Signed-off-by: Jes Sorensen 
---
 drivers/staging/rtl8723au/hal/rtl8723au_xmit.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/rtl8723au/hal/rtl8723au_xmit.c 
b/drivers/staging/rtl8723au/hal/rtl8723au_xmit.c
index a67850f..cf31d29 100644
--- a/drivers/staging/rtl8723au/hal/rtl8723au_xmit.c
+++ b/drivers/staging/rtl8723au/hal/rtl8723au_xmit.c
@@ -306,10 +306,10 @@ static int rtw_dump_xframe(struct rtw_adapter *padapter,
struct pkt_attrib *pattrib = &pxmitframe->attrib;
struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
 
-   if ((pxmitframe->frame_tag == DATA_FRAMETAG) &&
-   (pxmitframe->attrib.ether_type != 0x0806) &&
-   (pxmitframe->attrib.ether_type != 0x888e) &&
-   (pxmitframe->attrib.dhcp_pkt != 1))
+   if (pxmitframe->frame_tag == DATA_FRAMETAG &&
+   pxmitframe->attrib.ether_type != ETH_P_ARP &&
+   pxmitframe->attrib.ether_type != ETH_P_PAE &&
+   pxmitframe->attrib.dhcp_pkt != 1)
rtw_issue_addbareq_cmd23a(padapter, pxmitframe);
 
mem_addr = pxmitframe->buf_addr;
-- 
1.9.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 03/10] staging: rtl8723au: rtw_put_snap23a(): Use put_unaligned to set protocol

2014-11-10 Thread Jes . Sorensen
From: Jes Sorensen 

Reported-by: Arend van Spriel 
Signed-off-by: Jes Sorensen 
---
 drivers/staging/rtl8723au/core/rtw_xmit.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8723au/core/rtw_xmit.c 
b/drivers/staging/rtl8723au/core/rtw_xmit.c
index 18a9f34..f8b1243 100644
--- a/drivers/staging/rtl8723au/core/rtw_xmit.c
+++ b/drivers/staging/rtl8723au/core/rtw_xmit.c
@@ -1247,7 +1247,7 @@ s32 rtw_put_snap23a(u8 *data, u16 h_proto)
ether_addr_copy(data, rfc1042_header);
 
data += ETH_ALEN;
-   *(__be16 *)data = htons(h_proto);
+   put_unaligned_be16(h_proto, data);
return ETH_ALEN + sizeof(u16);
 }
 
-- 
1.9.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 02/10] staging rtl8723au: rtw_put_smap23a(): Use common SNAP header defines

2014-11-10 Thread Jes . Sorensen
From: Jes Sorensen 

Signed-off-by: Jes Sorensen 
---
 drivers/staging/rtl8723au/core/rtw_xmit.c | 26 +++---
 1 file changed, 7 insertions(+), 19 deletions(-)

diff --git a/drivers/staging/rtl8723au/core/rtw_xmit.c 
b/drivers/staging/rtl8723au/core/rtw_xmit.c
index b9ee983..18a9f34 100644
--- a/drivers/staging/rtl8723au/core/rtw_xmit.c
+++ b/drivers/staging/rtl8723au/core/rtw_xmit.c
@@ -22,9 +22,6 @@
 #include 
 #include 
 
-static u8 P802_1H_OUI[P80211_OUI_LEN] = { 0x00, 0x00, 0xf8 };
-static u8 RFC1042_OUI[P80211_OUI_LEN] = { 0x00, 0x00, 0x00 };
-
 static void _init_txservq(struct tx_servq *ptxservq)
 {
 
@@ -1244,23 +1241,14 @@ exit:
  */
 s32 rtw_put_snap23a(u8 *data, u16 h_proto)
 {
-   struct ieee80211_snap_hdr *snap;
-   u8 *oui;
-
-   snap = (struct ieee80211_snap_hdr *)data;
-   snap->dsap = 0xaa;
-   snap->ssap = 0xaa;
-   snap->ctrl = 0x03;
-
-   if (h_proto == 0x8137 || h_proto == 0x80f3)
-   oui = P802_1H_OUI;
+   if (h_proto == ETH_P_IPX || h_proto == ETH_P_AARP)
+   ether_addr_copy(data, bridge_tunnel_header);
else
-   oui = RFC1042_OUI;
-   snap->oui[0] = oui[0];
-   snap->oui[1] = oui[1];
-   snap->oui[2] = oui[2];
-   *(__be16 *)(data + SNAP_SIZE) = htons(h_proto);
-   return SNAP_SIZE + sizeof(u16);
+   ether_addr_copy(data, rfc1042_header);
+
+   data += ETH_ALEN;
+   *(__be16 *)data = htons(h_proto);
+   return ETH_ALEN + sizeof(u16);
 }
 
 void rtw_update_protection23a(struct rtw_adapter *padapter, u8 *ie, uint 
ie_len)
-- 
1.9.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 08/10] staging: rtl8723au: Remove unused rtl8723a_update_txdesc() and child functions

2014-11-10 Thread Jes . Sorensen
From: Jes Sorensen 

Signed-off-by: Jes Sorensen 
---
 drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c | 248 --
 drivers/staging/rtl8723au/include/rtl8723a_xmit.h |   1 -
 2 files changed, 249 deletions(-)

diff --git a/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c 
b/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c
index 9a75eb6..8196a33 100644
--- a/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c
+++ b/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c
@@ -1975,254 +1975,6 @@ static void rtl8723a_cal_txdesc_chksum(struct tx_desc 
*ptxdesc)
ptxdesc->txdw7 |= cpu_to_le32(checksum & 0x);
 }
 
-static void fill_txdesc_sectype(struct pkt_attrib *pattrib,
-   struct txdesc_8723a *ptxdesc)
-{
-   if ((pattrib->encrypt > 0) && !pattrib->bswenc) {
-   switch (pattrib->encrypt) {
-   /*  SEC_TYPE */
-   case WLAN_CIPHER_SUITE_WEP40:
-   case WLAN_CIPHER_SUITE_WEP104:
-   case WLAN_CIPHER_SUITE_TKIP:
-   ptxdesc->sectype = 1;
-   break;
-
-   case WLAN_CIPHER_SUITE_CCMP:
-   ptxdesc->sectype = 3;
-   break;
-
-   case 0:
-   default:
-   break;
-   }
-   }
-}
-
-static void fill_txdesc_vcs(struct pkt_attrib *pattrib,
-   struct txdesc_8723a *ptxdesc)
-{
-   /* DBG_8723A("cvs_mode =%d\n", pattrib->vcs_mode); */
-
-   switch (pattrib->vcs_mode) {
-   case RTS_CTS:
-   ptxdesc->rtsen = 1;
-   break;
-
-   case CTS_TO_SELF:
-   ptxdesc->cts2self = 1;
-   break;
-
-   case NONE_VCS:
-   default:
-   break;
-   }
-
-   if (pattrib->vcs_mode) {
-   ptxdesc->hw_rts_en = 1; /*  ENABLE HW RTS */
-
-   /*  Set RTS BW */
-   if (pattrib->ht_en) {
-   if (pattrib->bwmode & HT_CHANNEL_WIDTH_40)
-   ptxdesc->rts_bw = 1;
-
-   switch (pattrib->ch_offset) {
-   case HAL_PRIME_CHNL_OFFSET_DONT_CARE:
-   ptxdesc->rts_sc = 0;
-   break;
-
-   case HAL_PRIME_CHNL_OFFSET_LOWER:
-   ptxdesc->rts_sc = 1;
-   break;
-
-   case HAL_PRIME_CHNL_OFFSET_UPPER:
-   ptxdesc->rts_sc = 2;
-   break;
-
-   default:
-   ptxdesc->rts_sc = 3;/*  Duplicate */
-   break;
-   }
-   }
-   }
-}
-
-static void fill_txdesc_phy(struct pkt_attrib *pattrib,
-   struct txdesc_8723a *ptxdesc)
-{
-   if (pattrib->ht_en) {
-   if (pattrib->bwmode & HT_CHANNEL_WIDTH_40)
-   ptxdesc->data_bw = 1;
-
-   switch (pattrib->ch_offset) {
-   case HAL_PRIME_CHNL_OFFSET_DONT_CARE:
-   ptxdesc->data_sc = 0;
-   break;
-
-   case HAL_PRIME_CHNL_OFFSET_LOWER:
-   ptxdesc->data_sc = 1;
-   break;
-
-   case HAL_PRIME_CHNL_OFFSET_UPPER:
-   ptxdesc->data_sc = 2;
-   break;
-
-   default:
-   ptxdesc->data_sc = 3;   /*  Duplicate */
-   break;
-   }
-   }
-}
-
-static void rtl8723a_fill_default_txdesc(struct xmit_frame *pxmitframe,
-u8 *pbuf)
-{
-   struct rtw_adapter *padapter;
-   struct hal_data_8723a *pHalData;
-   struct dm_priv *pdmpriv;
-   struct mlme_ext_priv *pmlmeext;
-   struct mlme_ext_info *pmlmeinfo;
-   struct pkt_attrib *pattrib;
-   struct txdesc_8723a *ptxdesc;
-   s32 bmcst;
-
-   padapter = pxmitframe->padapter;
-   pHalData = GET_HAL_DATA(padapter);
-   pdmpriv = &pHalData->dmpriv;
-   pmlmeext = &padapter->mlmeextpriv;
-   pmlmeinfo = &pmlmeext->mlmext_info;
-
-   pattrib = &pxmitframe->attrib;
-   bmcst = is_multicast_ether_addr(pattrib->ra);
-
-   ptxdesc = (struct txdesc_8723a *)pbuf;
-
-   if (pxmitframe->frame_tag == DATA_FRAMETAG) {
-   ptxdesc->macid = pattrib->mac_id;   /*  CAM_ID(MAC_ID) */
-
-   if (pattrib->ampdu_en == true)
-   ptxdesc->agg_en = 1;/*  AGG EN */
-   else
-   ptxdesc->bk = 1;/*  AGG BK */
-
-   ptxdesc->qsel 

[PATCH 10/10] staging: rtl8723au: Remove sw led handling

2014-11-10 Thread Jes . Sorensen
From: Jes Sorensen 

The rtl8723au relies on hw led support, so no point carrying a large
unused sw led infrastructure around.

Signed-off-by: Jes Sorensen 
---
 drivers/staging/rtl8723au/Makefile   |2 -
 drivers/staging/rtl8723au/core/rtw_cmd.c |6 -
 drivers/staging/rtl8723au/core/rtw_led.c | 1865 --
 drivers/staging/rtl8723au/core/rtw_mlme.c|5 -
 drivers/staging/rtl8723au/core/rtw_recv.c|3 -
 drivers/staging/rtl8723au/core/rtw_xmit.c|2 -
 drivers/staging/rtl8723au/hal/rtl8723au_led.c|  124 --
 drivers/staging/rtl8723au/hal/usb_halinit.c  |   18 -
 drivers/staging/rtl8723au/include/drv_types.h|2 -
 drivers/staging/rtl8723au/include/rtl8723a_led.h |   30 -
 drivers/staging/rtl8723au/include/rtw_cmd.h  |1 -
 drivers/staging/rtl8723au/include/rtw_led.h  |  181 ---
 drivers/staging/rtl8723au/os_dep/os_intfs.c  |   11 -
 drivers/staging/rtl8723au/os_dep/usb_intf.c  |2 -
 14 files changed, 2252 deletions(-)
 delete mode 100644 drivers/staging/rtl8723au/core/rtw_led.c
 delete mode 100644 drivers/staging/rtl8723au/hal/rtl8723au_led.c
 delete mode 100644 drivers/staging/rtl8723au/include/rtl8723a_led.h
 delete mode 100644 drivers/staging/rtl8723au/include/rtw_led.h

diff --git a/drivers/staging/rtl8723au/Makefile 
b/drivers/staging/rtl8723au/Makefile
index a9aae21..b184108 100644
--- a/drivers/staging/rtl8723au/Makefile
+++ b/drivers/staging/rtl8723au/Makefile
@@ -2,7 +2,6 @@ r8723au-y :=\
core/rtw_cmd.o  \
core/rtw_efuse.o\
core/rtw_ieee80211.o\
-   core/rtw_led.o  \
core/rtw_mlme.o \
core/rtw_mlme_ext.o \
core/rtw_pwrctrl.o  \
@@ -34,7 +33,6 @@ r8723au-y :=  \
hal/rtl8723a_rxdesc.o   \
hal/rtl8723a_sreset.o   \
hal/rtl8723a_xmit.o \
-   hal/rtl8723au_led.o \
hal/rtl8723au_recv.o\
hal/rtl8723au_xmit.o\
hal/usb_halinit.o   \
diff --git a/drivers/staging/rtl8723au/core/rtw_cmd.c 
b/drivers/staging/rtl8723au/core/rtw_cmd.c
index 44eae8e..77d43a5 100644
--- a/drivers/staging/rtl8723au/core/rtw_cmd.c
+++ b/drivers/staging/rtl8723au/core/rtw_cmd.c
@@ -391,8 +391,6 @@ int rtw_sitesurvey_cmd23a(struct rtw_adapter *padapter,
mod_timer(&pmlmepriv->scan_to_timer, jiffies +
  msecs_to_jiffies(SCANNING_TIMEOUT));
 
-   rtw_led_control(padapter, LED_CTL_SITE_SURVEY);
-
pmlmepriv->scan_interval = SCAN_INTERVAL;/*  30*2 sec = 60sec */
} else
_clr_fwstate_(pmlmepriv, _FW_UNDER_SURVEY);
@@ -417,8 +415,6 @@ int rtw_createbss_cmd23a(struct rtw_adapter  *padapter)
 
pdev_network = &padapter->registrypriv.dev_network;
 
-   rtw_led_control(padapter, LED_CTL_START_TO_LINK);
-
if (pmlmepriv->assoc_ssid.ssid_len == 0) {
RT_TRACE(_module_rtl871x_cmd_c_, _drv_info_,
 (" createbss for Any SSid:%s\n",
@@ -467,8 +463,6 @@ int rtw_joinbss_cmd23a(struct rtw_adapter *padapter,
 
ifmode = pnetwork->network.ifmode;
 
-   rtw_led_control(padapter, LED_CTL_START_TO_LINK);
-
if (pmlmepriv->assoc_ssid.ssid_len == 0) {
RT_TRACE(_module_rtl871x_cmd_c_, _drv_info_,
 ("+Join cmd: Any SSid\n"));
diff --git a/drivers/staging/rtl8723au/core/rtw_led.c 
b/drivers/staging/rtl8723au/core/rtw_led.c
deleted file mode 100644
index 92ab1f8..000
--- a/drivers/staging/rtl8723au/core/rtw_led.c
+++ /dev/null
@@ -1,1865 +0,0 @@
-/**
- *
- * Copyright(c) 2007 - 2012 Realtek Corporation. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- 
**/
-
-#include 
-#include 
-
-/*  */
-/* Description: */
-/* Callback function of LED BlinkTimer, */
-/* it just schedules to corresponding 
BlinkWorkItem/led_blink_hdl23a */
-/*  */
-static void BlinkTimerCallback(unsigned long data)
-{
-   struct led_8723a *pLed = (struct led_8723a *)data;
-   struct rtw_adapter *padapter = pLed->padapter;
-
-   /* DBG_8723A("%s\n", __func__); */
-
-   if ((padap

Re: [PATCH 03/10] staging: rtl8723au: rtw_put_snap23a(): Use put_unaligned to set protocol

2014-11-19 Thread Jes Sorensen
Dan Carpenter  writes:
> On Mon, Nov 10, 2014 at 06:11:39PM -0500, jes.soren...@redhat.com wrote:
>> diff --git a/drivers/staging/rtl8723au/core/rtw_xmit.c
>> b/drivers/staging/rtl8723au/core/rtw_xmit.c
>> index 18a9f34..f8b1243 100644
>> --- a/drivers/staging/rtl8723au/core/rtw_xmit.c
>> +++ b/drivers/staging/rtl8723au/core/rtw_xmit.c
>> @@ -1247,7 +1247,7 @@ s32 rtw_put_snap23a(u8 *data, u16 h_proto)
>>  ether_addr_copy(data, rfc1042_header);
>
> Doesn't the ether_add_copy() also require that data is aligned?
>
> regards,
> dan carpenter

Hi Dan,

Actually I think the other one was a false positive, and wasn't
necessary either. We're putting the data onto an xmit frame allocated
within the driver, so alignment ought to be safe.

Cheers,
Jes
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: rtl8723au: fix sparse warning

2014-11-19 Thread Jes Sorensen
Aleh Suprunovich  writes:
> drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c:747:1: warning: symbol
> 'rtl8723a_EfusePgPacketRead' was not declared. Should it be static?
>
> Function 'rtl8723a_EfusePgPacketRead' seems to be unused in current
> staging code.
>
> Before, it was available as 'static s32 Hal_EfusePgPacketRead',
> but code that was using it removed, in the same commit as rename and
> signature change to 'bool rtl8723a_EfusePgPacketRead' has taken place.
>
> Signed-off-by: Aleh Suprunovich 
> ---
>  drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c | 78 
> -------
>  1 file changed, 78 deletions(-)

Looks good to me

Signed-off-by: Jes Sorensen 

>
> diff --git a/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c 
> b/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c
> index 9a75eb6..3e61a45 100644
> --- a/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c
> +++ b/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c
> @@ -743,84 +743,6 @@ u16 rtl8723a_EfuseGetCurrentSize_BT(struct rtw_adapter 
> *padapter)
>   return retU2;
>  }
>  
> -bool
> -rtl8723a_EfusePgPacketRead(struct rtw_adapter *padapter, u8 offset, u8 *data)
> -{
> - u8 efuse_data, word_cnts = 0;
> - u16 efuse_addr = 0;
> - u8 hoffset = 0, hworden = 0;
> - u8 i;
> - u8 max_section = 0;
> - s32 ret;
> -
> - if (data == NULL)
> - return false;
> -
> - EFUSE_GetEfuseDefinition23a(padapter, EFUSE_WIFI, 
> TYPE_EFUSE_MAX_SECTION,
> -  &max_section);
> - if (offset > max_section) {
> - DBG_8723A("%s: Packet offset(%d) is illegal(>%d)!\n",
> -   __func__, offset, max_section);
> - return false;
> - }
> -
> - memset(data, 0xFF, PGPKT_DATA_SIZE);
> - ret = true;
> -
> - /*  */
> - /*   Efuse has been pre-programmed dummy 5Bytes at the
> - end of Efuse by CP. */
> - /*  Skip dummy parts to prevent unexpected data read from Efuse. */
> - /*  By pass right now. 2009.02.19. */
> - /*  */
> - while (AVAILABLE_EFUSE_ADDR(efuse_addr)) {
> - if (efuse_OneByteRead23a(padapter, efuse_addr++, &efuse_data) ==
> - _FAIL) {
> - ret = false;
> - break;
> - }
> -
> - if (efuse_data == 0xFF)
> - break;
> -
> - if (EXT_HEADER(efuse_data)) {
> - hoffset = GET_HDR_OFFSET_2_0(efuse_data);
> - efuse_OneByteRead23a(padapter, efuse_addr++, 
> &efuse_data);
> - if (ALL_WORDS_DISABLED(efuse_data)) {
> - DBG_8723A("%s: Error!! All words disabled!\n",
> -   __func__);
> - continue;
> - }
> -
> - hoffset |= ((efuse_data & 0xF0) >> 1);
> - hworden = efuse_data & 0x0F;
> - } else {
> - hoffset = (efuse_data >> 4) & 0x0F;
> - hworden = efuse_data & 0x0F;
> - }
> -
> - if (hoffset == offset) {
> - for (i = 0; i < EFUSE_MAX_WORD_UNIT; i++) {
> - /* Check word enable condition in the section */
> - if (!(hworden & (0x01 << i))) {
> - ReadEFuseByte23a(padapter, efuse_addr++,
> -   &efuse_data);
> - data[i * 2] = efuse_data;
> -
> - ReadEFuseByte23a(padapter, efuse_addr++,
> -   &efuse_data);
> - data[(i * 2) + 1] = efuse_data;
> - }
> - }
> - } else {
> - word_cnts = Efuse_CalculateWordCnts23a(hworden);
> - efuse_addr += word_cnts * 2;
> - }
> - }
> -
> - return ret;
> -}
> -
>  void rtl8723a_read_chip_version(struct rtw_adapter *padapter)
>  {
>   u32 value32;
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging:rtl8723au: fix sparse warning: incorrect type in assignment

2014-11-19 Thread Jes Sorensen
Kinka Huang  writes:
> Signed-off-by: Kinka Huang 
> ---
>  drivers/staging/rtl8723au/core/rtw_mlme.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Eeeek, nice catch!

Acked-by: Jes Sorensen 

>
> diff --git a/drivers/staging/rtl8723au/core/rtw_mlme.c 
> b/drivers/staging/rtl8723au/core/rtw_mlme.c
> index 85d1eca..6c1a7fb 100644
> --- a/drivers/staging/rtl8723au/core/rtw_mlme.c
> +++ b/drivers/staging/rtl8723au/core/rtw_mlme.c
> @@ -2158,9 +2158,9 @@ bool rtw_restructure_ht_ie23a(struct rtw_adapter 
> *padapter, u8 *in_ie,
>  
>   memset(&ht_capie, 0, sizeof(struct ieee80211_ht_cap));
>  
> - ht_capie.cap_info = IEEE80211_HT_CAP_SUP_WIDTH_20_40 |
> + ht_capie.cap_info = 
> cpu_to_le16(IEEE80211_HT_CAP_SUP_WIDTH_20_40 |
>   IEEE80211_HT_CAP_SGI_20 | IEEE80211_HT_CAP_SGI_40 |
> - IEEE80211_HT_CAP_TX_STBC | IEEE80211_HT_CAP_DSSSCCK40;
> + IEEE80211_HT_CAP_TX_STBC | IEEE80211_HT_CAP_DSSSCCK40);
>  
>   GetHalDefVar8192CUsb(padapter, HAL_DEF_RX_PACKET_OFFSET,
>&rx_packet_offset);
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] Drivers:staging:rtl8723au:core: Fixed checkpatch error

2014-11-28 Thread Jes Sorensen
Athira Lekshmi  writes:
> Fixed the checkpatch error:
> ERROR: spaces required around that '>'
>
> Signed-off-by: Athira Lekshmi 
> ---
>  drivers/staging/rtl8723au/core/rtw_cmd.c |4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/staging/rtl8723au/core/rtw_cmd.c 
> b/drivers/staging/rtl8723au/core/rtw_cmd.c
> index 44eae8e..9f1cdd4 100644
> --- a/drivers/staging/rtl8723au/core/rtw_cmd.c
> +++ b/drivers/staging/rtl8723au/core/rtw_cmd.c
> @@ -960,7 +960,7 @@ static void traffic_status_watchdog(struct rtw_adapter 
> *padapter)
>   /*  check traffic for  powersaving. */
>   if (((pmlmepriv->LinkDetectInfo.NumRxUnicastOkInPeriod +
> pmlmepriv->LinkDetectInfo.NumTxOkInPeriod) > 8) ||
> - pmlmepriv->LinkDetectInfo.NumRxUnicastOkInPeriod >2)
> + pmlmepriv->LinkDetectInfo.NumRxUnicastOkInPeriod > 
> 2)
>   bEnterPS = false;
>   else
>   bEnterPS = true;

NACK - I already stated this! Making the line longer than 80 characters
is worse then the 'problem' this fixes.

Jes
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 01/28] staging: rtl8723au: recv_priv.is_signal_dbg is never set

2014-11-30 Thread Jes . Sorensen
From: Jes Sorensen 

Signed-off-by: Jes Sorensen 
---
 drivers/staging/rtl8723au/core/rtw_recv.c| 104 ---
 drivers/staging/rtl8723au/include/rtw_recv.h |   2 -
 2 files changed, 46 insertions(+), 60 deletions(-)

diff --git a/drivers/staging/rtl8723au/core/rtw_recv.c 
b/drivers/staging/rtl8723au/core/rtw_recv.c
index 8dd3513..5b15c4a 100644
--- a/drivers/staging/rtl8723au/core/rtw_recv.c
+++ b/drivers/staging/rtl8723au/core/rtw_recv.c
@@ -2314,66 +2314,54 @@ void rtw_signal_stat_timer_hdl23a(unsigned long data)
u8 _alpha = 3;  /* this value is based on converging_constant = 5000 */
/* and sampling_interval = 1000 */
 
-   if (adapter->recvpriv.is_signal_dbg) {
-   /* update the user specific value, signal_strength_dbg, */
-   /* to signal_strength, rssi */
-   adapter->recvpriv.signal_strength =
-   adapter->recvpriv.signal_strength_dbg;
-   adapter->recvpriv.rssi =
-   
(s8)translate_percentage_to_dbm((u8)adapter->recvpriv.signal_strength_dbg);
-   } else {
-   if (recvpriv->signal_strength_data.update_req == 0) {
-   /*  update_req is clear, means we got rx */
-   avg_signal_strength =
-   recvpriv->signal_strength_data.avg_val;
-   num_signal_strength =
-   recvpriv->signal_strength_data.total_num;
-   /*  after avg_vals are acquired, we can re-stat */
-   /* the signal values */
-   recvpriv->signal_strength_data.update_req = 1;
-   }
+   if (recvpriv->signal_strength_data.update_req == 0) {
+   /*  update_req is clear, means we got rx */
+   avg_signal_strength = recvpriv->signal_strength_data.avg_val;
+   num_signal_strength = recvpriv->signal_strength_data.total_num;
+   /*  after avg_vals are acquired, we can re-stat */
+   /* the signal values */
+   recvpriv->signal_strength_data.update_req = 1;
+   }
+
+   if (recvpriv->signal_qual_data.update_req == 0) {
+   /*  update_req is clear, means we got rx */
+   avg_signal_qual = recvpriv->signal_qual_data.avg_val;
+   num_signal_qual = recvpriv->signal_qual_data.total_num;
+   /*  after avg_vals are acquired, we can re-stat */
+   /*the signal values */
+   recvpriv->signal_qual_data.update_req = 1;
+   }
+
+   /* update value of signal_strength, rssi, signal_qual */
+   if (!check_fwstate(&adapter->mlmepriv, _FW_UNDER_SURVEY)) {
+   tmp_s = (avg_signal_strength + (_alpha - 1) *
+recvpriv->signal_strength);
+   if (tmp_s %_alpha)
+   tmp_s = tmp_s / _alpha + 1;
+   else
+   tmp_s = tmp_s / _alpha;
+   if (tmp_s > 100)
+   tmp_s = 100;
 
-   if (recvpriv->signal_qual_data.update_req == 0) {
-   /*  update_req is clear, means we got rx */
-   avg_signal_qual = recvpriv->signal_qual_data.avg_val;
-   num_signal_qual = recvpriv->signal_qual_data.total_num;
-   /*  after avg_vals are acquired, we can re-stat */
-   /*the signal values */
-   recvpriv->signal_qual_data.update_req = 1;
-   }
+   tmp_q = avg_signal_qual + (_alpha - 1) * recvpriv->signal_qual;
+   if (tmp_q %_alpha)
+   tmp_q = tmp_q / _alpha + 1;
+   else
+   tmp_q = tmp_q / _alpha;
+   if (tmp_q > 100)
+   tmp_q = 100;
 
-   /* update value of signal_strength, rssi, signal_qual */
-   if (!check_fwstate(&adapter->mlmepriv, _FW_UNDER_SURVEY)) {
-   tmp_s = (avg_signal_strength + (_alpha - 1) *
-recvpriv->signal_strength);
-   if (tmp_s %_alpha)
-   tmp_s = tmp_s / _alpha + 1;
-   else
-   tmp_s = tmp_s / _alpha;
-   if (tmp_s > 100)
-   tmp_s = 100;
-
-   tmp_q = (avg_signal_qual + (_alpha - 1) *
-recvpriv->signal_qual);
-   if (tmp_q %_alpha)
-   tmp_q = tmp_q / _alpha + 1;
-   else
-   tmp_q = tmp_q / _alpha;
-   if (tmp_q > 100)
-   tmp_q = 100;
-
-   recvpriv->

[PATCH 14/28] staging: rtl8723au: Fold _ps_open_RF23a() into rtl8723au_hal_init()

2014-11-30 Thread Jes . Sorensen
From: Jes Sorensen 

Signed-off-by: Jes Sorensen 
---
 drivers/staging/rtl8723au/hal/usb_halinit.c | 16 +++-
 1 file changed, 7 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/rtl8723au/hal/usb_halinit.c 
b/drivers/staging/rtl8723au/hal/usb_halinit.c
index 6c66013..cd3f8ba 100644
--- a/drivers/staging/rtl8723au/hal/usb_halinit.c
+++ b/drivers/staging/rtl8723au/hal/usb_halinit.c
@@ -25,6 +25,10 @@
 
 #include 
 
+static void phy_SsPwrSwitch92CU(struct rtw_adapter *Adapter,
+   enum rt_rf_power_state eRFPowerState,
+   int bRegSSPwrLvl);
+
 static void
 _ConfigChipOutEP(struct rtw_adapter *pAdapter, u8 NumOutPipe)
 {
@@ -495,8 +499,6 @@ enum rt_rf_power_state RfOnOffDetect23a(struct rtw_adapter 
*pAdapter)
return rfpowerstate;
 }
 
-void _ps_open_RF23a(struct rtw_adapter *padapter);
-
 int rtl8723au_hal_init(struct rtw_adapter *Adapter)
 {
u8 val8 = 0;
@@ -511,7 +513,9 @@ int rtl8723au_hal_init(struct rtw_adapter *Adapter)
Adapter->hw_init_completed = false;
 
if (Adapter->pwrctrlpriv.bkeepfwalive) {
-   _ps_open_RF23a(Adapter);
+   /* here call with bRegSSPwrLvl 1, bRegSSPwrLvl 2
+  needs to be verified */
+   phy_SsPwrSwitch92CU(Adapter, rf_on, 1);
 
if (pHalData->bIQKInitialized) {
rtl8723a_phy_iq_calibrate(Adapter, true);
@@ -1027,12 +1031,6 @@ static void phy_SsPwrSwitch92CU(struct rtw_adapter 
*Adapter,
 
 }  /*  phy_PowerSwitch92CU */
 
-void _ps_open_RF23a(struct rtw_adapter *padapter)
-{
-   /* here call with bRegSSPwrLvl 1, bRegSSPwrLvl 2 needs to be verified */
-   phy_SsPwrSwitch92CU(padapter, rf_on, 1);
-}
-
 static void CardDisableRTL8723U(struct rtw_adapter *Adapter)
 {
u8  u1bTmp;
-- 
1.9.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 23/28] staging: rtl8723au: _DisableRFAFEAndResetBB8192C(): Reduce code obfuscation

2014-11-30 Thread Jes . Sorensen
From: Jes Sorensen 

Signed-off-by: Jes Sorensen 
---
 drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c | 7 +++
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c 
b/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c
index d2b4fb0..3aa20f6 100644
--- a/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c
+++ b/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c
@@ -1253,18 +1253,17 @@ c.  APSD_CTRL 0x600[7:0] = 0x40
 d. SYS_FUNC_EN 0x02[7:0] = 0x16reset BB state machine
 e. SYS_FUNC_EN 0x02[7:0] = 0x14reset BB state machine
 ***/
-   u8 value8 = 0;
+   u8 value8;
 
rtl8723au_write8(padapter, REG_TXPAUSE, 0xFF);
 
PHY_SetRFReg(padapter, RF_PATH_A, 0x0, bMaskByte0, 0x0);
 
-   value8 |= APSDOFF;
+   value8 = APSDOFF;
rtl8723au_write8(padapter, REG_APSD_CTRL, value8);  /* 0x40 */
 
/*  Set BB reset at first */
-   value8 = 0;
-   value8 |= (FEN_USBD | FEN_USBA | FEN_BB_GLB_RSTn);
+   value8 = FEN_USBD | FEN_USBA | FEN_BB_GLB_RSTn;
rtl8723au_write8(padapter, REG_SYS_FUNC_EN, value8);/* 0x16 */
 
/*  Set global reset. */
-- 
1.9.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 06/28] staging: rtl8723au: Eliminate do_queue_select() functions

2014-11-30 Thread Jes . Sorensen
From: Jes Sorensen 

Signed-off-by: Jes Sorensen 
---
 drivers/staging/rtl8723au/core/rtw_xmit.c  | 14 +-
 drivers/staging/rtl8723au/hal/rtl8723au_xmit.c | 14 +-
 2 files changed, 2 insertions(+), 26 deletions(-)

diff --git a/drivers/staging/rtl8723au/core/rtw_xmit.c 
b/drivers/staging/rtl8723au/core/rtw_xmit.c
index c79d5b9..00a04af 100644
--- a/drivers/staging/rtl8723au/core/rtw_xmit.c
+++ b/drivers/staging/rtl8723au/core/rtw_xmit.c
@@ -1858,18 +1858,6 @@ u32 rtw_get_ff_hwaddr23a(struct xmit_frame *pxmitframe)
return addr;
 }
 
-static void do_queue_select(struct rtw_adapter *padapter, struct pkt_attrib 
*pattrib)
-{
-   u8 qsel;
-
-   qsel = pattrib->priority;
-   RT_TRACE(_module_rtl871x_xmit_c_, _drv_info_,
-("### do_queue_select priority =%d , qsel = %d\n",
- pattrib->priority, qsel));
-
-   pattrib->qsel = qsel;
-}
-
 /*
  * The main transmit(tx) entry
  *
@@ -1901,7 +1889,7 @@ int rtw_xmit23a(struct rtw_adapter *padapter, struct 
sk_buff *skb)
}
pxmitframe->pkt = skb;
 
-   do_queue_select(padapter, &pxmitframe->attrib);
+   pxmitframe->attrib.qsel = pxmitframe->attrib.priority;
 
 #ifdef CONFIG_8723AU_AP_MODE
spin_lock_bh(&pxmitpriv->lock);
diff --git a/drivers/staging/rtl8723au/hal/rtl8723au_xmit.c 
b/drivers/staging/rtl8723au/hal/rtl8723au_xmit.c
index 9cdd9e5..6070510 100644
--- a/drivers/staging/rtl8723au/hal/rtl8723au_xmit.c
+++ b/drivers/staging/rtl8723au/hal/rtl8723au_xmit.c
@@ -21,18 +21,6 @@
 /* include  */
 #include 
 
-static void do_queue_select(struct rtw_adapter *padapter, struct pkt_attrib 
*pattrib)
-{
-   u8 qsel;
-
-   qsel = pattrib->priority;
-   RT_TRACE(_module_rtl871x_xmit_c_, _drv_info_,
-("### do_queue_select priority =%d , qsel = %d\n",
- pattrib->priority, qsel));
-
-   pattrib->qsel = qsel;
-}
-
 static int urb_zero_packet_chk(struct rtw_adapter *padapter, int sz)
 {
int blnSetTxDescOffset;
@@ -441,7 +429,7 @@ bool rtl8723au_hal_xmit(struct rtw_adapter *padapter,
struct pkt_attrib *pattrib = &pxmitframe->attrib;
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
 
-   do_queue_select(padapter, pattrib);
+   pattrib->qsel = pattrib->priority;
spin_lock_bh(&pxmitpriv->lock);
 
 #ifdef CONFIG_8723AU_AP_MODE
-- 
1.9.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 24/28] staging: rtl8723au: Remove unnecessary wrapper _DisableRFAFEAndResetBB()

2014-11-30 Thread Jes . Sorensen
From: Jes Sorensen 

Signed-off-by: Jes Sorensen 
---
 drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c | 9 ++---
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c 
b/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c
index 3aa20f6..5d2e774 100644
--- a/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c
+++ b/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c
@@ -1276,11 +1276,6 @@ e.   SYS_FUNC_EN 0x02[7:0] = 0x14reset 
BB state machine
 /* RT_TRACE(COMP_INIT, DBG_LOUD, ("==> RF off and reset BB.\n")); */
 }
 
-static void _DisableRFAFEAndResetBB(struct rtw_adapter *padapter)
-{
-   _DisableRFAFEAndResetBB8192C(padapter);
-}
-
 static void _ResetDigitalProcedure1_92C(struct rtw_adapter *padapter,
bool bWithoutHWSM)
 {
@@ -1452,7 +1447,7 @@ int CardDisableHWSM(struct rtw_adapter *padapter, u8 
resetMCU)
return _SUCCESS;
}
/*  RF Off Sequence  */
-   _DisableRFAFEAndResetBB(padapter);
+   _DisableRFAFEAndResetBB8192C(padapter);
 
/*    Reset digital sequence   == */
_ResetDigitalProcedure1(padapter, false);
@@ -1477,7 +1472,7 @@ int CardDisableWithoutHWSM(struct rtw_adapter *padapter)
}
 
/*  RF Off Sequence  */
-   _DisableRFAFEAndResetBB(padapter);
+   _DisableRFAFEAndResetBB8192C(padapter);
 
/*    Reset digital sequence   == */
_ResetDigitalProcedure1(padapter, true);
-- 
1.9.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 10/28] staging: rtl8723au: _InitPowerOn(): Don't zero init variables unnecessarily

2014-11-30 Thread Jes . Sorensen
From: Jes Sorensen 

Signed-off-by: Jes Sorensen 
---
 drivers/staging/rtl8723au/hal/usb_halinit.c | 7 +++
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/rtl8723au/hal/usb_halinit.c 
b/drivers/staging/rtl8723au/hal/usb_halinit.c
index b8d5040..3b09dc2 100644
--- a/drivers/staging/rtl8723au/hal/usb_halinit.c
+++ b/drivers/staging/rtl8723au/hal/usb_halinit.c
@@ -80,9 +80,8 @@ bool rtl8723au_chip_configure(struct rtw_adapter *padapter)
 
 static int _InitPowerOn(struct rtw_adapter *padapter)
 {
-   int status = _SUCCESS;
-   u16 value16 = 0;
-   u8 value8 = 0;
+   u16 value16;
+   u8 value8;
 
/*  RSV_CTRL 0x1C[7:0] = 0x00
unlock ISO/CLK/Power control register */
@@ -109,7 +108,7 @@ static int _InitPowerOn(struct rtw_adapter *padapter)
/* for Efuse PG, suggest by Jackie 2011.11.23 */
PHY_SetBBReg(padapter, REG_EFUSE_CTRL, BIT(28)|BIT(29)|BIT(30), 0x06);
 
-   return status;
+   return _SUCCESS;
 }
 
 /*  Shall USB interface init this? */
-- 
1.9.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 02/28] staging: rtl8723au: recv_priv->rssi is not used for anything

2014-11-30 Thread Jes . Sorensen
From: Jes Sorensen 

Signed-off-by: Jes Sorensen 
---
 drivers/staging/rtl8723au/core/rtw_mlme.c|  6 ++
 drivers/staging/rtl8723au/core/rtw_recv.c| 10 --
 drivers/staging/rtl8723au/include/rtw_recv.h |  1 -
 3 files changed, 6 insertions(+), 11 deletions(-)

diff --git a/drivers/staging/rtl8723au/core/rtw_mlme.c 
b/drivers/staging/rtl8723au/core/rtw_mlme.c
index 734972c..7299ef0 100644
--- a/drivers/staging/rtl8723au/core/rtw_mlme.c
+++ b/drivers/staging/rtl8723au/core/rtw_mlme.c
@@ -1022,11 +1022,9 @@ rtw_joinbss_update_network23a(struct rtw_adapter 
*padapter,
 * the ptarget_wlan->network.Rssi is raw data, we use
 * ptarget_wlan->network.SignalStrength instead (has scaled)
 */
-   padapter->recvpriv.rssi = translate_percentage_to_dbm(
-   ptarget_wlan->network.SignalStrength);
-   DBG_8723A("%s signal_strength:%3u, rssi:%3d, signal_qual:%3u\n",
+   DBG_8723A("%s signal_strength:%3u, signal_qual:%3u\n",
  __func__, padapter->recvpriv.signal_strength,
- padapter->recvpriv.rssi, padapter->recvpriv.signal_qual);
+ padapter->recvpriv.signal_qual);
rtw_set_signal_stat_timer(&padapter->recvpriv);
 
/* update fw_state will clr _FW_UNDER_LINKING here indirectly */
diff --git a/drivers/staging/rtl8723au/core/rtw_recv.c 
b/drivers/staging/rtl8723au/core/rtw_recv.c
index 5b15c4a..559ddde 100644
--- a/drivers/staging/rtl8723au/core/rtw_recv.c
+++ b/drivers/staging/rtl8723au/core/rtw_recv.c
@@ -2352,15 +2352,13 @@ void rtw_signal_stat_timer_hdl23a(unsigned long data)
tmp_q = 100;
 
recvpriv->signal_strength = tmp_s;
-   recvpriv->rssi = (s8)translate_percentage_to_dbm(tmp_s);
recvpriv->signal_qual = tmp_q;
 
-   DBG_8723A("%s signal_strength:%3u, rssi:%3d, "
- "signal_qual:%3u, num_signal_strength:%u, "
- "num_signal_qual:%u\n",
+   DBG_8723A("%s signal_strength:%3u, signal_qual:%3u, "
+ "num_signal_strength:%u, num_signal_qual:%u\n",
  __func__, recvpriv->signal_strength,
- recvpriv->rssi, recvpriv->signal_qual,
- num_signal_strength, num_signal_qual);
+ recvpriv->signal_qual, num_signal_strength,
+ num_signal_qual);
}
 
rtw_set_signal_stat_timer(recvpriv);
diff --git a/drivers/staging/rtl8723au/include/rtw_recv.h 
b/drivers/staging/rtl8723au/include/rtw_recv.h
index 79656ee..dc784be 100644
--- a/drivers/staging/rtl8723au/include/rtw_recv.h
+++ b/drivers/staging/rtl8723au/include/rtw_recv.h
@@ -200,7 +200,6 @@ struct recv_priv {
u8 *precv_buf;
 
/* For display the phy informatiom */
-   s8 rssi;
s8 rxpwdb;
u8 signal_strength;
u8 signal_qual;
-- 
1.9.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 20/28] staging: rtl8723au: rtl8723a_update_ramask(): Fix up some bad formatting

2014-11-30 Thread Jes . Sorensen
From: Jes Sorensen 

Signed-off-by: Jes Sorensen 
---
 drivers/staging/rtl8723au/hal/usb_halinit.c | 37 ++---
 1 file changed, 18 insertions(+), 19 deletions(-)

diff --git a/drivers/staging/rtl8723au/hal/usb_halinit.c 
b/drivers/staging/rtl8723au/hal/usb_halinit.c
index b15edc9..febe5ce 100644
--- a/drivers/staging/rtl8723au/hal/usb_halinit.c
+++ b/drivers/staging/rtl8723au/hal/usb_halinit.c
@@ -1202,17 +1202,17 @@ int GetHalDefVar8192CUsb(struct rtw_adapter *Adapter,
 void rtl8723a_update_ramask(struct rtw_adapter *padapter,
u32 mac_id, u8 rssi_level)
 {
-   u8  init_rate = 0;
-   u8  networkType, raid;
-   u32 mask, rate_bitmap;
-   u8  shortGIrate = false;
-   int supportRateNum = 0;
struct sta_info *psta;
-   struct hal_data_8723a   *pHalData = GET_HAL_DATA(padapter);
-   struct dm_priv  *pdmpriv = &pHalData->dmpriv;
+   struct FW_Sta_Info *fw_sta;
+   struct hal_data_8723a *pHalData = GET_HAL_DATA(padapter);
+   struct dm_priv *pdmpriv = &pHalData->dmpriv;
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
struct wlan_bssid_ex *cur_network = &pmlmeinfo->network;
+   u8 init_rate, networkType, raid;
+   u32 mask, rate_bitmap;
+   u8 shortGIrate = false;
+   int supportRateNum;
 
if (mac_id >= NUM_STA) /* CAM_SIZE */
return;
@@ -1241,8 +1241,8 @@ void rtl8723a_update_ramask(struct rtw_adapter *padapter,
break;
 
case 1:/* for broadcast/multicast */
-   supportRateNum = rtw_get_rateset_len23a(
-   pmlmeinfo->FW_sta_info[mac_id].SupportedRates);
+   fw_sta = &pmlmeinfo->FW_sta_info[mac_id]; 
+   supportRateNum = rtw_get_rateset_len23a(fw_sta->SupportedRates);
if (pmlmeext->cur_wireless_mode & WIRELESS_11B)
networkType = WIRELESS_11B;
else
@@ -1254,16 +1254,16 @@ void rtl8723a_update_ramask(struct rtw_adapter 
*padapter,
break;
 
default: /* for each sta in IBSS */
-   supportRateNum = rtw_get_rateset_len23a(
-   pmlmeinfo->FW_sta_info[mac_id].SupportedRates);
+   fw_sta = &pmlmeinfo->FW_sta_info[mac_id]; 
+   supportRateNum = rtw_get_rateset_len23a(fw_sta->SupportedRates);
networkType = judge_network_type23a(padapter,
-
pmlmeinfo->FW_sta_info[mac_id].SupportedRates,
-supportRateNum) & 0xf;
+   fw_sta->SupportedRates,
+   supportRateNum) & 0xf;
/* pmlmeext->cur_wireless_mode = networkType; */
raid = networktype_to_raid23a(networkType);
 
mask = update_supported_rate23a(cur_network->SupportedRates,
-supportRateNum);
+   supportRateNum);
 
/* todo: support HT in IBSS */
break;
@@ -1277,15 +1277,14 @@ void rtl8723a_update_ramask(struct rtw_adapter 
*padapter,
  __func__, mac_id, networkType, mask, rssi_level, rate_bitmap);
 
mask &= rate_bitmap;
-   mask |= ((raid<<28)&0xf000);
+   mask |= ((raid << 28) & 0xf000);
 
-   init_rate = get_highest_rate_idx23a(mask)&0x3f;
+   init_rate = get_highest_rate_idx23a(mask) & 0x3f;
 
if (pHalData->fw_ractrl == true) {
u8 arg = 0;
 
-   /* arg = (cam_idx-4)&0x1f;MACID */
-   arg = mac_id&0x1f;/* MACID */
+   arg = mac_id & 0x1f;/* MACID */
 
arg |= BIT(7);
 
@@ -1300,7 +1299,7 @@ void rtl8723a_update_ramask(struct rtw_adapter *padapter,
if (shortGIrate == true)
init_rate |= BIT(6);
 
-   rtl8723au_write8(padapter, (REG_INIDATA_RATE_SEL+mac_id),
+   rtl8723au_write8(padapter, (REG_INIDATA_RATE_SEL + mac_id),
 init_rate);
}
 
-- 
1.9.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 11/28] staging: rtl8723au: Fold _InitNormalChipQueuePriority() into _InitQueuePriority()

2014-11-30 Thread Jes . Sorensen
From: Jes Sorensen 

Signed-off-by: Jes Sorensen 
---
 drivers/staging/rtl8723au/hal/usb_halinit.c | 7 +--
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/staging/rtl8723au/hal/usb_halinit.c 
b/drivers/staging/rtl8723au/hal/usb_halinit.c
index 3b09dc2..4cc0a0f 100644
--- a/drivers/staging/rtl8723au/hal/usb_halinit.c
+++ b/drivers/staging/rtl8723au/hal/usb_halinit.c
@@ -298,7 +298,7 @@ static void _InitNormalChipThreeOutEpPriority(struct 
rtw_adapter *Adapter)
_InitNormalChipRegPriority(Adapter, beQ, bkQ, viQ, voQ, mgtQ, hiQ);
 }
 
-static void _InitNormalChipQueuePriority(struct rtw_adapter *Adapter)
+static void _InitQueuePriority(struct rtw_adapter *Adapter)
 {
struct hal_data_8723a *pHalData = GET_HAL_DATA(Adapter);
 
@@ -318,11 +318,6 @@ static void _InitNormalChipQueuePriority(struct 
rtw_adapter *Adapter)
}
 }
 
-static void _InitQueuePriority(struct rtw_adapter *Adapter)
-{
-   _InitNormalChipQueuePriority(Adapter);
-}
-
 static void _InitTransferPageSize(struct rtw_adapter *Adapter)
 {
/*  Tx page size is always 128. */
-- 
1.9.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 00/28] staging: rtl8723au: Lazy Sunday fixes

2014-11-30 Thread Jes . Sorensen
From: Jes Sorensen 

Hi,

Pleased find attached a couple of fixes and cleanups for the rtl8723au
staging driver. One serious bug fixe in 13/28, but follow-on changes
showed the code was never actually called.

Should be good for staging-next, don't think any of it is more urgent
than that.

Cheers,
Jes


Jes Sorensen (28):
  staging: rtl8723au: recv_priv.is_signal_dbg is never set
  staging: rtl8723au: recv_priv->rssi is not used for anything
  staging: rtl8723au: Fold ODM_PhyStatusQuery23a_92CSeries() into
ODM_PhyStatusQuery23a()
  staging: rtl8732au: Partial clean up of rtl8723a_rf6052.c
  staging: rtl8723au: Fold rtw_ack_tx_done23a() into
rtw23a_sctx_done_err()
  staging: rtl8723au: Eliminate do_queue_select() functions
  staging: rtl8723au: Remove unused rtw_sctx_done23a() function
  staging: rtl8723au: Remove write only struct
hal_data_8723a.interfaceIndex
  staging: rtl8723au: Fold rtl8723au_set_queue_pipe_mapping into
rtl8723au_chip_configure()
  staging: rtl8723au: _InitPowerOn(): Don't zero init variables
unnecessarily
  staging: rtl8723au: Fold _InitNormalChipQueuePriority() into
_InitQueuePriority()
  staging: rtl8723au: Remove no-op _InitHWLed() function
  staging: rtl8723au: Do not write garbage to REG_SPS0_CTRL
  staging: rtl8723au: Fold _ps_open_RF23a() into rtl8723au_hal_init()
  staging: rtl8723au: phy_SsPwrSwitch92CU() was never called with
bRegSSPwrLvl != 1
  staging: rtl8723au: Use a local variable to state if MAC was already
powered on
  staging: rtl8723au: rtl8723au_read_port() addr argument wasn't used
  staging: rtl8723au: rtl8723au_read_interrupt() addr argument wasn't
used
  staging: rtl8723au: Remove unused slimcombo debug flag
  staging: rtl8723au: rtl8723a_update_ramask(): Fix up some bad
formatting
  staging: rtl8723au: Fold _BlockWrite() into _PageWrite()
  staging: rtl8723au: _DisableRFAFEAndResetBB8192C(): Use correct enum
value
  staging: rtl8723au: _DisableRFAFEAndResetBB8192C(): Reduce code
obfuscation
  staging: rtl8723au: Remove unnecessary wrapper
_DisableRFAFEAndResetBB()
  staging: rtl8723au: _ResetDigitalProcedure1_92C() reduce code
obfuscation
  staging: rtl8723au: Remove unnecessary wrapper
_ResetDigitalProcedure1()
  staging: rtl8723au: _DisableAnalog(): Avoid zero-init variables
unnecessarily
  staging: rtl8723au: Hal_InitPGData() avoid unnecessary typecasts

 drivers/staging/rtl8723au/Makefile|   1 -
 drivers/staging/rtl8723au/core/rtw_mlme.c |   6 +-
 drivers/staging/rtl8723au/core/rtw_recv.c | 102 +++--
 drivers/staging/rtl8723au/core/rtw_xmit.c |  19 +-
 drivers/staging/rtl8723au/hal/odm_HWConfig.c  |  13 +-
 drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c | 145 ---
 drivers/staging/rtl8723au/hal/rtl8723a_rf6052.c   | 229 ++-
 drivers/staging/rtl8723au/hal/rtl8723a_xmit.c |  31 --
 drivers/staging/rtl8723au/hal/rtl8723au_xmit.c|  14 +-
 drivers/staging/rtl8723au/hal/usb_halinit.c   | 454 +++---
 drivers/staging/rtl8723au/hal/usb_ops_linux.c |  21 +-
 drivers/staging/rtl8723au/include/rtl8723a_hal.h  |   9 -
 drivers/staging/rtl8723au/include/rtl8723a_recv.h |   3 -
 drivers/staging/rtl8723au/include/rtw_recv.h  |   3 -
 drivers/staging/rtl8723au/include/rtw_xmit.h  |   2 -
 drivers/staging/rtl8723au/include/usb_ops.h   |   2 +-
 drivers/staging/rtl8723au/include/usb_ops_linux.h |   4 +-
 drivers/staging/rtl8723au/os_dep/usb_intf.c   |   8 +-
 18 files changed, 387 insertions(+), 679 deletions(-)
 delete mode 100644 drivers/staging/rtl8723au/hal/rtl8723a_xmit.c

-- 
1.9.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 17/28] staging: rtl8723au: rtl8723au_read_port() addr argument wasn't used

2014-11-30 Thread Jes . Sorensen
From: Jes Sorensen 

Signed-off-by: Jes Sorensen 
---
 drivers/staging/rtl8723au/hal/usb_halinit.c   |  3 +--
 drivers/staging/rtl8723au/hal/usb_ops_linux.c | 19 ---
 drivers/staging/rtl8723au/include/rtl8723a_recv.h |  1 -
 drivers/staging/rtl8723au/include/usb_ops_linux.h |  2 +-
 4 files changed, 10 insertions(+), 15 deletions(-)

diff --git a/drivers/staging/rtl8723au/hal/usb_halinit.c 
b/drivers/staging/rtl8723au/hal/usb_halinit.c
index c23bd48..b1daf7b 100644
--- a/drivers/staging/rtl8723au/hal/usb_halinit.c
+++ b/drivers/staging/rtl8723au/hal/usb_halinit.c
@@ -952,8 +952,7 @@ int rtl8723au_inirp_init(struct rtw_adapter *Adapter)
/* issue Rx irp to receive data */
precvbuf = (struct recv_buf *)precvpriv->precv_buf;
for (i = 0; i < NR_RECVBUFF; i++) {
-   if (rtl8723au_read_port(Adapter, RECV_BULK_IN_ADDR, 0,
-   precvbuf) == _FAIL) {
+   if (rtl8723au_read_port(Adapter, 0, precvbuf) == _FAIL) {
RT_TRACE(_module_hci_hal_init_c_, _drv_err_,
 ("usb_rx_init: usb_read_port error\n"));
status = _FAIL;
diff --git a/drivers/staging/rtl8723au/hal/usb_ops_linux.c 
b/drivers/staging/rtl8723au/hal/usb_ops_linux.c
index c1b04c1..6a23b93 100644
--- a/drivers/staging/rtl8723au/hal/usb_ops_linux.c
+++ b/drivers/staging/rtl8723au/hal/usb_ops_linux.c
@@ -545,8 +545,7 @@ static void usb_read_port_complete(struct urb *purb)
 ("usb_read_port_complete: (purb->actual_"
  "length > MAX_RECVBUF_SZ) || (purb->actual_"
  "length < RXDESC_SIZE)\n"));
-   rtl8723au_read_port(padapter, RECV_BULK_IN_ADDR, 0,
-   precvbuf);
+   rtl8723au_read_port(padapter, 0, precvbuf);
DBG_8723A("%s()-%d: RX Warning!\n",
  __func__, __LINE__);
} else {
@@ -561,8 +560,7 @@ static void usb_read_port_complete(struct urb *purb)
tasklet_schedule(&precvpriv->recv_tasklet);
 
precvbuf->pskb = NULL;
-   rtl8723au_read_port(padapter, RECV_BULK_IN_ADDR, 0,
-   precvbuf);
+   rtl8723au_read_port(padapter, 0, precvbuf);
}
} else {
RT_TRACE(_module_hci_ops_os_c_, _drv_err_,
@@ -596,8 +594,7 @@ static void usb_read_port_complete(struct urb *purb)
break;
case -EPROTO:
case -EOVERFLOW:
-   rtl8723au_read_port(padapter, RECV_BULK_IN_ADDR, 0,
-   precvbuf);
+   rtl8723au_read_port(padapter, 0, precvbuf);
break;
case -EINPROGRESS:
DBG_8723A("ERROR: URB IS IN PROGRESS!\n");
@@ -608,18 +605,18 @@ static void usb_read_port_complete(struct urb *purb)
}
 }
 
-int rtl8723au_read_port(struct rtw_adapter *adapter, u32 addr, u32 cnt,
+int rtl8723au_read_port(struct rtw_adapter *adapter, u32 cnt,
struct recv_buf *precvbuf)
 {
+   struct urb *purb;
+   struct dvobj_priv *pdvobj = adapter_to_dvobj(adapter);
+   struct recv_priv *precvpriv = &adapter->recvpriv;
+   struct usb_device *pusbd = pdvobj->pusbdev;
int err;
unsigned int pipe;
unsigned long tmpaddr;
unsigned long alignment;
int ret = _SUCCESS;
-   struct urb *purb;
-   struct dvobj_priv *pdvobj = adapter_to_dvobj(adapter);
-   struct recv_priv *precvpriv = &adapter->recvpriv;
-   struct usb_device *pusbd = pdvobj->pusbdev;
 
if (adapter->bDriverStopped || adapter->bSurpriseRemoved) {
RT_TRACE(_module_hci_ops_os_c_, _drv_err_,
diff --git a/drivers/staging/rtl8723au/include/rtl8723a_recv.h 
b/drivers/staging/rtl8723au/include/rtl8723a_recv.h
index 0109052..cff9b4b 100644
--- a/drivers/staging/rtl8723au/include/rtl8723a_recv.h
+++ b/drivers/staging/rtl8723au/include/rtl8723a_recv.h
@@ -28,7 +28,6 @@
 
 #define MAX_RECVBUF_SZ 15360 /*  15k < 16k */
 
-#define RECV_BULK_IN_ADDR  0x80
 #define RECV_INT_IN_ADDR   0x81
 
 #define PHY_RSSI_SLID_WIN_MAX  100
diff --git a/drivers/staging/rtl8723au/include/usb_ops_linux.h 
b/drivers/staging/rtl8723au/include/usb_ops_linux.h
index bf68bbb..0494087 100644
--- a/drivers/staging/rtl8723au/include/usb_ops_linux.h
+++ b/drivers/staging/rtl8723au/include/usb_ops_linux.h
@@ -21,7 +21,7 @@
 
 #define MAX_USBCTRL_VENDORREQ_TIMES10
 
-int rtl8723au_read_port(struct rtw_adapter *adapter, u32 addr, u32 

[PATCH 05/28] staging: rtl8723au: Fold rtw_ack_tx_done23a() into rtw23a_sctx_done_err()

2014-11-30 Thread Jes . Sorensen
From: Jes Sorensen 

Signed-off-by: Jes Sorensen 
---
 drivers/staging/rtl8723au/Makefile|  1 -
 drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c | 15 +++
 drivers/staging/rtl8723au/hal/rtl8723a_xmit.c | 31 ---
 drivers/staging/rtl8723au/include/rtw_xmit.h  |  1 -
 drivers/staging/rtl8723au/os_dep/usb_intf.c   |  5 ++--
 5 files changed, 18 insertions(+), 35 deletions(-)
 delete mode 100644 drivers/staging/rtl8723au/hal/rtl8723a_xmit.c

diff --git a/drivers/staging/rtl8723au/Makefile 
b/drivers/staging/rtl8723au/Makefile
index b184108..3e89890 100644
--- a/drivers/staging/rtl8723au/Makefile
+++ b/drivers/staging/rtl8723au/Makefile
@@ -32,7 +32,6 @@ r8723au-y :=  \
hal/rtl8723a_rf6052.o   \
hal/rtl8723a_rxdesc.o   \
hal/rtl8723a_sreset.o   \
-   hal/rtl8723a_xmit.o \
hal/rtl8723au_recv.o\
hal/rtl8723au_xmit.o\
hal/usb_halinit.o   \
diff --git a/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c 
b/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c
index 044807c..01f1b79 100644
--- a/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c
+++ b/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c
@@ -1048,6 +1048,21 @@ exit:
return ret;
 }
 
+void handle_txrpt_ccx_8723a(struct rtw_adapter *adapter, void *buf)
+{
+   struct txrpt_ccx_8723a *txrpt_ccx = buf;
+   struct submit_ctx *pack_tx_ops = &adapter->xmitpriv.ack_tx_ops;
+
+   if (txrpt_ccx->int_ccx && adapter->xmitpriv.ack_tx) {
+   if (txrpt_ccx->pkt_ok)
+   rtw23a_sctx_done_err(&pack_tx_ops,
+RTW_SCTX_DONE_SUCCESS);
+   else
+   rtw23a_sctx_done_err(&pack_tx_ops,
+RTW_SCTX_DONE_CCX_PKT_FAIL);
+   }
+}
+
 void rtl8723a_InitAntenna_Selection(struct rtw_adapter *padapter)
 {
u8 val;
diff --git a/drivers/staging/rtl8723au/hal/rtl8723a_xmit.c 
b/drivers/staging/rtl8723au/hal/rtl8723a_xmit.c
deleted file mode 100644
index 6ea2f9e..000
--- a/drivers/staging/rtl8723au/hal/rtl8723a_xmit.c
+++ /dev/null
@@ -1,31 +0,0 @@
-/**
- *
- * Copyright(c) 2007 - 2012 Realtek Corporation. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- 
**/
-#define _RTL8723A_XMIT_C_
-
-#include 
-#include 
-#include 
-
-void handle_txrpt_ccx_8723a(struct rtw_adapter *adapter, void *buf)
-{
-   struct txrpt_ccx_8723a *txrpt_ccx = buf;
-
-   if (txrpt_ccx->int_ccx) {
-   if (txrpt_ccx->pkt_ok)
-   rtw_ack_tx_done23a(&adapter->xmitpriv, 
RTW_SCTX_DONE_SUCCESS);
-   else
-   rtw_ack_tx_done23a(&adapter->xmitpriv, 
RTW_SCTX_DONE_CCX_PKT_FAIL);
-   }
-}
diff --git a/drivers/staging/rtl8723au/include/rtw_xmit.h 
b/drivers/staging/rtl8723au/include/rtw_xmit.h
index 87097c4..d047d75 100644
--- a/drivers/staging/rtl8723au/include/rtw_xmit.h
+++ b/drivers/staging/rtl8723au/include/rtw_xmit.h
@@ -379,7 +379,6 @@ void xmit_delivery_enabled_frames23a(struct rtw_adapter 
*padapter,
 u8 qos_acm23a(u8 acm_mask, u8 priority);
 u32rtw_get_ff_hwaddr23a(struct xmit_frame  *pxmitframe);
 int rtw_ack_tx_wait23a(struct xmit_priv *pxmitpriv, u32 timeout_ms);
-void rtw_ack_tx_done23a(struct xmit_priv *pxmitpriv, int status);
 
 /* include after declaring struct xmit_buf, in order to avoid warning */
 #include 
diff --git a/drivers/staging/rtl8723au/os_dep/usb_intf.c 
b/drivers/staging/rtl8723au/os_dep/usb_intf.c
index 926129e..92ab667 100644
--- a/drivers/staging/rtl8723au/os_dep/usb_intf.c
+++ b/drivers/staging/rtl8723au/os_dep/usb_intf.c
@@ -242,6 +242,7 @@ void rtl8723a_usb_intf_stop(struct rtw_adapter *padapter)
 
 static void rtw_dev_unload(struct rtw_adapter *padapter)
 {
+   struct submit_ctx *pack_tx_ops = &padapter->xmitpriv.ack_tx_ops;
RT_TRACE(_module_hci_intfs_c_, _drv_err_, ("+rtw_dev_unload\n"));
 
if (padapter->bup) {
@@ -249,8 +250,8 @@ static void rtw_dev_unload(struct rtw_adapter *padapter)
 
padapter->bDriverStopped = true;
if (padapter->xmitpriv.ack_tx)
-   rtw_ack_tx_done23a(&

[PATCH 12/28] staging: rtl8723au: Remove no-op _InitHWLed() function

2014-11-30 Thread Jes . Sorensen
From: Jes Sorensen 

Signed-off-by: Jes Sorensen 
---
 drivers/staging/rtl8723au/hal/usb_halinit.c | 6 --
 1 file changed, 6 deletions(-)

diff --git a/drivers/staging/rtl8723au/hal/usb_halinit.c 
b/drivers/staging/rtl8723au/hal/usb_halinit.c
index 4cc0a0f..762c514 100644
--- a/drivers/staging/rtl8723au/hal/usb_halinit.c
+++ b/drivers/staging/rtl8723au/hal/usb_halinit.c
@@ -422,10 +422,6 @@ static void _InitEDCA(struct rtw_adapter *Adapter)
rtl8723au_write32(Adapter, REG_EDCA_VO_PARAM, 0x002FA226);
 }
 
-static void _InitHWLed(struct rtw_adapter *Adapter)
-{
-}
-
 static void _InitRDGSetting(struct rtw_adapter *Adapter)
 {
rtl8723au_write8(Adapter, REG_RD_CTRL, 0xFF);
@@ -666,8 +662,6 @@ int rtl8723au_hal_init(struct rtw_adapter *Adapter)
_InitRetryFunction(Adapter);
rtl8723a_InitBeaconParameters(Adapter);
 
-   _InitHWLed(Adapter);
-
_BBTurnOnBlock(Adapter);
/* NicIFSetMacAddress(padapter, padapter->PermanentAddress); */
 
-- 
1.9.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 28/28] staging: rtl8723au: Hal_InitPGData() avoid unnecessary typecasts

2014-11-30 Thread Jes . Sorensen
From: Jes Sorensen 

Signed-off-by: Jes Sorensen 
---
 drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c | 12 +---
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c 
b/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c
index 2e1d194..a5eadd4 100644
--- a/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c
+++ b/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c
@@ -1487,22 +1487,20 @@ void Hal_InitPGData(struct rtw_adapter *padapter, u8 
*PROMContent)
 {
struct eeprom_priv *pEEPROM = GET_EEPROM_EFUSE_PRIV(padapter);
 
-   if (false == pEEPROM->bautoload_fail_flag) {/*  autoload OK. */
+   if (!pEEPROM->bautoload_fail_flag) {/*  autoload OK. */
if (!pEEPROM->EepromOrEfuse) {
/*  Read EFUSE real map to shadow. */
EFUSE_ShadowMapUpdate23a(padapter, EFUSE_WIFI);
-   memcpy((void *)PROMContent,
-  (void *)pEEPROM->efuse_eeprom_data,
+   memcpy(PROMContent, pEEPROM->efuse_eeprom_data,
   HWSET_MAX_SIZE);
}
-   } else {/* autoload fail */
+   } else {
RT_TRACE(_module_hci_hal_init_c_, _drv_notice_,
 ("AutoLoad Fail reported from CR9346!!\n"));
-/* pHalData->AutoloadFailFlag = true; */
/* update to default value 0xFF */
-   if (false == pEEPROM->EepromOrEfuse)
+   if (!pEEPROM->EepromOrEfuse)
EFUSE_ShadowMapUpdate23a(padapter, EFUSE_WIFI);
-   memcpy((void *)PROMContent, (void *)pEEPROM->efuse_eeprom_data,
+   memcpy(PROMContent, pEEPROM->efuse_eeprom_data,
   HWSET_MAX_SIZE);
}
 }
-- 
1.9.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 09/28] staging: rtl8723au: Fold rtl8723au_set_queue_pipe_mapping into rtl8723au_chip_configure()

2014-11-30 Thread Jes . Sorensen
From: Jes Sorensen 

Signed-off-by: Jes Sorensen 
---
 drivers/staging/rtl8723au/hal/usb_halinit.c | 27 ---
 drivers/staging/rtl8723au/include/usb_ops.h |  2 +-
 drivers/staging/rtl8723au/os_dep/usb_intf.c |  3 ++-
 3 files changed, 11 insertions(+), 21 deletions(-)

diff --git a/drivers/staging/rtl8723au/hal/usb_halinit.c 
b/drivers/staging/rtl8723au/hal/usb_halinit.c
index 027b42a..b8d5040 100644
--- a/drivers/staging/rtl8723au/hal/usb_halinit.c
+++ b/drivers/staging/rtl8723au/hal/usb_halinit.c
@@ -60,33 +60,22 @@ _ConfigChipOutEP(struct rtw_adapter *pAdapter, u8 
NumOutPipe)
   (u32)NumOutPipe, (u32)pHalData->OutEpNumber)); */
 }
 
-static bool rtl8723au_set_queue_pipe_mapping(struct rtw_adapter *pAdapter,
-u8 NumInPipe, u8 NumOutPipe)
+bool rtl8723au_chip_configure(struct rtw_adapter *padapter)
 {
-   struct hal_data_8723a *pHalData = GET_HAL_DATA(pAdapter);
-   bool result = false;
+   struct hal_data_8723a *pHalData = GET_HAL_DATA(padapter);
+   struct dvobj_priv *pdvobjpriv = adapter_to_dvobj(padapter);
+   u8 NumInPipe = pdvobjpriv->RtNumInPipes;
+   u8 NumOutPipe = pdvobjpriv->RtNumOutPipes;
 
-   _ConfigChipOutEP(pAdapter, NumOutPipe);
+   _ConfigChipOutEP(padapter, NumOutPipe);
 
/*  Normal chip with one IN and one OUT doesn't have interrupt IN EP. */
if (pHalData->OutEpNumber == 1) {
if (NumInPipe != 1)
-   return result;
+   return false;
}
 
-   result = Hal_MappingOutPipe23a(pAdapter, NumOutPipe);
-
-   return result;
-}
-
-void rtl8723au_chip_configure(struct rtw_adapter *padapter)
-{
-   struct hal_data_8723a *pHalData = GET_HAL_DATA(padapter);
-   struct dvobj_priv *pdvobjpriv = adapter_to_dvobj(padapter);
-
-   rtl8723au_set_queue_pipe_mapping(padapter,
-pdvobjpriv->RtNumInPipes,
-pdvobjpriv->RtNumOutPipes);
+   return Hal_MappingOutPipe23a(padapter, NumOutPipe);
 }
 
 static int _InitPowerOn(struct rtw_adapter *padapter)
diff --git a/drivers/staging/rtl8723au/include/usb_ops.h 
b/drivers/staging/rtl8723au/include/usb_ops.h
index ade8bc7..ff11e13 100644
--- a/drivers/staging/rtl8723au/include/usb_ops.h
+++ b/drivers/staging/rtl8723au/include/usb_ops.h
@@ -63,6 +63,6 @@ static inline void rtw_reset_continual_urb_error(struct 
dvobj_priv *dvobj)
atomic_set(&dvobj->continual_urb_error, 0);
 }
 
-void rtl8723au_chip_configure(struct rtw_adapter *padapter);
+bool rtl8723au_chip_configure(struct rtw_adapter *padapter);
 
 #endif /* __USB_OPS_H_ */
diff --git a/drivers/staging/rtl8723au/os_dep/usb_intf.c 
b/drivers/staging/rtl8723au/os_dep/usb_intf.c
index 92ab667..373a617 100644
--- a/drivers/staging/rtl8723au/os_dep/usb_intf.c
+++ b/drivers/staging/rtl8723au/os_dep/usb_intf.c
@@ -530,7 +530,8 @@ static struct rtw_adapter *rtw_usb_if1_init(struct 
dvobj_priv *dvobj,
rtl8723a_read_chip_version(padapter);
 
/* step usb endpoint mapping */
-   rtl8723au_chip_configure(padapter);
+   if (!rtl8723au_chip_configure(padapter))
+   goto free_hal_data;
 
/* step read efuse/eeprom data and get mac_addr */
rtl8723a_read_adapter_info(padapter);
-- 
1.9.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 21/28] staging: rtl8723au: Fold _BlockWrite() into _PageWrite()

2014-11-30 Thread Jes . Sorensen
From: Jes Sorensen 

Signed-off-by: Jes Sorensen 
---
 drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c | 18 --
 1 file changed, 4 insertions(+), 14 deletions(-)

diff --git a/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c 
b/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c
index 01f1b79..267a80b 100644
--- a/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c
+++ b/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c
@@ -47,29 +47,19 @@ static void _FWDownloadEnable(struct rtw_adapter *padapter, 
bool enable)
}
 }
 
-static int _BlockWrite(struct rtw_adapter *padapter, void *buffer, u32 
buffSize)
-{
-   int ret;
-
-   if (buffSize > MAX_PAGE_SIZE)
-   return _FAIL;
-
-   ret = rtl8723au_writeN(padapter, FW_8723A_START_ADDRESS,
-  buffSize, buffer);
-
-   return ret;
-}
-
 static int
 _PageWrite(struct rtw_adapter *padapter, u32 page, void *buffer, u32 size)
 {
u8 value8;
u8 u8Page = (u8) (page & 0x07);
 
+   if (size > MAX_PAGE_SIZE)
+   return _FAIL;
+
value8 = (rtl8723au_read8(padapter, REG_MCUFWDL + 2) & 0xF8) | u8Page;
rtl8723au_write8(padapter, REG_MCUFWDL + 2, value8);
 
-   return _BlockWrite(padapter, buffer, size);
+   return rtl8723au_writeN(padapter, FW_8723A_START_ADDRESS, size, buffer);
 }
 
 static int _WriteFW(struct rtw_adapter *padapter, void *buffer, u32 size)
-- 
1.9.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 04/28] staging: rtl8732au: Partial clean up of rtl8723a_rf6052.c

2014-11-30 Thread Jes . Sorensen
From: Jes Sorensen 

Signed-off-by: Jes Sorensen 
---
 drivers/staging/rtl8723au/hal/rtl8723a_rf6052.c | 229 +---
 1 file changed, 123 insertions(+), 106 deletions(-)

diff --git a/drivers/staging/rtl8723au/hal/rtl8723a_rf6052.c 
b/drivers/staging/rtl8723au/hal/rtl8723a_rf6052.c
index 2dc0886..1aad438 100644
--- a/drivers/staging/rtl8723au/hal/rtl8723a_rf6052.c
+++ b/drivers/staging/rtl8723au/hal/rtl8723a_rf6052.c
@@ -42,21 +42,6 @@
 #include 
 #include 
 
-/*---Define Local Constant---*/
-/*  Define local structure for debug! */
-struct rf_shadow_compare_map {
-   /*  Shadow register value */
-   u32 Value;
-   /*  Compare or not flag */
-   u8  Compare;
-   /*  Record If it had ever modified unpredicted */
-   u8  ErrorOrNot;
-   /*  Recorver Flag */
-   u8  Recorver;
-   /*  */
-   u8  Driver_Write;
-};
-
 /*-
  * Function:PHY_RF6052SetBandwidth()
  *
@@ -71,20 +56,23 @@ struct rf_shadow_compare_map {
  *
  * Note:   For RF type 0222D
  *---*/
-void rtl8723a_phy_rf6052set_bw(
-   struct rtw_adapter *Adapter,
-   enum ht_channel_width Bandwidth)/* 20M or 40M */
+void rtl8723a_phy_rf6052set_bw(struct rtw_adapter *Adapter,
+  enum ht_channel_width Bandwidth) /* 20M or 40M */
 {
-   struct hal_data_8723a   *pHalData = GET_HAL_DATA(Adapter);
+   struct hal_data_8723a *pHalData = GET_HAL_DATA(Adapter);
 
switch (Bandwidth) {
case HT_CHANNEL_WIDTH_20:
-   pHalData->RfRegChnlVal[0] = ((pHalData->RfRegChnlVal[0] & 
0xf3ff) | 0x0400);
-   PHY_SetRFReg(Adapter, RF_PATH_A, RF_CHNLBW, bRFRegOffsetMask, 
pHalData->RfRegChnlVal[0]);
+   pHalData->RfRegChnlVal[0] =
+   (pHalData->RfRegChnlVal[0] & 0xf3ff) | 0x0400;
+   PHY_SetRFReg(Adapter, RF_PATH_A, RF_CHNLBW, bRFRegOffsetMask,
+pHalData->RfRegChnlVal[0]);
break;
case HT_CHANNEL_WIDTH_40:
-   pHalData->RfRegChnlVal[0] = ((pHalData->RfRegChnlVal[0] & 
0xf3ff));
-   PHY_SetRFReg(Adapter, RF_PATH_A, RF_CHNLBW, bRFRegOffsetMask, 
pHalData->RfRegChnlVal[0]);
+   pHalData->RfRegChnlVal[0] =
+   (pHalData->RfRegChnlVal[0] & 0xf3ff);
+   PHY_SetRFReg(Adapter, RF_PATH_A, RF_CHNLBW, bRFRegOffsetMask,
+pHalData->RfRegChnlVal[0]);
break;
default:
break;
@@ -108,7 +96,8 @@ void rtl8723a_phy_rf6052set_bw(
  *
  *---*/
 
-void rtl823a_phy_rf6052setccktxpower(struct rtw_adapter *Adapter, u8 
*pPowerlevel)
+void rtl823a_phy_rf6052setccktxpower(struct rtw_adapter *Adapter,
+u8 *pPowerlevel)
 {
struct hal_data_8723a *pHalData = GET_HAL_DATA(Adapter);
struct dm_priv *pdmpriv = &pHalData->dmpriv;
@@ -118,7 +107,8 @@ void rtl823a_phy_rf6052setccktxpower(struct rtw_adapter 
*Adapter, u8 *pPowerleve
u8 idx1, idx2;
u8 *ptr;
 
-   /*  According to SD3 eechou's suggestion, we need to disable turbo scan 
for RU. */
+   /*  According to SD3 eechou's suggestion, we need to disable
+   turbo scan for RU. */
/*  Otherwise, external PA will be broken if power index > 0x20. */
if (pHalData->EEPROMRegulatory != 0 || pHalData->ExternalPA)
TurboScanOff = true;
@@ -131,29 +121,37 @@ void rtl823a_phy_rf6052setccktxpower(struct rtw_adapter 
*Adapter, u8 *pPowerleve
 
if (TurboScanOff) {
for (idx1 = RF_PATH_A; idx1 <= RF_PATH_B; idx1++) {
-   TxAGC[idx1] =
-   pPowerlevel[idx1] | 
(pPowerlevel[idx1]<<8) |
-   (pPowerlevel[idx1]<<16) | 
(pPowerlevel[idx1]<<24);
-   /*  2010/10/18 MH For external PA module. We 
need to limit power index to be less than 0x20. */
+   TxAGC[idx1] = pPowerlevel[idx1] |
+   (pPowerlevel[idx1] << 8) |
+   (pPowerlevel[idx1] << 16) |
+   (pPowerlevel[idx1] << 24);
+   /*  2010/10/18 MH For external PA module.
+   We need to limit power index to be less
+   than 0x20. */
 

[PATCH 19/28] staging: rtl8723au: Remove unused slimcombo debug flag

2014-11-30 Thread Jes . Sorensen
From: Jes Sorensen 

Signed-off-by: Jes Sorensen 
---
 drivers/staging/rtl8723au/hal/usb_halinit.c  | 11 ---
 drivers/staging/rtl8723au/include/rtl8723a_hal.h |  4 
 2 files changed, 15 deletions(-)

diff --git a/drivers/staging/rtl8723au/hal/usb_halinit.c 
b/drivers/staging/rtl8723au/hal/usb_halinit.c
index 2c2d6b5..b15edc9 100644
--- a/drivers/staging/rtl8723au/hal/usb_halinit.c
+++ b/drivers/staging/rtl8723au/hal/usb_halinit.c
@@ -1107,13 +1107,6 @@ static void _ReadRFType(struct rtw_adapter *Adapter)
pHalData->rf_chip = RF_6052;
 }
 
-static void _ReadSilmComboMode(struct rtw_adapter *Adapter)
-{
-   struct hal_data_8723a *pHalData = GET_HAL_DATA(Adapter);
-
-   pHalData->SlimComboDbg = false; /*  Default is not debug mode. */
-}
-
 /*  */
 /* Description: */
 /* We should set Efuse cell selection to WiFi cell in default. */
@@ -1146,10 +1139,6 @@ void rtl8723a_read_adapter_info(struct rtw_adapter 
*Adapter)
_ReadRFType(Adapter);/* rf_chip -> _InitRFType() */
_ReadPROMContent(Adapter);
 
-   /*  2010/10/25 MH THe function must be called after
-   borad_type & IC-Version recognize. */
-   _ReadSilmComboMode(Adapter);
-
/* MSG_8723A("%s()(done), rf_chip = 0x%x, rf_type = 0x%x\n",
   __func__, pHalData->rf_chip, pHalData->rf_type); */
 
diff --git a/drivers/staging/rtl8723au/include/rtl8723a_hal.h 
b/drivers/staging/rtl8723au/include/rtl8723a_hal.h
index 49f74534..e146336 100644
--- a/drivers/staging/rtl8723au/include/rtl8723a_hal.h
+++ b/drivers/staging/rtl8723au/include/rtl8723a_hal.h
@@ -375,10 +375,6 @@ struct hal_data_8723a {
u8  OutEpQueueSel;
u8  OutEpNumber;
 
-   /*  2010/11/22 MH Add for slim combo debug mode selective. */
-   /*  This is used for fix the drawback of CU TSMC-A/UMC-A cut. HW auto 
suspend ability. Close BT clock. */
-   boolSlimComboDbg;
-
/*  */
/*  Add For EEPROM Efuse switch and  Efuse Shadow map Setting */
/*  */
-- 
1.9.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 03/28] staging: rtl8723au: Fold ODM_PhyStatusQuery23a_92CSeries() into ODM_PhyStatusQuery23a()

2014-11-30 Thread Jes . Sorensen
From: Jes Sorensen 

Signed-off-by: Jes Sorensen 
---
 drivers/staging/rtl8723au/hal/odm_HWConfig.c | 13 ++---
 1 file changed, 2 insertions(+), 11 deletions(-)

diff --git a/drivers/staging/rtl8723au/hal/odm_HWConfig.c 
b/drivers/staging/rtl8723au/hal/odm_HWConfig.c
index 29d844d..fb3cc87 100644
--- a/drivers/staging/rtl8723au/hal/odm_HWConfig.c
+++ b/drivers/staging/rtl8723au/hal/odm_HWConfig.c
@@ -391,20 +391,11 @@ static void odm_Process_RSSIForDM(struct dm_odm_t 
*pDM_Odm,
}
 }
 
-/*  Endianness before calling this API */
-static void ODM_PhyStatusQuery23a_92CSeries(struct dm_odm_t *pDM_Odm,
-struct phy_info *pPhyInfo,
-u8 *pPhyStatus,
-struct odm_packet_info *pPktinfo)
+void ODM_PhyStatusQuery23a(struct dm_odm_t *pDM_Odm, struct phy_info *pPhyInfo,
+  u8 *pPhyStatus, struct odm_packet_info *pPktinfo)
 {
odm_RxPhyStatus92CSeries_Parsing(pDM_Odm, pPhyInfo,
 pPhyStatus, pPktinfo);
 
odm_Process_RSSIForDM(pDM_Odm, pPhyInfo, pPktinfo);
 }
-
-void ODM_PhyStatusQuery23a(struct dm_odm_t *pDM_Odm, struct phy_info *pPhyInfo,
-  u8 *pPhyStatus, struct odm_packet_info *pPktinfo)
-{
-   ODM_PhyStatusQuery23a_92CSeries(pDM_Odm, pPhyInfo, pPhyStatus, 
pPktinfo);
-}
-- 
1.9.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 16/28] staging: rtl8723au: Use a local variable to state if MAC was already powered on

2014-11-30 Thread Jes . Sorensen
From: Jes Sorensen 

Signed-off-by: Jes Sorensen 
---
 drivers/staging/rtl8723au/hal/usb_halinit.c  | 15 ---
 drivers/staging/rtl8723au/include/rtl8723a_hal.h |  2 --
 2 files changed, 8 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/rtl8723au/hal/usb_halinit.c 
b/drivers/staging/rtl8723au/hal/usb_halinit.c
index 4cfa2f7..c23bd48 100644
--- a/drivers/staging/rtl8723au/hal/usb_halinit.c
+++ b/drivers/staging/rtl8723au/hal/usb_halinit.c
@@ -500,12 +500,13 @@ enum rt_rf_power_state RfOnOffDetect23a(struct 
rtw_adapter *pAdapter)
 
 int rtl8723au_hal_init(struct rtw_adapter *Adapter)
 {
-   u8 val8 = 0;
-   u32 boundary;
-   int status = _SUCCESS;
struct hal_data_8723a *pHalData = GET_HAL_DATA(Adapter);
struct pwrctrl_priv *pwrctrlpriv = &Adapter->pwrctrlpriv;
struct registry_priv *pregistrypriv = &Adapter->registrypriv;
+   u8 val8 = 0;
+   u32 boundary;
+   int status = _SUCCESS;
+   bool mac_on;
 
unsigned long init_start_time = jiffies;
 
@@ -535,9 +536,9 @@ int rtl8723au_hal_init(struct rtw_adapter *Adapter)
/* 0x100 value of first mac is 0xEA while 0x100 value of secondary
   is 0x00 */
if (val8 == 0xEA) {
-   pHalData->bMACFuncEnable = false;
+   mac_on = false;
} else {
-   pHalData->bMACFuncEnable = true;
+   mac_on = true;
RT_TRACE(_module_hci_hal_init_c_, _drv_info_,
 ("%s: MAC has already power on\n", __func__));
}
@@ -556,7 +557,7 @@ int rtl8723au_hal_init(struct rtw_adapter *Adapter)
boundary = WMM_NORMAL_TX_PAGE_BOUNDARY;
}
 
-   if (!pHalData->bMACFuncEnable) {
+   if (!mac_on) {
status =  InitLLTTable23a(Adapter, boundary);
if (status == _FAIL) {
RT_TRACE(_module_hci_hal_init_c_, _drv_err_,
@@ -642,7 +643,7 @@ int rtl8723au_hal_init(struct rtw_adapter *Adapter)
pHalData->RfRegChnlVal[0] = PHY_QueryRFReg(Adapter, (enum 
RF_RADIO_PATH)0, RF_CHNLBW, bRFRegOffsetMask);
pHalData->RfRegChnlVal[1] = PHY_QueryRFReg(Adapter, (enum 
RF_RADIO_PATH)1, RF_CHNLBW, bRFRegOffsetMask);
 
-   if (!pHalData->bMACFuncEnable) {
+   if (!mac_on) {
_InitQueueReservedPage(Adapter);
_InitTxBufferBoundary(Adapter);
}
diff --git a/drivers/staging/rtl8723au/include/rtl8723a_hal.h 
b/drivers/staging/rtl8723au/include/rtl8723a_hal.h
index 5a70f2f..49f74534 100644
--- a/drivers/staging/rtl8723au/include/rtl8723a_hal.h
+++ b/drivers/staging/rtl8723au/include/rtl8723a_hal.h
@@ -402,8 +402,6 @@ struct hal_data_8723a {
 *  2011/02/23 MH Add for 8723 mylti function definition. The define 
should be moved to an */
/*  independent file in the future. */
 
-   boolbMACFuncEnable;
-
/*  Interrupt related register information. */
u32 IntArray[2];
u32 IntrMask[2];
-- 
1.9.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 27/28] staging: rtl8723au: _DisableAnalog(): Avoid zero-init variables unnecessarily

2014-11-30 Thread Jes . Sorensen
From: Jes Sorensen 

Signed-off-by: Jes Sorensen 
---
 drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c 
b/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c
index b2048b6..2e1d194 100644
--- a/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c
+++ b/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c
@@ -1385,8 +1385,8 @@ m.SYS_ISO_CTRL 0x01[7:0] = 0x83   
isolated ELDR to PON
 static void _DisableAnalog(struct rtw_adapter *padapter, bool bWithoutHWSM)
 {
struct hal_data_8723a *pHalData = GET_HAL_DATA(padapter);
-   u16 value16 = 0;
-   u8 value8 = 0;
+   u16 value16;
+   u8 value8;
 
if (bWithoutHWSM) {
/*
@@ -1400,7 +1400,7 @@ static void _DisableAnalog(struct rtw_adapter *padapter, 
bool bWithoutHWSM)
/* rtl8723au_write8(padapter, REG_LDOV12D_CTRL, 0x54); */
 
value8 = rtl8723au_read8(padapter, REG_LDOV12D_CTRL);
-   value8 &= (~LDV12_EN);
+   value8 &= ~LDV12_EN;
rtl8723au_write8(padapter, REG_LDOV12D_CTRL, value8);
 /* RT_TRACE(COMP_INIT, DBG_LOUD,
(" REG_LDOV12D_CTRL Reg0x21:0x%02x.\n", value8)); */
@@ -1422,9 +1422,9 @@ static void _DisableAnalog(struct rtw_adapter *padapter, 
bool bWithoutHWSM)
use HW to shut down 8051 automatically. */
/*  Becasue suspend operatione need the asistance of 8051
to wait for 3ms. */
-   value16 |= (APDM_HOST | AFSM_HSUS | PFM_ALDN);
+   value16 = APDM_HOST | AFSM_HSUS | PFM_ALDN;
} else {
-   value16 |= (APDM_HOST | AFSM_HSUS | PFM_ALDN);
+   value16 = APDM_HOST | AFSM_HSUS | PFM_ALDN;
}
 
rtl8723au_write16(padapter, REG_APS_FSMCO, value16);/* 0x4802 */
-- 
1.9.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 15/28] staging: rtl8723au: phy_SsPwrSwitch92CU() was never called with bRegSSPwrLvl != 1

2014-11-30 Thread Jes . Sorensen
From: Jes Sorensen 

Get rid of the alternate code paths since these weren't used and have
never been tested according to the in-code comments.

Signed-off-by: Jes Sorensen 
---
 drivers/staging/rtl8723au/hal/usb_halinit.c | 322 
 1 file changed, 84 insertions(+), 238 deletions(-)

diff --git a/drivers/staging/rtl8723au/hal/usb_halinit.c 
b/drivers/staging/rtl8723au/hal/usb_halinit.c
index cd3f8ba..4cfa2f7 100644
--- a/drivers/staging/rtl8723au/hal/usb_halinit.c
+++ b/drivers/staging/rtl8723au/hal/usb_halinit.c
@@ -26,8 +26,7 @@
 #include 
 
 static void phy_SsPwrSwitch92CU(struct rtw_adapter *Adapter,
-   enum rt_rf_power_state eRFPowerState,
-   int bRegSSPwrLvl);
+   enum rt_rf_power_state eRFPowerState);
 
 static void
 _ConfigChipOutEP(struct rtw_adapter *pAdapter, u8 NumOutPipe)
@@ -513,9 +512,7 @@ int rtl8723au_hal_init(struct rtw_adapter *Adapter)
Adapter->hw_init_completed = false;
 
if (Adapter->pwrctrlpriv.bkeepfwalive) {
-   /* here call with bRegSSPwrLvl 1, bRegSSPwrLvl 2
-  needs to be verified */
-   phy_SsPwrSwitch92CU(Adapter, rf_on, 1);
+   phy_SsPwrSwitch92CU(Adapter, rf_on);
 
if (pHalData->bIQKInitialized) {
rtl8723a_phy_iq_calibrate(Adapter, true);
@@ -776,112 +773,50 @@ exit:
 }
 
 static void phy_SsPwrSwitch92CU(struct rtw_adapter *Adapter,
-   enum rt_rf_power_state eRFPowerState,
-   int bRegSSPwrLvl)
+   enum rt_rf_power_state eRFPowerState)
 {
struct hal_data_8723a *pHalData = GET_HAL_DATA(Adapter);
-   u8 value8, sps0;
-   u8 bytetmp;
+   u8 sps0;
 
sps0 = rtl8723au_read8(Adapter, REG_SPS0_CTRL);
 
switch (eRFPowerState) {
case rf_on:
-   if (bRegSSPwrLvl == 1) {
-   /*  1. Enable MAC Clock. Can not be enabled now. */
-   /* WriteXBYTE(REG_SYS_CLKR+1,
-  ReadXBYTE(REG_SYS_CLKR+1) | BIT(3)); */
-
-   /*  2. Force PWM, Enable SPS18_LDO_Marco_Block */
-   rtl8723au_write8(Adapter, REG_SPS0_CTRL,
-sps0 | BIT(0) | BIT(3));
-
-   /*  3. restore BB, AFE control register. */
-   /* RF */
-   if (pHalData->rf_type ==  RF_2T2R)
-   PHY_SetBBReg(Adapter, rFPGA0_XAB_RFParameter,
-0x380038, 1);
-   else
-   PHY_SetBBReg(Adapter, rFPGA0_XAB_RFParameter,
-0x38, 1);
-   PHY_SetBBReg(Adapter, rOFDM0_TRxPathEnable, 0xf0, 1);
-   PHY_SetBBReg(Adapter, rFPGA0_RFMOD, BIT(1), 0);
-
-   /* AFE */
-   if (pHalData->rf_type ==  RF_2T2R)
-   PHY_SetBBReg(Adapter, rRx_Wait_CCA, bMaskDWord,
-0x63DB25A0);
-   else if (pHalData->rf_type ==  RF_1T1R)
-   PHY_SetBBReg(Adapter, rRx_Wait_CCA, bMaskDWord,
-0x631B25A0);
-
-   /*  4. issue 3-wire command that RF set to Rx idle
-   mode. This is used to re-write the RX idle mode. */
-   /*  We can only prvide a usual value instead and then
-   HW will modify the value by itself. */
-   PHY_SetRFReg(Adapter, RF_PATH_A, 0,
-bRFRegOffsetMask, 0x32D95);
-   if (pHalData->rf_type ==  RF_2T2R) {
-   PHY_SetRFReg(Adapter, RF_PATH_B, 0,
-bRFRegOffsetMask, 0x32D95);
-   }
-   } else {/*  Level 2 or others. */
-   /* h.   AFE_PLL_CTRL 0x28[7:0] = 0x80
-  disable AFE PLL */
-   rtl8723au_write8(Adapter, REG_AFE_PLL_CTRL, 0x81);
-
-   /*  i.  AFE_XTAL_CTRL 0x24[15:0] = 0x880F
-   gated AFE DIG_CLOCK */
-   rtl8723au_write16(Adapter, REG_AFE_XTAL_CTRL, 0x800F);
-   mdelay(1);
-
-   /*  2. Force PWM, Enable SPS18_LDO_Marco_Block */
-   rtl8723au_write8(Adapter, REG_SPS0_CTRL,
-sps0 | BIT(0) | BIT(3));
-
-   /*  3. restore BB, AFE control register. */
-   /* RF */
-   if (pHalData->rf_type ==  RF_2T2R)
-  

[PATCH 08/28] staging: rtl8723au: Remove write only struct hal_data_8723a.interfaceIndex

2014-11-30 Thread Jes . Sorensen
From: Jes Sorensen 

Signed-off-by: Jes Sorensen 
---
 drivers/staging/rtl8723au/hal/usb_halinit.c  | 2 --
 drivers/staging/rtl8723au/include/rtl8723a_hal.h | 3 ---
 2 files changed, 5 deletions(-)

diff --git a/drivers/staging/rtl8723au/hal/usb_halinit.c 
b/drivers/staging/rtl8723au/hal/usb_halinit.c
index ead676f..027b42a 100644
--- a/drivers/staging/rtl8723au/hal/usb_halinit.c
+++ b/drivers/staging/rtl8723au/hal/usb_halinit.c
@@ -84,8 +84,6 @@ void rtl8723au_chip_configure(struct rtw_adapter *padapter)
struct hal_data_8723a *pHalData = GET_HAL_DATA(padapter);
struct dvobj_priv *pdvobjpriv = adapter_to_dvobj(padapter);
 
-   pHalData->interfaceIndex = pdvobjpriv->InterfaceNumber;
-
rtl8723au_set_queue_pipe_mapping(padapter,
 pdvobjpriv->RtNumInPipes,
 pdvobjpriv->RtNumOutPipes);
diff --git a/drivers/staging/rtl8723au/include/rtl8723a_hal.h 
b/drivers/staging/rtl8723au/include/rtl8723a_hal.h
index 72af134..5a70f2f 100644
--- a/drivers/staging/rtl8723au/include/rtl8723a_hal.h
+++ b/drivers/staging/rtl8723au/include/rtl8723a_hal.h
@@ -372,9 +372,6 @@ struct hal_data_8723a {
/*  2010/08/09 MH Add CU power down mode. */
u8  pwrdown;
 
-   /*  Add for dual MAC  0--Mac0 1--Mac1 */
-   u32 interfaceIndex;
-
u8  OutEpQueueSel;
u8  OutEpNumber;
 
-- 
1.9.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 07/28] staging: rtl8723au: Remove unused rtw_sctx_done23a() function

2014-11-30 Thread Jes . Sorensen
From: Jes Sorensen 

Signed-off-by: Jes Sorensen 
---
 drivers/staging/rtl8723au/core/rtw_xmit.c| 5 -
 drivers/staging/rtl8723au/include/rtw_xmit.h | 1 -
 2 files changed, 6 deletions(-)

diff --git a/drivers/staging/rtl8723au/core/rtw_xmit.c 
b/drivers/staging/rtl8723au/core/rtw_xmit.c
index 00a04af..7a5e6bf 100644
--- a/drivers/staging/rtl8723au/core/rtw_xmit.c
+++ b/drivers/staging/rtl8723au/core/rtw_xmit.c
@@ -2362,11 +2362,6 @@ void rtw23a_sctx_done_err(struct submit_ctx **sctx, int 
status)
}
 }
 
-void rtw_sctx_done23a(struct submit_ctx **sctx)
-{
-   rtw23a_sctx_done_err(sctx, RTW_SCTX_DONE_SUCCESS);
-}
-
 int rtw_ack_tx_wait23a(struct xmit_priv *pxmitpriv, u32 timeout_ms)
 {
struct submit_ctx *pack_tx_ops = &pxmitpriv->ack_tx_ops;
diff --git a/drivers/staging/rtl8723au/include/rtw_xmit.h 
b/drivers/staging/rtl8723au/include/rtw_xmit.h
index d047d75..2b7d6d0 100644
--- a/drivers/staging/rtl8723au/include/rtw_xmit.h
+++ b/drivers/staging/rtl8723au/include/rtw_xmit.h
@@ -196,7 +196,6 @@ enum {
 void rtw_sctx_init23a(struct submit_ctx *sctx, int timeout_ms);
 int rtw_sctx_wait23a(struct submit_ctx *sctx);
 void rtw23a_sctx_done_err(struct submit_ctx **sctx, int status);
-void rtw_sctx_done23a(struct submit_ctx **sctx);
 
 struct xmit_buf {
struct list_head list, list2;
-- 
1.9.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 26/28] staging: rtl8723au: Remove unnecessary wrapper _ResetDigitalProcedure1()

2014-11-30 Thread Jes . Sorensen
From: Jes Sorensen 

Signed-off-by: Jes Sorensen 
---
 drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c | 10 ++
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c 
b/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c
index 222dcd1..b2048b6 100644
--- a/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c
+++ b/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c
@@ -1369,12 +1369,6 @@ static void _ResetDigitalProcedure1_92C(struct 
rtw_adapter *padapter,
}
 }
 
-static void _ResetDigitalProcedure1(struct rtw_adapter *padapter,
-   bool bWithoutHWSM)
-{
-   _ResetDigitalProcedure1_92C(padapter, bWithoutHWSM);
-}
-
 static void _ResetDigitalProcedure2(struct rtw_adapter *padapter)
 {
 /*
@@ -1448,7 +1442,7 @@ int CardDisableHWSM(struct rtw_adapter *padapter, u8 
resetMCU)
_DisableRFAFEAndResetBB8192C(padapter);
 
/*    Reset digital sequence   == */
-   _ResetDigitalProcedure1(padapter, false);
+   _ResetDigitalProcedure1_92C(padapter, false);
 
/*    Pull GPIO PIN to balance level and LED control == */
_DisableGPIO(padapter);
@@ -1473,7 +1467,7 @@ int CardDisableWithoutHWSM(struct rtw_adapter *padapter)
_DisableRFAFEAndResetBB8192C(padapter);
 
/*    Reset digital sequence   == */
-   _ResetDigitalProcedure1(padapter, true);
+   _ResetDigitalProcedure1_92C(padapter, true);
 
/*    Pull GPIO PIN to balance level and LED control == */
_DisableGPIO(padapter);
-- 
1.9.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 22/28] staging: rtl8723au: _DisableRFAFEAndResetBB8192C(): Use correct enum value

2014-11-30 Thread Jes . Sorensen
From: Jes Sorensen 

Signed-off-by: Jes Sorensen 
---
 drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c 
b/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c
index 267a80b..d2b4fb0 100644
--- a/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c
+++ b/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c
@@ -1253,11 +1253,11 @@ c.  APSD_CTRL 0x600[7:0] = 0x40
 d. SYS_FUNC_EN 0x02[7:0] = 0x16reset BB state machine
 e. SYS_FUNC_EN 0x02[7:0] = 0x14reset BB state machine
 ***/
-   u8 eRFPath = 0, value8 = 0;
+   u8 value8 = 0;
 
rtl8723au_write8(padapter, REG_TXPAUSE, 0xFF);
 
-   PHY_SetRFReg(padapter, (enum RF_RADIO_PATH) eRFPath, 0x0, bMaskByte0, 
0x0);
+   PHY_SetRFReg(padapter, RF_PATH_A, 0x0, bMaskByte0, 0x0);
 
value8 |= APSDOFF;
rtl8723au_write8(padapter, REG_APSD_CTRL, value8);  /* 0x40 */
-- 
1.9.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 25/28] staging: rtl8723au: _ResetDigitalProcedure1_92C() reduce code obfuscation

2014-11-30 Thread Jes . Sorensen
From: Jes Sorensen 

Signed-off-by: Jes Sorensen 
---
 drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c | 62 +++
 1 file changed, 30 insertions(+), 32 deletions(-)

diff --git a/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c 
b/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c
index 5d2e774..222dcd1 100644
--- a/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c
+++ b/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c
@@ -1289,18 +1289,18 @@ static void _ResetDigitalProcedure1_92C(struct 
rtw_adapter *padapter,
i. SYS_FUNC_EN 0x02[10]= 1  enable MCU register,
(8051 enable)
**/
-   u16 valu16 = 0;
+   u16 valu16;
rtl8723au_write8(padapter, REG_MCUFWDL, 0);
 
valu16 = rtl8723au_read16(padapter, REG_SYS_FUNC_EN);
/* reset MCU , 8051 */
rtl8723au_write16(padapter, REG_SYS_FUNC_EN,
- valu16 & (~FEN_CPUEN));
+ valu16 & ~FEN_CPUEN);
 
valu16 = rtl8723au_read16(padapter, REG_SYS_FUNC_EN) & 0x0FFF;
/* reset MAC */
rtl8723au_write16(padapter, REG_SYS_FUNC_EN,
- valu16 | (FEN_HWPDN | FEN_ELDR));
+ valu16 | FEN_HWPDN | FEN_ELDR);
 
valu16 = rtl8723au_read16(padapter, REG_SYS_FUNC_EN);
/* enable MCU , 8051 */
@@ -1308,43 +1308,41 @@ static void _ResetDigitalProcedure1_92C(struct 
rtw_adapter *padapter,
  valu16 | FEN_CPUEN);
} else {
u8 retry_cnts = 0;
+   u8 val8;
+
+   val8 = rtl8723au_read8(padapter, REG_MCUFWDL);
 
/*  2010/08/12 MH For USB SS, we can not stop 8051 when we
are trying to enter IPS/HW&SW radio off. For
S3/S4/S5/Disable, we can stop 8051 because */
/*  we will init FW when power on again. */
/*  If we want to SS mode, we can not reset 8051. */
-   if (rtl8723au_read8(padapter, REG_MCUFWDL) & BIT(1)) {
+   if ((val8 & BIT(1)) && padapter->bFWReady) {
/* IF fw in RAM code, do reset */
-   if (padapter->bFWReady) {
-   /*  2010/08/25 MH Accordign to RD alfred's
-   suggestion, we need to disable other */
-   /*  HRCV INT to influence 8051 reset. */
-   rtl8723au_write8(padapter, REG_FWIMR, 0x20);
-   /*  2011/02/15 MH According to Alex's
-   suggestion, close mask to prevent
-   incorrect FW write operation. */
-   rtl8723au_write8(padapter, REG_FTIMR, 0x00);
-   rtl8723au_write8(padapter, REG_FSIMR, 0x00);
-
-   /* 8051 reset by self */
-   rtl8723au_write8(padapter, REG_HMETFR + 3,
-0x20);
-
-   while ((retry_cnts++ < 100) &&
-  (FEN_CPUEN &
-   rtl8723au_read16(padapter,
-REG_SYS_FUNC_EN))) {
-   udelay(50); /* us */
-   }
+   /*  2010/08/25 MH Accordign to RD alfred's
+   suggestion, we need to disable other */
+   /*  HRCV INT to influence 8051 reset. */
+   rtl8723au_write8(padapter, REG_FWIMR, 0x20);
+   /*  2011/02/15 MH According to Alex's
+   suggestion, close mask to prevent
+   incorrect FW write operation. */
+   rtl8723au_write8(padapter, REG_FTIMR, 0x00);
+   rtl8723au_write8(padapter, REG_FSIMR, 0x00);
+
+   /* 8051 reset by self */
+   rtl8723au_write8(padapter, REG_HMETFR + 3, 0x20);
+
+   while ((retry_cnts++ < 100) &&
+  (rtl8723au_read16(padapter, REG_SYS_FUNC_EN) &
+   FEN_CPUEN)) {
+   udelay(50); /* us */
+   }
 
-   if (retry_cnts >= 100) {
-   /* Reset MAC and Enable 8051 */
-   rtl8723au_write8(padapter,
-REG_SYS_FUNC_EN + 1,
- 

[PATCH 18/28] staging: rtl8723au: rtl8723au_read_interrupt() addr argument wasn't used

2014-11-30 Thread Jes . Sorensen
From: Jes Sorensen 

Signed-off-by: Jes Sorensen 
---
 drivers/staging/rtl8723au/hal/usb_halinit.c   | 4 ++--
 drivers/staging/rtl8723au/hal/usb_ops_linux.c | 2 +-
 drivers/staging/rtl8723au/include/rtl8723a_recv.h | 2 --
 drivers/staging/rtl8723au/include/usb_ops_linux.h | 2 +-
 4 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/rtl8723au/hal/usb_halinit.c 
b/drivers/staging/rtl8723au/hal/usb_halinit.c
index b1daf7b..2c2d6b5 100644
--- a/drivers/staging/rtl8723au/hal/usb_halinit.c
+++ b/drivers/staging/rtl8723au/hal/usb_halinit.c
@@ -960,9 +960,9 @@ int rtl8723au_inirp_init(struct rtw_adapter *Adapter)
}
precvbuf++;
}
-   if (rtl8723au_read_interrupt(Adapter, RECV_INT_IN_ADDR) == _FAIL) {
+   if (rtl8723au_read_interrupt(Adapter) == _FAIL) {
RT_TRACE(_module_hci_hal_init_c_, _drv_err_,
-("usb_rx_init: usb_read_interrupt error\n"));
+("%s: usb_read_interrupt error\n", __func__));
status = _FAIL;
}
pHalData->IntrMask[0] = rtl8723au_read32(Adapter, REG_USB_HIMR);
diff --git a/drivers/staging/rtl8723au/hal/usb_ops_linux.c 
b/drivers/staging/rtl8723au/hal/usb_ops_linux.c
index 6a23b93..a6d16ad 100644
--- a/drivers/staging/rtl8723au/hal/usb_ops_linux.c
+++ b/drivers/staging/rtl8723au/hal/usb_ops_linux.c
@@ -317,7 +317,7 @@ urb_submit:
}
 }
 
-int rtl8723au_read_interrupt(struct rtw_adapter *adapter, u32 addr)
+int rtl8723au_read_interrupt(struct rtw_adapter *adapter)
 {
int err;
unsigned int pipe;
diff --git a/drivers/staging/rtl8723au/include/rtl8723a_recv.h 
b/drivers/staging/rtl8723au/include/rtl8723a_recv.h
index cff9b4b..0177bbc 100644
--- a/drivers/staging/rtl8723au/include/rtl8723a_recv.h
+++ b/drivers/staging/rtl8723au/include/rtl8723a_recv.h
@@ -28,8 +28,6 @@
 
 #define MAX_RECVBUF_SZ 15360 /*  15k < 16k */
 
-#define RECV_INT_IN_ADDR   0x81
-
 #define PHY_RSSI_SLID_WIN_MAX  100
 #define PHY_LINKQUALITY_SLID_WIN_MAX   20
 
diff --git a/drivers/staging/rtl8723au/include/usb_ops_linux.h 
b/drivers/staging/rtl8723au/include/usb_ops_linux.h
index 0494087..af2f14b 100644
--- a/drivers/staging/rtl8723au/include/usb_ops_linux.h
+++ b/drivers/staging/rtl8723au/include/usb_ops_linux.h
@@ -27,7 +27,7 @@ void rtl8723au_read_port_cancel(struct rtw_adapter *padapter);
 int rtl8723au_write_port(struct rtw_adapter *padapter, u32 addr, u32 cnt,
 struct xmit_buf *pxmitbuf);
 void rtl8723au_write_port_cancel(struct rtw_adapter *padapter);
-int rtl8723au_read_interrupt(struct rtw_adapter *adapter, u32 addr);
+int rtl8723au_read_interrupt(struct rtw_adapter *adapter);
 
 u8 rtl8723au_read8(struct rtw_adapter *padapter, u16 addr);
 u16 rtl8723au_read16(struct rtw_adapter *padapter, u16 addr);
-- 
1.9.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 13/28] staging: rtl8723au: Do not write garbage to REG_SPS0_CTRL

2014-11-30 Thread Jes . Sorensen
From: Jes Sorensen 

Use a separate variable to hold the value of REG_SPS0_CTRL to avoid it
getting clobbered and writing out garbage to it, for the case of
eRFPowerState == rf_sleep/rf_off && bRegSSPwrLvl == 1.

Signed-off-by: Jes Sorensen 
---
 drivers/staging/rtl8723au/hal/usb_halinit.c | 19 +--
 1 file changed, 9 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/rtl8723au/hal/usb_halinit.c 
b/drivers/staging/rtl8723au/hal/usb_halinit.c
index 762c514..6c66013 100644
--- a/drivers/staging/rtl8723au/hal/usb_halinit.c
+++ b/drivers/staging/rtl8723au/hal/usb_halinit.c
@@ -776,9 +776,11 @@ static void phy_SsPwrSwitch92CU(struct rtw_adapter 
*Adapter,
int bRegSSPwrLvl)
 {
struct hal_data_8723a *pHalData = GET_HAL_DATA(Adapter);
-   u8 value8;
+   u8 value8, sps0;
u8 bytetmp;
 
+   sps0 = rtl8723au_read8(Adapter, REG_SPS0_CTRL);
+
switch (eRFPowerState) {
case rf_on:
if (bRegSSPwrLvl == 1) {
@@ -788,8 +790,7 @@ static void phy_SsPwrSwitch92CU(struct rtw_adapter *Adapter,
 
/*  2. Force PWM, Enable SPS18_LDO_Marco_Block */
rtl8723au_write8(Adapter, REG_SPS0_CTRL,
-rtl8723au_read8(Adapter, 
REG_SPS0_CTRL) |
-BIT(0) | BIT(3));
+sps0 | BIT(0) | BIT(3));
 
/*  3. restore BB, AFE control register. */
/* RF */
@@ -832,8 +833,7 @@ static void phy_SsPwrSwitch92CU(struct rtw_adapter *Adapter,
 
/*  2. Force PWM, Enable SPS18_LDO_Marco_Block */
rtl8723au_write8(Adapter, REG_SPS0_CTRL,
-rtl8723au_read8(Adapter, 
REG_SPS0_CTRL) |
-BIT(0) | BIT(3));
+sps0 | BIT(0) | BIT(3));
 
/*  3. restore BB, AFE control register. */
/* RF */
@@ -882,11 +882,10 @@ static void phy_SsPwrSwitch92CU(struct rtw_adapter 
*Adapter,
break;
case rf_sleep:
case rf_off:
-   value8 = rtl8723au_read8(Adapter, REG_SPS0_CTRL);
if (IS_81xxC_VENDOR_UMC_B_CUT(pHalData->VersionID))
-   value8 &= ~BIT(0);
+   sps0 &= ~BIT(0);
else
-   value8 &= ~(BIT(0) | BIT(3));
+   sps0 &= ~(BIT(0) | BIT(3));
if (bRegSSPwrLvl == 1) {
RT_TRACE(_module_hal_init_c_, _drv_err_, ("SS LVL1\n"));
/*  Disable RF and BB only for SelectSuspend. */
@@ -936,7 +935,7 @@ static void phy_SsPwrSwitch92CU(struct rtw_adapter *Adapter,
 bRFRegOffsetMask, 0);
 
/*  4. Force PFM , disable SPS18_LDO_Marco_Block */
-   rtl8723au_write8(Adapter, REG_SPS0_CTRL, value8);
+   rtl8723au_write8(Adapter, REG_SPS0_CTRL, sps0);
} else {/*  Level 2 or others. */
RT_TRACE(_module_hal_init_c_, _drv_err_, ("SS LVL2\n"));
{
@@ -1009,7 +1008,7 @@ static void phy_SsPwrSwitch92CU(struct rtw_adapter 
*Adapter,
 bRFRegOffsetMask, 0);
 
/*  4. Force PFM , disable SPS18_LDO_Marco_Block */
-   rtl8723au_write8(Adapter, REG_SPS0_CTRL, value8);
+   rtl8723au_write8(Adapter, REG_SPS0_CTRL, sps0);
 
/*  2010/10/13 MH/Isaachsu exchange sequence. */
/* h.   AFE_PLL_CTRL 0x28[7:0] = 0x80
-- 
1.9.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 0/1] staging: rtl8188eu: Fixup USB endpoint parsing

2014-12-01 Thread Jes . Sorensen
From: Jes Sorensen 

Hi,

This removes a pointless NULL pointer check in the USB endpoint
parsing code, allowing for some cleaning up. I have made the same
change to the rtl8723au driver, which I will push out with the next
set of fixes.

Cheers,
Jes

Jes Sorensen (1):
  staging: rtl8188eu: usb_dvobj_init(): A NULL pointer check for
usb_host_endpoints makes no sense

 drivers/staging/rtl8188eu/os_dep/usb_intf.c | 33 +
 1 file changed, 15 insertions(+), 18 deletions(-)

-- 
1.9.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 1/1] staging: rtl8188eu: usb_dvobj_init(): A NULL pointer check for usb_host_endpoints makes no sense

2014-12-01 Thread Jes . Sorensen
From: Jes Sorensen 

struct usb_host_interface points to an array of
struct usb_host_endpoints - it makes no sense to do a NULL pointer
check for each pointer.

Signed-off-by: Jes Sorensen 
---
 drivers/staging/rtl8188eu/os_dep/usb_intf.c | 33 +
 1 file changed, 15 insertions(+), 18 deletions(-)

diff --git a/drivers/staging/rtl8188eu/os_dep/usb_intf.c 
b/drivers/staging/rtl8188eu/os_dep/usb_intf.c
index 65a257f..2b5ee2d 100644
--- a/drivers/staging/rtl8188eu/os_dep/usb_intf.c
+++ b/drivers/staging/rtl8188eu/os_dep/usb_intf.c
@@ -62,7 +62,6 @@ static struct dvobj_priv *usb_dvobj_init(struct usb_interface 
*usb_intf)
struct usb_config_descriptor*pconf_desc;
struct usb_host_interface   *phost_iface;
struct usb_interface_descriptor *piface_desc;
-   struct usb_host_endpoint*phost_endp;
struct usb_endpoint_descriptor  *pendp_desc;
struct usb_device   *pusbd;
 
@@ -91,24 +90,22 @@ static struct dvobj_priv *usb_dvobj_init(struct 
usb_interface *usb_intf)
 
for (i = 0; i < pdvobjpriv->nr_endpoint; i++) {
int ep_num;
-   phost_endp = phost_iface->endpoint + i;
-
-   if (phost_endp) {
-   pendp_desc = &phost_endp->desc;
-   ep_num = usb_endpoint_num(pendp_desc);
-
-   if (usb_endpoint_is_bulk_in(pendp_desc)) {
-   pdvobjpriv->RtInPipe[pdvobjpriv->RtNumInPipes] 
= ep_num;
-   pdvobjpriv->RtNumInPipes++;
-   } else if (usb_endpoint_is_int_in(pendp_desc)) {
-   pdvobjpriv->RtInPipe[pdvobjpriv->RtNumInPipes] 
= ep_num;
-   pdvobjpriv->RtNumInPipes++;
-   } else if (usb_endpoint_is_bulk_out(pendp_desc)) {
-   
pdvobjpriv->RtOutPipe[pdvobjpriv->RtNumOutPipes] = ep_num;
-   pdvobjpriv->RtNumOutPipes++;
-   }
-   pdvobjpriv->ep_num[i] = ep_num;
+   pendp_desc = &phost_iface->endpoint[i].desc;
+
+   ep_num = usb_endpoint_num(pendp_desc);
+
+   if (usb_endpoint_is_bulk_in(pendp_desc)) {
+   pdvobjpriv->RtInPipe[pdvobjpriv->RtNumInPipes] = ep_num;
+   pdvobjpriv->RtNumInPipes++;
+   } else if (usb_endpoint_is_int_in(pendp_desc)) {
+   pdvobjpriv->RtInPipe[pdvobjpriv->RtNumInPipes] = ep_num;
+   pdvobjpriv->RtNumInPipes++;
+   } else if (usb_endpoint_is_bulk_out(pendp_desc)) {
+   pdvobjpriv->RtOutPipe[pdvobjpriv->RtNumOutPipes] =
+   ep_num;
+   pdvobjpriv->RtNumOutPipes++;
}
+   pdvobjpriv->ep_num[i] = ep_num;
}
 
if (pusbd->speed == USB_SPEED_HIGH)
-- 
1.9.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 07/12] staging: rtl8723au: There is no 11N pseudo PHY here

2014-12-04 Thread Jes . Sorensen
From: Jes Sorensen 

Signed-off-by: Jes Sorensen 
---
 drivers/staging/rtl8723au/hal/rtl8723a_phycfg.c| 12 
 drivers/staging/rtl8723au/include/Hal8723APhyCfg.h |  1 -
 2 files changed, 13 deletions(-)

diff --git a/drivers/staging/rtl8723au/hal/rtl8723a_phycfg.c 
b/drivers/staging/rtl8723au/hal/rtl8723a_phycfg.c
index 1692c49..19dc5e3 100644
--- a/drivers/staging/rtl8723au/hal/rtl8723a_phycfg.c
+++ b/drivers/staging/rtl8723au/hal/rtl8723a_phycfg.c
@@ -920,9 +920,6 @@ _PHY_SetBWMode23a92C(struct rtw_adapter *Adapter)
u8 regBwOpMode;
u8 regRRSR_RSC;
 
-   if (pHalData->rf_chip == RF_PSEUDO_11N)
-   return;
-
/*  There is no 40MHz mode in RF_8225. */
if (pHalData->rf_chip == RF_8225)
return;
@@ -1018,10 +1015,6 @@ _PHY_SetBWMode23a92C(struct rtw_adapter *Adapter)
/*  PHY_SetRF8258Bandwidth(); */
break;
 
-   case RF_PSEUDO_11N:
-   /*  Do Nothing */
-   break;
-
case RF_6052:
rtl8723a_phy_rf6052set_bw(Adapter, pHalData->CurrentChannelBW);
break;
@@ -1098,11 +1091,6 @@ void PHY_SwChnl8723A(struct rtw_adapter *Adapter, u8 
channel)
u8 tmpchannel = pHalData->CurrentChannel;
bool  result = true;
 
-   if (pHalData->rf_chip == RF_PSEUDO_11N) {
-   /* return immediately if it is peudo-phy */
-   return;
-   }
-
if (channel == 0)
channel = 1;
 
diff --git a/drivers/staging/rtl8723au/include/Hal8723APhyCfg.h 
b/drivers/staging/rtl8723au/include/Hal8723APhyCfg.h
index c1b7d08..fa6f4ae 100644
--- a/drivers/staging/rtl8723au/include/Hal8723APhyCfg.h
+++ b/drivers/staging/rtl8723au/include/Hal8723APhyCfg.h
@@ -56,7 +56,6 @@ enum rf_type_8190p {
RF_8256 = 2,/*  2 11b/g/n */
RF_8258 = 3,/*  3 11a/b/g/n RF */
RF_6052 = 4,/*  4 11b/g/n RF */
-   RF_PSEUDO_11N = 5,  /*  5, It is a temporality RF. */
 };
 
 struct bb_reg_define {
-- 
1.9.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 03/12] staging: rtl8723au: Use proper enum defines

2014-12-04 Thread Jes . Sorensen
From: Jes Sorensen 

Signed-off-by: Jes Sorensen 
---
 drivers/staging/rtl8723au/hal/usb_halinit.c | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8723au/hal/usb_halinit.c 
b/drivers/staging/rtl8723au/hal/usb_halinit.c
index ee17b2c..adbf1c2 100644
--- a/drivers/staging/rtl8723au/hal/usb_halinit.c
+++ b/drivers/staging/rtl8723au/hal/usb_halinit.c
@@ -640,8 +640,10 @@ int rtl8723au_hal_init(struct rtw_adapter *Adapter)
/*  */
/*  Joseph Note: Keep RfRegChnlVal for later use. */
/*  */
-   pHalData->RfRegChnlVal[0] = PHY_QueryRFReg(Adapter, (enum 
RF_RADIO_PATH)0, RF_CHNLBW, bRFRegOffsetMask);
-   pHalData->RfRegChnlVal[1] = PHY_QueryRFReg(Adapter, (enum 
RF_RADIO_PATH)1, RF_CHNLBW, bRFRegOffsetMask);
+   pHalData->RfRegChnlVal[0] = PHY_QueryRFReg(Adapter, RF_PATH_A,
+  RF_CHNLBW, bRFRegOffsetMask);
+   pHalData->RfRegChnlVal[1] = PHY_QueryRFReg(Adapter, RF_PATH_B,
+  RF_CHNLBW, bRFRegOffsetMask);
 
if (!mac_on) {
_InitQueueReservedPage(Adapter);
-- 
1.9.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 02/12] staging: rtl8723au: Use correct register names to set parameters to reduce 80M spur

2014-12-04 Thread Jes . Sorensen
From: Jes Sorensen 

Use the correct register names when setting parameters to reduce 80M
spur. In addition apply updated 80M spur reduction parameters.

Original patch supplied by Andrew Chang 

Signed-off-by: Jes Sorensen 
---
 drivers/staging/rtl8723au/hal/usb_halinit.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/rtl8723au/hal/usb_halinit.c 
b/drivers/staging/rtl8723au/hal/usb_halinit.c
index febe5ce..ee17b2c 100644
--- a/drivers/staging/rtl8723au/hal/usb_halinit.c
+++ b/drivers/staging/rtl8723au/hal/usb_halinit.c
@@ -625,10 +625,10 @@ int rtl8723au_hal_init(struct rtw_adapter *Adapter)
}
 
/* reducing 80M spur */
-   PHY_SetBBReg(Adapter, RF_T_METER, bMaskDWord, 0x0381808d);
-   PHY_SetBBReg(Adapter, RF_SYN_G4, bMaskDWord, 0xf283);
-   PHY_SetBBReg(Adapter, RF_SYN_G4, bMaskDWord, 0xf282);
-   PHY_SetBBReg(Adapter, RF_SYN_G4, bMaskDWord, 0xf283);
+   PHY_SetBBReg(Adapter, REG_AFE_XTAL_CTRL, bMaskDWord, 0x0381808d);
+   PHY_SetBBReg(Adapter, REG_AFE_PLL_CTRL, bMaskDWord, 0xf083);
+   PHY_SetBBReg(Adapter, REG_AFE_PLL_CTRL, bMaskDWord, 0xf082);
+   PHY_SetBBReg(Adapter, REG_AFE_PLL_CTRL, bMaskDWord, 0xf083);
 
/* RFSW Control */
PHY_SetBBReg(Adapter, rFPGA0_TxInfo, bMaskDWord, 0x0003);   /* 
0x804[14]= 0 */
-- 
1.9.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 10/12] staging: rtl8723au: Hal8723PwrSeq.h: Remove PCI specific entries from the power sequence tables

2014-12-04 Thread Jes . Sorensen
From: Jes Sorensen 

Signed-off-by: Jes Sorensen 
---
 drivers/staging/rtl8723au/include/Hal8723PwrSeq.h | 8 +---
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/drivers/staging/rtl8723au/include/Hal8723PwrSeq.h 
b/drivers/staging/rtl8723au/include/Hal8723PwrSeq.h
index 4a1f58f..d2c1ff2 100644
--- a/drivers/staging/rtl8723au/include/Hal8723PwrSeq.h
+++ b/drivers/staging/rtl8723au/include/Hal8723PwrSeq.h
@@ -62,11 +62,9 @@
 
 
 #define RTL8723A_TRANS_CARDEMU_TO_SUS  
\
-   {0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_PCI_MSK, 
PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(4)|BIT(3), (BIT(4)|BIT(3))}, /*0x04[12:11] 
= 2b'11 enable WL suspend for PCIe*/   \
{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, 
PWR_INTF_USB_MSK|PWR_INTF_SDIO_MSK, PWR_BASEADDR_MAC, PWR_CMD_WRITE, 
BIT(3)|BIT(4), BIT(3)}, /*0x04[12:11] = 2b'01 enable WL suspend*/   \
{0x0023, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK, 
PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(4), BIT(4)}, /*0x23[4] = 1b'1 12H LDO 
enter sleep mode*/   \
{0x0007, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK, 
PWR_BASEADDR_MAC, PWR_CMD_WRITE, 0xFF, 0x20}, /*0x07[7:0] = 0x20 SDIO SOP 
option to disable BG/MB/ACK/SWR*/   \
-   {0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_PCI_MSK, 
PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(3)|BIT(4), BIT(3)|BIT(4)}, /*0x04[12:11] = 
2b'11 enable WL suspend for PCIe*/ \
{0x0086, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK, 
PWR_BASEADDR_SDIO, PWR_CMD_WRITE, BIT(0), BIT(0)}, /*Set SDIO suspend local 
register*/\
{0x0086, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK, 
PWR_BASEADDR_SDIO, PWR_CMD_POLLING, BIT(1), 0}, /*wait power state to suspend*/
 
@@ -80,7 +78,6 @@
 #define RTL8723A_TRANS_CARDEMU_TO_CARDDIS  
\
{0x0007, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK, 
PWR_BASEADDR_MAC, PWR_CMD_WRITE, 0xFF, 0x20}, /*0x07 = 0x20 , SOP option to 
disable BG/MB*/   \
{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, 
PWR_INTF_USB_MSK|PWR_INTF_SDIO_MSK, PWR_BASEADDR_MAC, PWR_CMD_WRITE, 
BIT(3)|BIT(4), BIT(3)}, /*0x04[12:11] = 2b'01 enable WL suspend*/   \
-   {0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_PCI_MSK, 
PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(2), BIT(2)}, /*0x04[10] = 1, enable SW 
LPS*/  \
{0x004A, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_USB_MSK, 
PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(0), 1}, /*0x48[16] = 1 to enable GPIO9 as 
EXT WAKEUP*/   \
{0x0023, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK, 
PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(4), BIT(4)}, /*0x23[4] = 1b'1 12H LDO 
enter sleep mode*/   \
{0x0086, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK, 
PWR_BASEADDR_SDIO, PWR_CMD_WRITE, BIT(0), BIT(0)}, /*Set SDIO suspend local 
register*/\
@@ -92,8 +89,7 @@
{0x0086, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK, 
PWR_BASEADDR_SDIO, PWR_CMD_POLLING, BIT(1), BIT(1)}, /*wait power state to 
suspend*/\
{0x004A, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_USB_MSK, 
PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(0), 0}, /*0x48[16] = 0 to disable GPIO9 as 
EXT WAKEUP*/   \
{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, 
PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(3)|BIT(4), 0}, /*0x04[12:11] = 2b'01enable 
WL suspend*/\
-   {0x0023, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK, 
PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(4), 0}, /*0x23[4] = 1b'0 12H LDO enter 
normal mode*/   \
-   {0x0301, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_PCI_MSK, 
PWR_BASEADDR_MAC, PWR_CMD_WRITE, 0xFF, 0},/*PCIe DMA start*/
+   {0x0023, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK, 
PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(4), 0}, /*0x23[4] = 1b'0 12H LDO enter 
normal mode*/
 
 
 #define RTL8723A_TRANS_CARDEMU_TO_PDN  
\
@@ -106,7 +102,6 @@
{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, 
PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(7), 0},/* 0x04[15] = 0*/
 
 #define RTL8723A_TRANS_ACT_TO_LPS  
\
-   {0x0301, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_PCI_MSK, 
PWR_BASEADDR_MAC, PWR_CMD_WRITE, 0xFF, 0xFF},/*PCIe DMA stop*/ \
{0x0522, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, 
PWR_BASEADDR_MAC, PWR_CMD_WRITE, 0xFF, 0xFF},/*Tx Pause*/  \
{0x05F8, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, 
PWR_BASEADDR_MAC, PWR_CMD_POLLING, 0xFF, 0},/*Should be zero if no packet is 
transmitting*/\
{0x05F9, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, 
PWR_BAS

[PATCH 04/12] staging: rtl8723au: Use enum for counter and avoid ugly typecast

2014-12-04 Thread Jes . Sorensen
From: Jes Sorensen 

Signed-off-by: Jes Sorensen 
---
 drivers/staging/rtl8723au/hal/rtl8723a_phycfg.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8723au/hal/rtl8723a_phycfg.c 
b/drivers/staging/rtl8723au/hal/rtl8723a_phycfg.c
index 88e91cd..e0fff53 100644
--- a/drivers/staging/rtl8723au/hal/rtl8723a_phycfg.c
+++ b/drivers/staging/rtl8723au/hal/rtl8723a_phycfg.c
@@ -1074,7 +1074,7 @@ PHY_SetBWMode23a8723A(struct rtw_adapter *Adapter,
 
 static void _PHY_SwChnl8723A(struct rtw_adapter *Adapter, u8 channel)
 {
-   u8 eRFPath;
+   enum RF_RADIO_PATH eRFPath;
u32 param1, param2;
struct hal_data_8723a *pHalData = GET_HAL_DATA(Adapter);
 
@@ -1088,7 +1088,7 @@ static void _PHY_SwChnl8723A(struct rtw_adapter *Adapter, 
u8 channel)
for (eRFPath = 0; eRFPath < pHalData->NumTotalRFPath; eRFPath++) {
pHalData->RfRegChnlVal[eRFPath] =
(pHalData->RfRegChnlVal[eRFPath] & 0xfc00) | param2;
-   PHY_SetRFReg(Adapter, (enum RF_RADIO_PATH)eRFPath, param1,
+   PHY_SetRFReg(Adapter, eRFPath, param1,
 bRFRegOffsetMask, pHalData->RfRegChnlVal[eRFPath]);
}
 
-- 
1.9.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 08/12] staging: rtl8723au: Hal8723APhyCfg.h: Remove more unused #defines

2014-12-04 Thread Jes . Sorensen
From: Jes Sorensen 

Signed-off-by: Jes Sorensen 
---
 drivers/staging/rtl8723au/include/Hal8723APhyCfg.h | 10 --
 1 file changed, 10 deletions(-)

diff --git a/drivers/staging/rtl8723au/include/Hal8723APhyCfg.h 
b/drivers/staging/rtl8723au/include/Hal8723APhyCfg.h
index fa6f4ae..2247d98 100644
--- a/drivers/staging/rtl8723au/include/Hal8723APhyCfg.h
+++ b/drivers/staging/rtl8723au/include/Hal8723APhyCfg.h
@@ -17,18 +17,8 @@
 #define __INC_HAL8723PHYCFG_H__
 
 /*--Define Parameters---*/
-#define LOOP_LIMIT 5
-#define MAX_STALL_TIME 50  /* us */
-#define AntennaDiversityValue  0x80
-#define MAX_TXPWR_IDX_NMODE_92S63
-#define Reset_Cnt_Limit3
-
-
 #define MAX_AGGR_NUM   0x0909
 
-/*--Define Parameters---*/
-
-
 /*--Define structure*/
 enum RF_RADIO_PATH {
RF_PATH_A = 0,  /* Radio Path A */
-- 
1.9.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 01/12] staging: rtl8723au: usb_dvobj_init(): A NULL pointer check for usb_host_endpoints makes no sense

2014-12-04 Thread Jes . Sorensen
From: Jes Sorensen 

struct usb_host_interface points to an array of
struct usb_host_endpoints - it makes no sense to do a NULL pointer
check for each pointer.

Signed-off-by: Jes Sorensen 
---
 drivers/staging/rtl8723au/os_dep/usb_intf.c | 72 +
 1 file changed, 33 insertions(+), 39 deletions(-)

diff --git a/drivers/staging/rtl8723au/os_dep/usb_intf.c 
b/drivers/staging/rtl8723au/os_dep/usb_intf.c
index 373a617..5007349 100644
--- a/drivers/staging/rtl8723au/os_dep/usb_intf.c
+++ b/drivers/staging/rtl8723au/os_dep/usb_intf.c
@@ -80,11 +80,9 @@ static struct dvobj_priv *usb_dvobj_init(struct 
usb_interface *usb_intf)
struct usb_config_descriptor *pconf_desc;
struct usb_host_interface *phost_iface;
struct usb_interface_descriptor *piface_desc;
-   struct usb_host_endpoint *phost_endp;
struct usb_endpoint_descriptor *pendp_desc;
-   struct usb_device*pusbd;
-   int i;
-   int status = _FAIL;
+   struct usb_device *pusbd;
+   int i, status = _FAIL;
 
pdvobjpriv = kzalloc(sizeof(*pdvobjpriv), GFP_KERNEL);
if (!pdvobjpriv)
@@ -114,42 +112,38 @@ static struct dvobj_priv *usb_dvobj_init(struct 
usb_interface *usb_intf)
pdvobjpriv->nr_endpoint = piface_desc->bNumEndpoints;
 
for (i = 0; i < pdvobjpriv->nr_endpoint; i++) {
-   phost_endp = phost_iface->endpoint + i;
-   if (phost_endp) {
-   pendp_desc = &phost_endp->desc;
-
-   DBG_8723A("\nusb_endpoint_descriptor(%d):\n", i);
-   DBG_8723A("bLength =%x\n", pendp_desc->bLength);
-   DBG_8723A("bDescriptorType =%x\n",
- pendp_desc->bDescriptorType);
-   DBG_8723A("bEndpointAddress =%x\n",
- pendp_desc->bEndpointAddress);
-   DBG_8723A("wMaxPacketSize =%d\n",
- le16_to_cpu(pendp_desc->wMaxPacketSize));
-   DBG_8723A("bInterval =%x\n", pendp_desc->bInterval);
-
-   if (usb_endpoint_is_bulk_in(pendp_desc)) {
-   DBG_8723A("usb_endpoint_is_bulk_in = %x\n",
- usb_endpoint_num(pendp_desc));
-   pdvobjpriv->RtInPipe[pdvobjpriv->RtNumInPipes] =
-   usb_endpoint_num(pendp_desc);
-   pdvobjpriv->RtNumInPipes++;
-   } else if (usb_endpoint_is_int_in(pendp_desc)) {
-   DBG_8723A("usb_endpoint_is_int_in = %x, 
Interval = %x\n",
- usb_endpoint_num(pendp_desc),
- pendp_desc->bInterval);
-   pdvobjpriv->RtInPipe[pdvobjpriv->RtNumInPipes] =
-   usb_endpoint_num(pendp_desc);
-   pdvobjpriv->RtNumInPipes++;
-   } else if (usb_endpoint_is_bulk_out(pendp_desc)) {
-   DBG_8723A("usb_endpoint_is_bulk_out = %x\n",
- usb_endpoint_num(pendp_desc));
-   
pdvobjpriv->RtOutPipe[pdvobjpriv->RtNumOutPipes] =
-   usb_endpoint_num(pendp_desc);
-   pdvobjpriv->RtNumOutPipes++;
-   }
-   pdvobjpriv->ep_num[i] = usb_endpoint_num(pendp_desc);
+   pendp_desc = &phost_iface->endpoint[i].desc;
+
+   DBG_8723A("\nusb_endpoint_descriptor(%d):\n", i);
+   DBG_8723A("bLength =%x\n", pendp_desc->bLength);
+   DBG_8723A("bDescriptorType =%x\n", pendp_desc->bDescriptorType);
+   DBG_8723A("bEndpointAddress =%x\n",
+ pendp_desc->bEndpointAddress);
+   DBG_8723A("wMaxPacketSize =%d\n",
+ le16_to_cpu(pendp_desc->wMaxPacketSize));
+   DBG_8723A("bInterval =%x\n", pendp_desc->bInterval);
+
+   if (usb_endpoint_is_bulk_in(pendp_desc)) {
+   DBG_8723A("usb_endpoint_is_bulk_in = %x\n",
+ usb_endpoint_num(pendp_desc));
+   pdvobjpriv->RtInPipe[pdvobjpriv->RtNumInPipes] =
+   usb_endpoint_num(pendp_desc);
+   pdvobjpriv->RtNumInPipes++;
+   } else if (usb_endpoint_is_int_in(pendp_desc)) {
+   DBG_8723A("usb_endpoint_is_int_in = %x, Interval 

[PATCH 09/12] staging: rtl8723au: HalPwrSeqCmdParsing23a(): Avoid unnecessary variable inits

2014-12-04 Thread Jes . Sorensen
From: Jes Sorensen 

Signed-off-by: Jes Sorensen 
---
 drivers/staging/rtl8723au/hal/HalPwrSeqCmd.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/rtl8723au/hal/HalPwrSeqCmd.c 
b/drivers/staging/rtl8723au/hal/HalPwrSeqCmd.c
index 1da4eec..33777d2 100644
--- a/drivers/staging/rtl8723au/hal/HalPwrSeqCmd.c
+++ b/drivers/staging/rtl8723au/hal/HalPwrSeqCmd.c
@@ -47,11 +47,11 @@ u8 HalPwrSeqCmdParsing23a(struct rtw_adapter *padapter, u8 
CutVersion,
   u8 FabVersion, u8 InterfaceType,
   struct wlan_pwr_cfg PwrSeqCmd[])
 {
-   struct wlan_pwr_cfg PwrCfgCmd = { 0 };
-   u8 bPollingBit = false;
+   struct wlan_pwr_cfg PwrCfgCmd;
+   u8 bPollingBit;
u32 AryIdx = 0;
-   u8 value = 0;
-   u32 offset = 0;
+   u8 value;
+   u32 offset;
u32 pollingCount = 0;   /*  polling autoload done. */
u32 maxPollingCnt = 5000;
 
-- 
1.9.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 11/12] staging: rtl8723au: Hal8723PwrSeq.h: Remove SDIO specific entries

2014-12-04 Thread Jes . Sorensen
From: Jes Sorensen 

Signed-off-by: Jes Sorensen 
---
 drivers/staging/rtl8723au/include/Hal8723PwrSeq.h | 40 +++
 1 file changed, 11 insertions(+), 29 deletions(-)

diff --git a/drivers/staging/rtl8723au/include/Hal8723PwrSeq.h 
b/drivers/staging/rtl8723au/include/Hal8723PwrSeq.h
index d2c1ff2..fe76221 100644
--- a/drivers/staging/rtl8723au/include/Hal8723PwrSeq.h
+++ b/drivers/staging/rtl8723au/include/Hal8723PwrSeq.h
@@ -39,10 +39,10 @@
  * { offset, cut_msk, fab_msk|interface_msk, base|cmd, msk, value },  comments 
here
  */
 #define RTL8723A_TRANS_CARDEMU_TO_ACT  
\
-   {0x0020, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, 
PWR_INTF_USB_MSK|PWR_INTF_SDIO_MSK, PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(0), 
BIT(0)}, /*0x20[0] = 1b'1 enable LDOA12 MACRO block for all interface*/ \
-   {0x0067, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, 
PWR_INTF_USB_MSK|PWR_INTF_SDIO_MSK, PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(4), 
0}, /*0x67[0] = 0 to disable BT_GPS_SEL pins*/  \
-   {0x0001, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, 
PWR_INTF_USB_MSK|PWR_INTF_SDIO_MSK, PWR_BASEADDR_MAC, PWR_CMD_DELAY, 1, 
PWRSEQ_DELAY_MS},/*Delay 1ms*/   \
-   {0x, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, 
PWR_INTF_USB_MSK|PWR_INTF_SDIO_MSK, PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(5), 
0}, /*0x00[5] = 1b'0 release analog Ips to digital , 1:isolation*/   \
+   {0x0020, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_USB_MSK, 
PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(0), BIT(0)}, /*0x20[0] = 1b'1 enable 
LDOA12 MACRO block for all interface*/ \
+   {0x0067, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_USB_MSK, 
PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(4), 0}, /*0x67[0] = 0 to disable 
BT_GPS_SEL pins*/\
+   {0x0001, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_USB_MSK, 
PWR_BASEADDR_MAC, PWR_CMD_DELAY, 1, PWRSEQ_DELAY_MS},/*Delay 1ms*/   \
+   {0x, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_USB_MSK, 
PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(5), 0}, /*0x00[5] = 1b'0 release analog 
Ips to digital , 1:isolation*/   \
{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, 
PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(2), 0},/* disable SW LPS 0x04[10]= 0*/ 
   \
{0x0006, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, 
PWR_BASEADDR_MAC, PWR_CMD_POLLING, BIT(1), BIT(1)},/* wait till 0x04[17] = 1
power ready*/  \
{0x0006, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, 
PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(0), BIT(0)},/* release WLON reset  
0x04[16]= 1*/ \
@@ -57,44 +57,28 @@
{0x004E, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, 
PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(7), 0},/*0x4C[23] = 0x4E[7] = 0, switch 
DPDT_SEL_P output from register 0x65[2] */\
{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, 
PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(1), BIT(1)}, /*0x04[9] = 1 turn off MAC by 
HW state machine*/ \
{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, 
PWR_BASEADDR_MAC, PWR_CMD_POLLING, BIT(1), 0}, /*wait till 0x04[9] = 0 polling 
until return 0 to disable*/ \
-   {0x, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, 
PWR_INTF_USB_MSK|PWR_INTF_SDIO_MSK, PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(5), 
BIT(5)}, /*0x00[5] = 1b'1 analog Ips to digital , 1:isolation*/   \
-   {0x0020, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, 
PWR_INTF_USB_MSK|PWR_INTF_SDIO_MSK, PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(0), 
0}, /*0x20[0] = 1b'0 disable LDOA12 MACRO block*/   \
+   {0x, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_USB_MSK, 
PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(5), BIT(5)}, /*0x00[5] = 1b'1 analog Ips 
to digital , 1:isolation*/   \
+   {0x0020, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_USB_MSK, 
PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(0), 0}, /*0x20[0] = 1b'0 disable LDOA12 
MACRO block*/   \
 
 
 #define RTL8723A_TRANS_CARDEMU_TO_SUS  
\
-   {0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, 
PWR_INTF_USB_MSK|PWR_INTF_SDIO_MSK, PWR_BASEADDR_MAC, PWR_CMD_WRITE, 
BIT(3)|BIT(4), BIT(3)}, /*0x04[12:11] = 2b'01 enable WL suspend*/   \
-   {0x0023, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK, 
PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(4), BIT(4)}, /*0x23[4] = 1b'1 12H LDO 
enter sleep mode*/   \
-   {0x0007, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK, 
PWR_BASEADDR_MAC, PWR_CMD_WRITE, 0xFF, 0x20}, /*0x07[7:0] = 0x20 SDIO SOP 
option to disable BG/MB/ACK/SWR*/   \
-   {0x0086, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK, 
PWR_BASEADDR_SDIO, PWR_CMD_WRITE, BIT(0), BIT(0)}, /*Set SDIO suspend local 
register*/\
-   {0x0086, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK, 
PWR_BASEADDR_SDIO, PWR_CMD_POLLING, BIT(1), 0}, /*wait power state to suspend*/
+   {0x0005, PWR_CUT_ALL_MSK, PW

[PATCH 00/12] staging: rtl8723au: Further cleanups

2014-12-04 Thread Jes . Sorensen
From: Jes Sorensen 

Hi,

This set removes a bunch of unused code, in addition it includes a fix
for using the right register definitions to when setting parameters to
reduce 80M spur.

This set should apply cleanly to staging-next as of today.

Cheers,
Jes

Jes Sorensen (12):
  staging: rtl8723au: usb_dvobj_init(): A NULL pointer check for
usb_host_endpoints makes no sense
  staging: rtl8723au: Use correct register names to set parameters to
reduce 80M spur
  staging: rtl8723au: Use proper enum defines
  staging: rtl8723au: Use enum for counter and avoid ugly typecast
  staging: rtl8723au: Hal8723APhyCfg.h: Remove some undefined structs
and enums
  staging: rtl8723au: Baseband is always configured through PHY regs
  staging: rtl8723au: There is no 11N pseudo PHY here
  staging: rtl8723au: Hal8723APhyCfg.h: Remove more unused #defines
  staging: rtl8723au: HalPwrSeqCmdParsing23a(): Avoid unnecessary
variable inits
  staging: rtl8723au: Hal8723PwrSeq.h: Remove PCI specific entries from
the power sequence tables
  staging: rtl8723au: Hal8723PwrSeq.h: Remove SDIO specific entries
  staging: rtl8723au: Hal8723PwrSeq.h: Use BIT() define to match mask
value

 drivers/staging/rtl8723au/hal/HalPwrSeqCmd.c   |  8 +--
 drivers/staging/rtl8723au/hal/rtl8723a_phycfg.c| 35 +++
 drivers/staging/rtl8723au/hal/usb_halinit.c| 14 +++--
 drivers/staging/rtl8723au/include/Hal8723APhyCfg.h | 55 -
 drivers/staging/rtl8723au/include/Hal8723PwrSeq.h  | 46 --
 drivers/staging/rtl8723au/os_dep/usb_intf.c| 72 ++
 6 files changed, 66 insertions(+), 164 deletions(-)

-- 
1.9.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 12/12] staging: rtl8723au: Hal8723PwrSeq.h: Use BIT() define to match mask value

2014-12-04 Thread Jes . Sorensen
From: Jes Sorensen 

This is a no-op change, but it improves consistency.

Signed-off-by: Jes Sorensen 
---
 drivers/staging/rtl8723au/include/Hal8723PwrSeq.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8723au/include/Hal8723PwrSeq.h 
b/drivers/staging/rtl8723au/include/Hal8723PwrSeq.h
index fe76221..3771d6b 100644
--- a/drivers/staging/rtl8723au/include/Hal8723PwrSeq.h
+++ b/drivers/staging/rtl8723au/include/Hal8723PwrSeq.h
@@ -70,7 +70,7 @@
 
 #define RTL8723A_TRANS_CARDEMU_TO_CARDDIS  
\
{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_USB_MSK, 
PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(3)|BIT(4), BIT(3)}, /*0x04[12:11] = 2b'01 
enable WL suspend*/ \
-   {0x004A, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_USB_MSK, 
PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(0), 1}, /*0x48[16] = 1 to enable GPIO9 as 
EXT WAKEUP*/
+   {0x004A, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_USB_MSK, 
PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(0), BIT(0)}, /*0x48[16] = 1 to enable 
GPIO9 as EXT WAKEUP*/
 
 #define RTL8723A_TRANS_CARDDIS_TO_CARDEMU  
\
{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, 
PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(3) | BIT(7), 0}, /*clear suspend enable 
and power down enable*/   \
-- 
1.9.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 06/12] staging: rtl8723au: Baseband is always configured through PHY regs

2014-12-04 Thread Jes . Sorensen
From: Jes Sorensen 

Signed-off-by: Jes Sorensen 
---
 drivers/staging/rtl8723au/hal/rtl8723a_phycfg.c| 19 ---
 drivers/staging/rtl8723au/include/Hal8723APhyCfg.h |  5 -
 2 files changed, 8 insertions(+), 16 deletions(-)

diff --git a/drivers/staging/rtl8723au/hal/rtl8723a_phycfg.c 
b/drivers/staging/rtl8723au/hal/rtl8723a_phycfg.c
index e0fff53..1692c49 100644
--- a/drivers/staging/rtl8723au/hal/rtl8723a_phycfg.c
+++ b/drivers/staging/rtl8723au/hal/rtl8723a_phycfg.c
@@ -698,7 +698,7 @@ storePwrIndexDiffRateOffset(struct rtw_adapter *Adapter, 
u32 RegAddr,
  * 11/10/2008  tynli   Modify to mew files.
  *---*/
 static int
-phy_ConfigBBWithPgHeaderFile(struct rtw_adapter *Adapter, u8 ConfigType)
+phy_ConfigBBWithPgHeaderFile(struct rtw_adapter *Adapter)
 {
int i;
u32 *Rtl819XPHY_REGArray_Table_PG;
@@ -707,17 +707,15 @@ phy_ConfigBBWithPgHeaderFile(struct rtw_adapter *Adapter, 
u8 ConfigType)
PHY_REGArrayPGLen = Rtl8723_PHY_REG_Array_PGLength;
Rtl819XPHY_REGArray_Table_PG = (u32 *)Rtl8723_PHY_REG_Array_PG;
 
-   if (ConfigType == BaseBand_Config_PHY_REG) {
-   for (i = 0; i < PHY_REGArrayPGLen; i = i + 3) {
-   storePwrIndexDiffRateOffset(Adapter,
-   Rtl819XPHY_REGArray_Table_PG[i],
-   Rtl819XPHY_REGArray_Table_PG[i+1],
-   Rtl819XPHY_REGArray_Table_PG[i+2]);
-   }
+   for (i = 0; i < PHY_REGArrayPGLen; i = i + 3) {
+   storePwrIndexDiffRateOffset(Adapter,
+   Rtl819XPHY_REGArray_Table_PG[i],
+   Rtl819XPHY_REGArray_Table_PG[i+1],
+   Rtl819XPHY_REGArray_Table_PG[i+2]);
}
 
return _SUCCESS;
-}  /* phy_ConfigBBWithPgHeaderFile */
+}
 
 static void
 phy_BB8192C_Config_1T(struct rtw_adapter *Adapter)
@@ -768,8 +766,7 @@ phy_BB8723a_Config_ParaFile(struct rtw_adapter *Adapter)
if (pEEPROM->bautoload_fail_flag == false) {
pHalData->pwrGroupCnt = 0;
 
-   rtStatus = phy_ConfigBBWithPgHeaderFile(Adapter,
-   
BaseBand_Config_PHY_REG);
+   rtStatus = phy_ConfigBBWithPgHeaderFile(Adapter);
}
 
if (rtStatus != _SUCCESS)
diff --git a/drivers/staging/rtl8723au/include/Hal8723APhyCfg.h 
b/drivers/staging/rtl8723au/include/Hal8723APhyCfg.h
index 66e2756..c1b7d08 100644
--- a/drivers/staging/rtl8723au/include/Hal8723APhyCfg.h
+++ b/drivers/staging/rtl8723au/include/Hal8723APhyCfg.h
@@ -49,11 +49,6 @@ enum WIRELESS_MODE {
WIRELESS_MODE_AC= BIT(6)
 };
 
-enum baseband_config_type {
-   BaseBand_Config_PHY_REG = 0,/* Radio Path A */
-   BaseBand_Config_AGC_TAB = 1,/* Radio Path B */
-};
-
 /* BB/RF related */
 enum rf_type_8190p {
RF_TYPE_MIN,/*  0 */
-- 
1.9.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 05/12] staging: rtl8723au: Hal8723APhyCfg.h: Remove some undefined structs and enums

2014-12-04 Thread Jes . Sorensen
From: Jes Sorensen 

Signed-off-by: Jes Sorensen 
---
 drivers/staging/rtl8723au/include/Hal8723APhyCfg.h | 39 --
 1 file changed, 39 deletions(-)

diff --git a/drivers/staging/rtl8723au/include/Hal8723APhyCfg.h 
b/drivers/staging/rtl8723au/include/Hal8723APhyCfg.h
index 688f204..66e2756 100644
--- a/drivers/staging/rtl8723au/include/Hal8723APhyCfg.h
+++ b/drivers/staging/rtl8723au/include/Hal8723APhyCfg.h
@@ -30,33 +30,6 @@
 
 
 /*--Define structure*/
-enum swchnlcmdid {
-   CmdID_End,
-   CmdID_SetTxPowerLevel,
-   CmdID_BBRegWrite10,
-   CmdID_WritePortUlong,
-   CmdID_WritePortUshort,
-   CmdID_WritePortUchar,
-   CmdID_RF_WriteReg,
-};
-
-
-/* 1. Switch channel related */
-struct swchnlcmd {
-   enum swchnlcmdidCmdID;
-   u32 Para1;
-   u32 Para2;
-   u32 msDelay;
-};
-
-enum HW90_BLOCK {
-   HW90_BLOCK_MAC = 0,
-   HW90_BLOCK_PHY0 = 1,
-   HW90_BLOCK_PHY1 = 2,
-   HW90_BLOCK_RF = 3,
-   HW90_BLOCK_MAXIMUM = 4, /*  Never use this */
-};
-
 enum RF_RADIO_PATH {
RF_PATH_A = 0,  /* Radio Path A */
RF_PATH_B = 1,  /* Radio Path B */
@@ -64,7 +37,6 @@ enum RF_RADIO_PATH {
 };
 
 #define CHANNEL_MAX_NUMBER 14  /*  14 is the max channel 
number */
-#define CHANNEL_GROUP_MAX  3   /*  ch1~3, ch4~9, ch10~14 total 
three groups */
 
 enum WIRELESS_MODE {
WIRELESS_MODE_UNKNOWN   = 0x00,
@@ -82,17 +54,6 @@ enum baseband_config_type {
BaseBand_Config_AGC_TAB = 1,/* Radio Path B */
 };
 
-enum ra_offset_area {
-   RA_OFFSET_LEGACY_OFDM1,
-   RA_OFFSET_LEGACY_OFDM2,
-   RA_OFFSET_HT_OFDM1,
-   RA_OFFSET_HT_OFDM2,
-   RA_OFFSET_HT_OFDM3,
-   RA_OFFSET_HT_OFDM4,
-   RA_OFFSET_HT_CCK,
-};
-
-
 /* BB/RF related */
 enum rf_type_8190p {
RF_TYPE_MIN,/*  0 */
-- 
1.9.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: rtl8723au: Fix sparse warnings

2014-12-12 Thread Jes Sorensen
Krzysztof Konopko  writes:
> On 12/12/14 00:53, Larry Finger wrote:
>> In RTL8188EU, both BA_starting_seqctrl and TXOP_limit are unsigned short.
>> 
>
> That's not quite the case.  `TXOP_limit` is __le16 in RTL8188EU [1].
> It's __le16 even in your GitHub repo [2].  And that made me thinking
> that there's probably some inconsistency in the header.
>
> I'm _far_ from being a wireless expert but doesn't data coming out of
> the wire/air have the endianess defined explicitly?  And both `AC_param`
> and `ADDBA_request` come out of air?
>
> I was hunting particularly for inconsistencies with `sparse` and came
> across this one.  But I dug a bit further and I wonder why the driver is
> not using standard stuff like the one in `include/linux/ieee80211.h`
> where any data wider than one byte is clearly declared as __le?

In general all over the wire data is little-endian. The driver has been
slowly moved towards using the standard defines from the Linux headers,
but this is a *lot* of work, and it requires testing. I really don't get
warm fuzzy feelings from patches that blindly make these kinds of
changes without also testing them.

Jes
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: rtl8723au: Fix sparse warnings

2014-12-12 Thread Jes Sorensen
Krzysztof Konopko  writes:
> Some struct fields in wifi.h are meant to be __le16 bu were declared as
> unsigned short.  This was reported by sparse:
>
>   rtw_wlan_util.c:538:24: warning: cast to restricted __le16
>   rtw_wlan_util.c:1544:29: warning: cast to restricted __le16
>   rtw_wlan_util.c:1546:25: warning: cast to restricted __le16
>
> This patch changes declared types of the struct fields involved.
>
> Signed-off-by: Krzysztof Konopko 
> ---
>  drivers/staging/rtl8723au/include/wifi.h | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/staging/rtl8723au/include/wifi.h 
> b/drivers/staging/rtl8723au/include/wifi.h
> index fd3da3b..8a2adc5 100644
> --- a/drivers/staging/rtl8723au/include/wifi.h
> +++ b/drivers/staging/rtl8723au/include/wifi.h
> @@ -28,7 +28,7 @@
>  struct AC_param {
>   unsigned char   ACI_AIFSN;
>   unsigned char   CW;
> - unsigned short  TXOP_limit;
> + __le16  TXOP_limit;
>  }  __packed;
>  
>  struct WMM_para_element {
> @@ -39,9 +39,9 @@ struct WMM_para_element {
>  
>  struct ADDBA_request {
>   unsigned char   dialog_token;
> - unsigned short  BA_para_set;
> + __le16  BA_para_set;
>   unsigned short  BA_timeout_value;
> - unsigned short  BA_starting_seqctrl;
> + __le16  BA_starting_seqctrl;
>  }  __packed;

If you are going to make the struct comply with the on-wire data format,
be consistent. Don't just change half the elements of the struct - that
will just lead to confusion.

Jes
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: rtl8723au: Fix sparse warnings

2014-12-12 Thread Jes Sorensen
Larry Finger  writes:
> On 12/12/2014 05:35 AM, Krzysztof Konopko wrote:
>> I was hunting particularly for inconsistencies with `sparse` and came
>> across this one.  But I dug a bit further and I wonder why the driver is
>> not using standard stuff like the one in `include/linux/ieee80211.h`
>> where any data wider than one byte is clearly declared as __le?
>
> That is a good question. One possibility is that those definitions do
> not exist on some of the older kernels that Realtek supports. They
> generally work with 2.6.18 and newer.

The reason the 8723au driver doesn't use the defines from there is that
in ieee80211.h they are part of struct ieee80211_mgmt, while the 8723au
driver access the addba etc. elements without the full struct in place.

Jes
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: rtl8723au: Fix sparse warnings

2014-12-15 Thread Jes Sorensen
Krzysztof Konopko  writes:
> On 12/12/14 19:52, Jes Sorensen wrote:
>> Larry Finger  writes:
>>> On 12/12/2014 05:35 AM, Krzysztof Konopko wrote:
>>>> I was hunting particularly for inconsistencies with `sparse` and came
>>>> across this one.  But I dug a bit further and I wonder why the driver is
>>>> not using standard stuff like the one in `include/linux/ieee80211.h`
>>>> where any data wider than one byte is clearly declared as __le?
>>>
>>> That is a good question. One possibility is that those definitions do
>>> not exist on some of the older kernels that Realtek supports. They
>>> generally work with 2.6.18 and newer.
>> 
>> The reason the 8723au driver doesn't use the defines from there is that
>> in ieee80211.h they are part of struct ieee80211_mgmt, while the 8723au
>> driver access the addba etc. elements without the full struct in place.
>> 
>
> And why is that the case?
> (I'm trying to understand, not debunk)
>
> Looks to me that this driver has been kept out of the tree for quite a
> while (by Realtek) and now suffers from locally invented stuff.  I
> understand this is a lot of work to unify the codebase with ieee80211.h,
> but are there any technical hurdles?  I'm just curious.

The main issue is that the RTL driver maintains a partial copy of the
management frame, ie. without the front block containing the MAC
addresses. Switching this over to carry a full copy of the frame is
extremely intrusive as it's mixed in pretty much everywhere in the
driver.

The driver is derived from Realtek's multi-OS vendor driver, which
included code for pretty much every OS on the planet. If you want to see
how it looked initially, check out Larry's github tree and go back to
the initial checkins  Realtek seem to copy it into a new tree and
devel from there whenever they do a new chip, so the legacy in this
codebase is huge.

Cheers,
Jes
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: rtl8723au: Fix sparse warnings

2014-12-15 Thread Jes Sorensen
Krzysztof Konopko  writes:
> Some struct fields in wifi.h are meant to be __le16 but were declared as
> unsigned short.  This was reported by sparse:
>
>   rtw_wlan_util.c:538:24: warning: cast to restricted __le16
>   rtw_wlan_util.c:1544:29: warning: cast to restricted __le16
>   rtw_wlan_util.c:1546:25: warning: cast to restricted __le16
>
> This patch changes the types of the struct fields involved to be
> little-endian which is what is received over the air and consistent with
> relevant structs in include/linux/ieee80211.h.
>
> Signed-off-by: Krzysztof Konopko 
> ---
>  drivers/staging/rtl8723au/include/wifi.h | 8 
>  1 file changed, 4 insertions(+), 4 deletions(-)

Looks OK

Signed-off-by: Jes Sorensen 


>
> diff --git a/drivers/staging/rtl8723au/include/wifi.h 
> b/drivers/staging/rtl8723au/include/wifi.h
> index fd3da3b..266c43e 100644
> --- a/drivers/staging/rtl8723au/include/wifi.h
> +++ b/drivers/staging/rtl8723au/include/wifi.h
> @@ -28,7 +28,7 @@
>  struct AC_param {
>   unsigned char   ACI_AIFSN;
>   unsigned char   CW;
> - unsigned short  TXOP_limit;
> + __le16  TXOP_limit;
>  }  __packed;
>  
>  struct WMM_para_element {
> @@ -39,9 +39,9 @@ struct WMM_para_element {
>  
>  struct ADDBA_request {
>   unsigned char   dialog_token;
> - unsigned short  BA_para_set;
> - unsigned short  BA_timeout_value;
> - unsigned short  BA_starting_seqctrl;
> + __le16  BA_para_set;
> + __le16  BA_timeout_value;
> + __le16  BA_starting_seqctrl;
>  }  __packed;
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: rtl8723au: Fix sparse warnings

2014-12-15 Thread Jes Sorensen
Krzysztof Konopko  writes:
> Some struct fields in wifi.h are meant to be __le16 but were declared as
> unsigned short.  This was reported by sparse:
>
>   rtw_wlan_util.c:538:24: warning: cast to restricted __le16
>   rtw_wlan_util.c:1544:29: warning: cast to restricted __le16
>   rtw_wlan_util.c:1546:25: warning: cast to restricted __le16
>
> This patch updates the types of the fields in `AC_param` and
> `ADDBA_request` structs to be consistent with relevant structs in
> include/linux/ieee80211.h.
>
> Signed-off-by: Krzysztof Konopko 
> ---
>  drivers/staging/rtl8723au/include/wifi.h | 14 +++---
>  1 file changed, 7 insertions(+), 7 deletions(-)

Well the u8 change is really in the nit picking space, but I am fine
with that too.

Signed-off-by: Jes Sorensen 

>
> diff --git a/drivers/staging/rtl8723au/include/wifi.h 
> b/drivers/staging/rtl8723au/include/wifi.h
> index fd3da3b..25d573c 100644
> --- a/drivers/staging/rtl8723au/include/wifi.h
> +++ b/drivers/staging/rtl8723au/include/wifi.h
> @@ -26,9 +26,9 @@
>  
> --*/
>  
>  struct AC_param {
> - unsigned char   ACI_AIFSN;
> - unsigned char   CW;
> - unsigned short  TXOP_limit;
> + u8  ACI_AIFSN;
> + u8  CW;
> + __le16  TXOP_limit;
>  }  __packed;
>  
>  struct WMM_para_element {
> @@ -38,10 +38,10 @@ struct WMM_para_element {
>  }  __packed;
>  
>  struct ADDBA_request {
> - unsigned char   dialog_token;
> - unsigned short  BA_para_set;
> - unsigned short  BA_timeout_value;
> - unsigned short  BA_starting_seqctrl;
> + u8  dialog_token;
> + __le16  BA_para_set;
> + __le16  BA_timeout_value;
> + __le16  BA_starting_seqctrl;
>  }  __packed;
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: rtl8723au: os_dep: usb_intf.c: Fix for possible null pointer dereference

2014-12-15 Thread Jes Sorensen
Dan Carpenter  writes:
> On Sun, Dec 14, 2014 at 11:39:14PM +0100, Rickard Strandqvist wrote:
>> There is otherwise a risk of a possible null pointer dereference.
>> 
>> Was largely found by using a static code analysis program called cppcheck.
>> 
>> Signed-off-by: Rickard Strandqvist 
>> ---
>>  drivers/staging/rtl8723au/os_dep/usb_intf.c |3 ++-
>>  1 file changed, 2 insertions(+), 1 deletion(-)
>> 
>> diff --git a/drivers/staging/rtl8723au/os_dep/usb_intf.c
>> b/drivers/staging/rtl8723au/os_dep/usb_intf.c
>> index 865743e..71a6330 100644
>> --- a/drivers/staging/rtl8723au/os_dep/usb_intf.c
>> +++ b/drivers/staging/rtl8723au/os_dep/usb_intf.c
>> @@ -351,10 +351,11 @@ error_exit:
>>  int rtw_hw_resume23a(struct rtw_adapter *padapter)
>
> That's weird.  Is this function even called?

[jes@ultrasam jes.git]$ find drivers/staging/rtl8723au -name \*.[ch] |xargs 
grep rtw_hw_resume
drivers/staging/rtl8723au/include/osdep_intf.h:int rtw_hw_resume23a(struct 
rtw_adapter *padapter);
drivers/staging/rtl8723au/os_dep/usb_intf.c:int rtw_hw_resume23a(struct 
rtw_adapter *padapter)
drivers/staging/rtl8723au/os_dep/usb_intf.c:DBG_8723A("==> 
rtw_hw_resume23a\n");
[jes@ultrasam jes.git]$ find drivers/staging/rtl8723au -name \*.[ch] |xargs 
grep rtw_hw_suspend
drivers/staging/rtl8723au/include/osdep_intf.h:int rtw_hw_suspend23a(struct 
rtw_adapter *padapter);
drivers/staging/rtl8723au/os_dep/usb_intf.c:int rtw_hw_suspend23a(struct 
rtw_adapter *padapter)
drivers/staging/rtl8723au/os_dep/usb_intf.c:DBG_8723A("==> 
rtw_hw_suspend23a\n");

A more useful patch would be one removing those two functions IMHO.

Jes
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: rtl8723au: core: fixing "foo * bar" should be "foo *bar"

2014-12-16 Thread Jes Sorensen
Asaf Vertz  writes:
> Fixed a coding style error, "foo * bar" should be "foo *bar"
>
> Signed-off-by: Asaf Vertz 
> ---
>  drivers/staging/rtl8723au/core/rtw_efuse.c |   12 ++--
>  1 files changed, 6 insertions(+), 6 deletions(-)

If you want to fix the 'error' here, include it with a cleanup that also
fixes the ugly multiline arguments to the functions.

Jes

> diff --git a/drivers/staging/rtl8723au/core/rtw_efuse.c 
> b/drivers/staging/rtl8723au/core/rtw_efuse.c
> index 81960e7..0e64d12 100644
> --- a/drivers/staging/rtl8723au/core/rtw_efuse.c
> +++ b/drivers/staging/rtl8723au/core/rtw_efuse.c
> @@ -328,12 +328,12 @@ EFUSE_Read1Byte23a(struct rtw_adapter *Adapter, u16 
> Address)
>  
>  void
>  EFUSE_Write1Byte(
> - struct rtw_adapter *Adapter,
> + struct rtw_adapter *Adapter,
>   u16 Address,
>   u8  Value);
>  void
>  EFUSE_Write1Byte(
> - struct rtw_adapter *Adapter,
> + struct rtw_adapter *Adapter,
>   u16 Address,
>   u8  Value)
>  {
> @@ -636,7 +636,7 @@ Efuse_ReadAllMap(struct rtw_adapter *pAdapter, u8 
> efuseType, u8 *Efuse)
>   
> *---*/
>  static void
>  efuse_ShadowRead1Byte(
> - struct rtw_adapter *pAdapter,
> + struct rtw_adapter *pAdapter,
>   u16 Offset,
>   u8  *Value)
>  {
> @@ -648,7 +648,7 @@ efuse_ShadowRead1Byte(
>  /* Read Two Bytes */
>  static void
>  efuse_ShadowRead2Byte(
> - struct rtw_adapter *pAdapter,
> + struct rtw_adapter *pAdapter,
>   u16 Offset,
>   u16 *Value)
>  {
> @@ -661,7 +661,7 @@ efuse_ShadowRead2Byte(
>  /* Read Four Bytes */
>  static void
>  efuse_ShadowRead4Byte(
> - struct rtw_adapter *pAdapter,
> + struct rtw_adapter *pAdapter,
>   u16 Offset,
>   u32 *Value)
>  {
> @@ -723,7 +723,7 @@ void EFUSE_ShadowMapUpdate23a(struct rtw_adapter 
> *pAdapter, u8 efuseType)
>   
> *---*/
>  void
>  EFUSE_ShadowRead23a(
> - struct rtw_adapter *pAdapter,
> + struct rtw_adapter *pAdapter,
>   u8  Type,
>   u16 Offset,
>   u32 *Value)
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v2] staging: rtl8723au: core: fixing "foo * bar" should be "foo *bar"

2014-12-16 Thread Jes Sorensen
Asaf Vertz  writes:
> Fixed a coding style error, "foo * bar" should be "foo *bar"
>
> Signed-off-by: Asaf Vertz 
> ---
> Changes in v2:
>   - fix ugly multiline arguments to the functions
>
>  drivers/staging/rtl8723au/core/rtw_efuse.c |   32 ++-
>  1 files changed, 7 insertions(+), 25 deletions(-)

Signed-off-by: Jes Sorensen 

> diff --git a/drivers/staging/rtl8723au/core/rtw_efuse.c 
> b/drivers/staging/rtl8723au/core/rtw_efuse.c
> index 81960e7..a6deddc 100644
> --- a/drivers/staging/rtl8723au/core/rtw_efuse.c
> +++ b/drivers/staging/rtl8723au/core/rtw_efuse.c
> @@ -327,15 +327,9 @@ EFUSE_Read1Byte23a(struct rtw_adapter *Adapter, u16 
> Address)
>   
> *---*/
>  
>  void
> -EFUSE_Write1Byte(
> - struct rtw_adapter *Adapter,
> - u16 Address,
> - u8  Value);
> +EFUSE_Write1Byte(struct rtw_adapter *Adapter, u16 Address, u8 Value);
>  void
> -EFUSE_Write1Byte(
> - struct rtw_adapter *Adapter,
> - u16 Address,
> - u8  Value)
> +EFUSE_Write1Byte(struct rtw_adapter *Adapter, u16 Address, u8 Value)
>  {
>   u8  Bytetemp = {0x00};
>   u8  temp = {0x00};
> @@ -635,10 +629,7 @@ Efuse_ReadAllMap(struct rtw_adapter *pAdapter, u8 
> efuseType, u8 *Efuse)
>   *
>   
> *---*/
>  static void
> -efuse_ShadowRead1Byte(
> - struct rtw_adapter *pAdapter,
> - u16 Offset,
> - u8  *Value)
> +efuse_ShadowRead1Byte(struct rtw_adapter *pAdapter, u16 Offset, u8 *Value)
>  {
>   struct eeprom_priv *pEEPROM = GET_EEPROM_EFUSE_PRIV(pAdapter);
>  
> @@ -647,10 +638,7 @@ efuse_ShadowRead1Byte(
>  
>  /* Read Two Bytes */
>  static void
> -efuse_ShadowRead2Byte(
> - struct rtw_adapter *pAdapter,
> - u16 Offset,
> - u16 *Value)
> +efuse_ShadowRead2Byte(struct rtw_adapter *pAdapter, u16 Offset, u16 *Value)
>  {
>   struct eeprom_priv *pEEPROM = GET_EEPROM_EFUSE_PRIV(pAdapter);
>  
> @@ -660,10 +648,7 @@ efuse_ShadowRead2Byte(
>  
>  /* Read Four Bytes */
>  static void
> -efuse_ShadowRead4Byte(
> - struct rtw_adapter *pAdapter,
> - u16 Offset,
> - u32 *Value)
> +efuse_ShadowRead4Byte(struct rtw_adapter *pAdapter, u16 Offset, u32 *Value)
>  {
>   struct eeprom_priv *pEEPROM = GET_EEPROM_EFUSE_PRIV(pAdapter);
>  
> @@ -722,11 +707,8 @@ void EFUSE_ShadowMapUpdate23a(struct rtw_adapter 
> *pAdapter, u8 efuseType)
>   *
>   
> *---*/
>  void
> -EFUSE_ShadowRead23a(
> - struct rtw_adapter *pAdapter,
> - u8  Type,
> - u16 Offset,
> - u32 *Value)
> +EFUSE_ShadowRead23a(struct rtw_adapter *pAdapter,
> + u8 Type, u16 Offset, u32 *Value)
>  {
>   if (Type == 1)
>   efuse_ShadowRead1Byte(pAdapter, Offset, (u8 *)Value);
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: rtl8723au: os_dep: usb_intf.c: Remove some unused functions

2014-12-17 Thread Jes Sorensen
Rickard Strandqvist  writes:
> Removes some functions that are not used anywhere:
> rtw_hw_resume23a() rtw_hw_suspend23a()
>
> This was partially found by using a static code analysis program called 
> cppcheck.
>
> Signed-off-by: Rickard Strandqvist 
> ---
>  drivers/staging/rtl8723au/include/osdep_intf.h |3 -
>  drivers/staging/rtl8723au/os_dep/usb_intf.c|  100 
> 
>  2 files changed, 103 deletions(-)

Signed-off-by: Jes Sorensen 

>
> diff --git a/drivers/staging/rtl8723au/include/osdep_intf.h 
> b/drivers/staging/rtl8723au/include/osdep_intf.h
> index 33afa62..a157eb2 100644
> --- a/drivers/staging/rtl8723au/include/osdep_intf.h
> +++ b/drivers/staging/rtl8723au/include/osdep_intf.h
> @@ -19,9 +19,6 @@
>  #include 
>  #include 
>  
> -int rtw_hw_suspend23a(struct rtw_adapter *padapter);
> -int rtw_hw_resume23a(struct rtw_adapter *padapter);
> -
>  int rtw_init_drv_sw23a(struct rtw_adapter *padapter);
>  int rtw_free_drv_sw23a(struct rtw_adapter *padapter);
>  int rtw_reset_drv_sw23a(struct rtw_adapter *padapter);
> diff --git a/drivers/staging/rtl8723au/os_dep/usb_intf.c 
> b/drivers/staging/rtl8723au/os_dep/usb_intf.c
> index 865743e..42eb90b 100644
> --- a/drivers/staging/rtl8723au/os_dep/usb_intf.c
> +++ b/drivers/staging/rtl8723au/os_dep/usb_intf.c
> @@ -287,106 +287,6 @@ static void rtw_dev_unload(struct rtw_adapter *padapter)
>   RT_TRACE(_module_hci_intfs_c_, _drv_err_, ("-rtw_dev_unload\n"));
>  }
>  
> -int rtw_hw_suspend23a(struct rtw_adapter *padapter)
> -{
> - struct pwrctrl_priv *pwrpriv = &padapter->pwrctrlpriv;
> - struct net_device *pnetdev = padapter->pnetdev;
> - struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
> -
> - if ((!padapter->bup) || (padapter->bDriverStopped) ||
> - (padapter->bSurpriseRemoved)) {
> - DBG_8723A("padapter->bup =%d bDriverStopped =%d 
> bSurpriseRemoved = %d\n",
> -   padapter->bup, padapter->bDriverStopped,
> -   padapter->bSurpriseRemoved);
> - goto error_exit;
> - }
> -
> - if (padapter) { /* system suspend */
> - LeaveAllPowerSaveMode23a(padapter);
> -
> - DBG_8723A("==> rtw_hw_suspend23a\n");
> - down(&pwrpriv->lock);
> - pwrpriv->bips_processing = true;
> - /* padapter->net_closed = true; */
> - /* s1. */
> - if (pnetdev) {
> - netif_carrier_off(pnetdev);
> - netif_tx_stop_all_queues(pnetdev);
> - }
> -
> - /* s2. */
> - rtw_disassoc_cmd23a(padapter, 500, false);
> -
> - /* s2-2.  indicate disconnect to os */
> - /* rtw_indicate_disconnect23a(padapter); */
> - if (check_fwstate(pmlmepriv, _FW_LINKED)) {
> - _clr_fwstate_(pmlmepriv, _FW_LINKED);
> -
> - rtw_led_control(padapter, LED_CTL_NO_LINK);
> -
> - rtw_os_indicate_disconnect23a(padapter);
> -
> - /* donnot enqueue cmd */
> - rtw_lps_ctrl_wk_cmd23a(padapter,
> -LPS_CTRL_DISCONNECT, 0);
> - }
> - /* s2-3. */
> - rtw_free_assoc_resources23a(padapter, 1);
> -
> - /* s2-4. */
> - rtw_free_network_queue23a(padapter);
> - rtw_ips_dev_unload23a(padapter);
> - pwrpriv->rf_pwrstate = rf_off;
> - pwrpriv->bips_processing = false;
> - up(&pwrpriv->lock);
> - } else {
> - goto error_exit;
> - }
> - return 0;
> -error_exit:
> - DBG_8723A("%s, failed\n", __func__);
> - return -1;
> -}
> -
> -int rtw_hw_resume23a(struct rtw_adapter *padapter)
> -{
> - struct pwrctrl_priv *pwrpriv = &padapter->pwrctrlpriv;
> - struct net_device *pnetdev = padapter->pnetdev;
> -
> - if (padapter) { /* system resume */
> - DBG_8723A("==> rtw_hw_resume23a\n");
> - down(&pwrpriv->lock);
> - pwrpriv->bips_processing = true;
> - rtw_reset_drv_sw23a(padapter);
> -
> - if (pm_netdev_open23a(pnetdev, false)) {
> - up(&pwrpriv->lock);
> - goto error_exit;
> - }
> -
> - netif_device_attach(pnetdev);
> - netif_carrier_on(pnetdev);
> -
> - if (!rtw_netif_queue_stopped(pnetd

Re: [PATCH] staging: rtl8723au: changes stop ap mode to use reset function

2015-01-02 Thread Jes Sorensen
Matthew Emerson  writes:
> Changes stop_ap_mode23a() to use rtw_reset_securitypriv23a. This makes
> the code cleaner and fixes two checkpatch.pl errors, one line over 80
> characters, and one spacing issue.
>
> Signed-off-by: Matthew Emerson 
> ---
>  drivers/staging/rtl8723au/core/rtw_ap.c | 6 ++
>  1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/staging/rtl8723au/core/rtw_ap.c 
> b/drivers/staging/rtl8723au/core/rtw_ap.c
> index e394d12c36b0..510ee212496f 100644
> --- a/drivers/staging/rtl8723au/core/rtw_ap.c
> +++ b/drivers/staging/rtl8723au/core/rtw_ap.c
> @@ -1870,10 +1870,8 @@ void stop_ap_mode23a(struct rtw_adapter *padapter)
>   pmlmepriv->update_bcn = false;
>   pmlmeext->bstart_bss = false;
>  
> - /* reset and init security priv , this can refine with 
> rtw_reset_securitypriv23a */
> - memset((unsigned char *)&padapter->securitypriv, 0, sizeof (struct 
> security_priv));
> - padapter->securitypriv.ndisauthtype = Ndis802_11AuthModeOpen;
> - padapter->securitypriv.ndisencryptstatus = Ndis802_11WEPDisabled;
> + /* reset and init security priv */
> + rtw_reset_securitypriv23a(padapter);

This is broken, rtw_reset_securitypriv23a() takes different actions
based on the value of adapter->securitypriv.dot11AuthAlgrthm - you leave
it at it's old value, which does not have the same effect as the above.

If anything you should remove the memset() and call
rtw_reset_securitypriv23a() after the two assignments.

NACK

Jes
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] drivers: staging: rtl8723au: get rid of unneeded memset/memcpy

2015-01-18 Thread Jes Sorensen
Greg Kroah-Hartman  writes:
> On Sun, Dec 07, 2014 at 03:37:20PM +0100, Emil Renner Berthing wrote:
>> This also fixes a sparse warning.
>
> What sparse warning?  What's wrong with the original code?  Unless Jes
> resends this to me, I don't see the need to apply it, sorry.

I agree, I cannot see what this is fixing, it does however add an ugly
cast.

If you want to change the paramters passed to FillH2CCmd() then change
the prototype and create something like struct h2c_cmd_arg{} and apply
that across the board.

NACK

Jes
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 18/19] staging: unisys: visorchipset: Don't include timskmod.h

2015-04-13 Thread Jes . Sorensen
From: Jes Sorensen 

Signed-off-by: Jes Sorensen 
Tested-by: Benjamin Romer 
---
 drivers/staging/unisys/visorchipset/parser.h   | 1 -
 drivers/staging/unisys/visorchipset/visorchipset.h | 1 -
 2 files changed, 2 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/parser.h 
b/drivers/staging/unisys/visorchipset/parser.h
index 73be279..3fe17c0 100644
--- a/drivers/staging/unisys/visorchipset/parser.h
+++ b/drivers/staging/unisys/visorchipset/parser.h
@@ -20,7 +20,6 @@
 
 #include 
 
-#include "timskmod.h"
 #include "channel.h"
 
 typedef enum {
diff --git a/drivers/staging/unisys/visorchipset/visorchipset.h 
b/drivers/staging/unisys/visorchipset/visorchipset.h
index 2c2d3fb..3c57782 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset.h
+++ b/drivers/staging/unisys/visorchipset/visorchipset.h
@@ -20,7 +20,6 @@
 
 #include 
 
-#include "timskmod.h"
 #include "channel.h"
 #include "controlvmchannel.h"
 #include "parser.h"
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 00/19] staging: unisys: visorchipset: Cleanups

2015-04-13 Thread Jes . Sorensen
From: Jes Sorensen 

Hi,

I did some cleanups of drivers/staging/unisys/visorchipset. There is
more to come, but this should improve the code, and also get rid of
some dead code that is no longer needed.

Thanks for Benjamin Romer @ Unisys for testing the changes.

Cheers,
Jes


Jes Sorensen (19):
  staging: unisys: visorchipset: Remove unused NONULLSTR()
  staging: unisys: visorchipset: Avoid struct typedef abuse
  staging: unisys: visorchipset: Get rid of ugly BOOL/TRUE/FALSE usage
  staging: unisys: visorchipset: Do not use confuse size of long with
size of u32
  staging: unisys: visorchipset: Use correct type for dev_no
  staging: unisys: visorchipset: Remove unused get_channel_info notifier
  staging: unisys: visorchipset: Get rid of ulong usage
  staging: unisys: visorchipset: Move module paramters around and mark
static
  staging: unisys: visorchipset: Move MYDRVNAME to visorchipset.h
  staging: unisys: visorchipset: Eliminate globals.h
  staging: unisys: visorchipset: Fix up a few cases of bad formatting
  staging: unisys: visorchipset: Remove some unnecessary parenthesis
  staging: unisys: visorchipset: Remove unncessary parenthesis
  staging: unisys: visorchipset: Don't zero struct elements which will
be memset away
  staging: unisys: visorchipset: Do not initialize variables
unnecessarily
  staging: unisys: visorchipset: Get rid of uint usage
  staging: unisys: visorchipset: Remove unused cache object counter
  staging: unisys: visorchipset: Don't include timskmod.h
  staging: unisys: visorchipset: Remove a couple of unnecessary blank
lines

 drivers/staging/unisys/visorchipset/file.c |  22 +-
 drivers/staging/unisys/visorchipset/file.h |   2 -
 drivers/staging/unisys/visorchipset/globals.h  |  42 
 drivers/staging/unisys/visorchipset/parser.c   |  40 +--
 drivers/staging/unisys/visorchipset/parser.h   |  11 +-
 drivers/staging/unisys/visorchipset/visorchipset.h |  47 ++--
 .../unisys/visorchipset/visorchipset_main.c| 280 ++---
 .../unisys/visorchipset/visorchipset_umode.h   |   4 +-
 8 files changed, 193 insertions(+), 255 deletions(-)
 delete mode 100644 drivers/staging/unisys/visorchipset/globals.h

-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 11/19] staging: unisys: visorchipset: Fix up a few cases of bad formatting

2015-04-13 Thread Jes . Sorensen
From: Jes Sorensen 

Signed-off-by: Jes Sorensen 
Tested-by: Benjamin Romer 
---
 drivers/staging/unisys/visorchipset/file.c | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/file.c 
b/drivers/staging/unisys/visorchipset/file.c
index 7d8247a..e63ef2a 100644
--- a/drivers/staging/unisys/visorchipset/file.c
+++ b/drivers/staging/unisys/visorchipset/file.c
@@ -99,7 +99,7 @@ visorchipset_mmap(struct file *file, struct vm_area_struct 
*vma)
 }
 
 static long visorchipset_ioctl(struct file *file, unsigned int cmd,
-   unsigned long arg)
+  unsigned long arg)
 {
s64 adjustment;
s64 vrtc_offset;
@@ -108,14 +108,14 @@ static long visorchipset_ioctl(struct file *file, 
unsigned int cmd,
case VMCALL_QUERY_GUEST_VIRTUAL_TIME_OFFSET:
/* get the physical rtc offset */
vrtc_offset = issue_vmcall_query_guest_virtual_time_offset();
-   if (copy_to_user
-   ((void __user *)arg, &vrtc_offset, sizeof(vrtc_offset))) {
+   if (copy_to_user((void __user *)arg, &vrtc_offset,
+sizeof(vrtc_offset))) {
return -EFAULT;
}
return SUCCESS;
case VMCALL_UPDATE_PHYSICAL_TIME:
-   if (copy_from_user
-   (&adjustment, (void __user *)arg, sizeof(adjustment))) {
+   if (copy_from_user(&adjustment, (void __user *)arg,
+  sizeof(adjustment))) {
return -EFAULT;
}
return issue_vmcall_update_physical_time(adjustment);
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 05/19] staging: unisys: visorchipset: Use correct type for dev_no

2015-04-13 Thread Jes . Sorensen
From: Jes Sorensen 

visorchipset_bus_info.dev_no is only assigned the value of
controlvm_message_packet.create_bus.dev_count, which is a u32. No
point promoting it to a u64.

Signed-off-by: Jes Sorensen 
Tested-by: Benjamin Romer 
---
 drivers/staging/unisys/visorchipset/visorchipset.h | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset.h 
b/drivers/staging/unisys/visorchipset/visorchipset.h
index 3a8aa56..3848de2 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset.h
+++ b/drivers/staging/unisys/visorchipset/visorchipset.h
@@ -141,8 +141,7 @@ struct visorchipset_bus_info {
struct controlvm_message_header pending_msg_hdr;/* CONTROLVM MsgHdr */
/** For private use by the bus driver */
void *bus_driver_context;
-   u64 dev_no;
-
+   u32 dev_no;
 };
 
 static inline struct visorchipset_bus_info *
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 01/19] staging: unisys: visorchipset: Remove unused NONULLSTR()

2015-04-13 Thread Jes . Sorensen
From: Jes Sorensen 

Signed-off-by: Jes Sorensen 
Tested-by: Benjamin Romer 
---
 drivers/staging/unisys/visorchipset/visorchipset_main.c | 8 
 1 file changed, 8 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c 
b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index f2663d2c..64586ab 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -51,14 +51,6 @@
 static ulong poll_jiffies = POLLJIFFIES_CONTROLVMCHANNEL_FAST;
 static ulong most_recent_message_jiffies;  /* when we got our last
 * controlvm message */
-static inline char *
-NONULLSTR(char *s)
-{
-   if (s)
-   return s;
-   return "";
-}
-
 static int serverregistered;
 static int clientregistered;
 
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 12/19] staging: unisys: visorchipset: Remove some unnecessary parenthesis

2015-04-13 Thread Jes . Sorensen
From: Jes Sorensen 

Signed-off-by: Jes Sorensen 
Tested-by: Benjamin Romer 
---
 drivers/staging/unisys/visorchipset/visorchipset_umode.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_umode.h 
b/drivers/staging/unisys/visorchipset/visorchipset_umode.h
index 6cf6eccb..8af5bf3 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_umode.h
+++ b/drivers/staging/unisys/visorchipset/visorchipset_umode.h
@@ -29,7 +29,7 @@
 /** The user-mode program can access the control channel buffer directly
  *  via this memory map.
  */
-#define VISORCHIPSET_MMAP_CONTROLCHANOFFSET(0x)
-#define VISORCHIPSET_MMAP_CONTROLCHANSIZE  (0x0040)  /* 4MB */
+#define VISORCHIPSET_MMAP_CONTROLCHANOFFSET0x
+#define VISORCHIPSET_MMAP_CONTROLCHANSIZE  0x0040  /* 4MB */
 
 #endif /* __VISORCHIPSET_UMODE_H */
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 14/19] staging: unisys: visorchipset: Don't zero struct elements which will be memset away

2015-04-13 Thread Jes . Sorensen
From: Jes Sorensen 

Signed-off-by: Jes Sorensen 
Tested-by: Benjamin Romer 
---
 drivers/staging/unisys/visorchipset/visorchipset_main.c | 6 --
 1 file changed, 6 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c 
b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index 4c8d8ef7..7c7e713 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -522,12 +522,7 @@ bus_info_clear(void *v)
struct visorchipset_bus_info *p = (struct visorchipset_bus_info *) v;
 
kfree(p->name);
-   p->name = NULL;
-
kfree(p->description);
-   p->description = NULL;
-
-   p->state.created = 0;
memset(p, 0, sizeof(struct visorchipset_bus_info));
 }
 
@@ -537,7 +532,6 @@ dev_info_clear(void *v)
struct visorchipset_device_info *p =
(struct visorchipset_device_info *) v;
 
-   p->state.created = 0;
memset(p, 0, sizeof(struct visorchipset_device_info));
 }
 
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 07/19] staging: unisys: visorchipset: Get rid of ulong usage

2015-04-13 Thread Jes . Sorensen
From: Jes Sorensen 

Signed-off-by: Jes Sorensen 
Tested-by: Benjamin Romer 
---
 drivers/staging/unisys/visorchipset/file.c   |  6 +++---
 drivers/staging/unisys/visorchipset/parser.c | 16 
 drivers/staging/unisys/visorchipset/parser.h |  2 +-
 3 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/file.c 
b/drivers/staging/unisys/visorchipset/file.c
index 203de0b..6fc5689 100644
--- a/drivers/staging/unisys/visorchipset/file.c
+++ b/drivers/staging/unisys/visorchipset/file.c
@@ -60,8 +60,8 @@ visorchipset_release(struct inode *inode, struct file *file)
 static int
 visorchipset_mmap(struct file *file, struct vm_area_struct *vma)
 {
-   ulong physaddr = 0;
-   ulong offset = vma->vm_pgoff << PAGE_SHIFT;
+   unsigned long physaddr = 0;
+   unsigned long offset = vma->vm_pgoff << PAGE_SHIFT;
GUEST_PHYSICAL_ADDRESS addr = 0;
 
/* sv_enable_dfp(); */
@@ -81,7 +81,7 @@ visorchipset_mmap(struct file *file, struct vm_area_struct 
*vma)
if (addr == 0) {
return -ENXIO;
}
-   physaddr = (ulong)addr;
+   physaddr = (unsigned long)addr;
if (remap_pfn_range(vma, vma->vm_start,
physaddr >> PAGE_SHIFT,
vma->vm_end - vma->vm_start,
diff --git a/drivers/staging/unisys/visorchipset/parser.c 
b/drivers/staging/unisys/visorchipset/parser.c
index b30e4c1..6ca6da8 100644
--- a/drivers/staging/unisys/visorchipset/parser.c
+++ b/drivers/staging/unisys/visorchipset/parser.c
@@ -29,13 +29,13 @@
  * incoming payloads.  This serves as a throttling mechanism.
  */
 #define MAX_CONTROLVM_PAYLOAD_BYTES (1024*128)
-static ulong controlvm_payload_bytes_buffered;
+static unsigned long controlvm_payload_bytes_buffered;
 
 struct parser_context {
-   ulong allocbytes;
-   ulong param_bytes;
+   unsigned long allocbytes;
+   unsigned long param_bytes;
u8 *curr;
-   ulong bytes_remaining;
+   unsigned long bytes_remaining;
bool byte_stream;
char data[0];
 };
@@ -84,7 +84,7 @@ parser_init_guts(u64 addr, u32 bytes, bool local,
rc = NULL;
goto cleanup;
}
-   p = __va((ulong) (addr));
+   p = __va((unsigned long) (addr));
memcpy(ctx->data, p, bytes);
} else {
rgn = visor_memregion_create(addr, bytes);
@@ -165,7 +165,7 @@ parser_simpleString_get(struct parser_context *ctx)
 
 /* Obtain a copy of the buffer in the payload area.
  */
-void *parser_byte_stream_get(struct parser_context *ctx, ulong *nbytes)
+void *parser_byte_stream_get(struct parser_context *ctx, unsigned long *nbytes)
 {
if (!ctx->byte_stream)
return NULL;
@@ -265,7 +265,7 @@ void *
 parser_param_get(struct parser_context *ctx, char *nam, int namesize)
 {
u8 *pscan, *pnam = nam;
-   ulong nscan;
+   unsigned long nscan;
int value_length = -1, orig_value_length = -1;
void *value = NULL;
int i;
@@ -400,7 +400,7 @@ void *
 parser_string_get(struct parser_context *ctx)
 {
u8 *pscan;
-   ulong nscan;
+   unsigned long nscan;
int value_length = -1;
void *value = NULL;
int i;
diff --git a/drivers/staging/unisys/visorchipset/parser.h 
b/drivers/staging/unisys/visorchipset/parser.h
index d3b0b33..73be279 100644
--- a/drivers/staging/unisys/visorchipset/parser.h
+++ b/drivers/staging/unisys/visorchipset/parser.h
@@ -40,7 +40,7 @@ void *parser_param_get(struct parser_context *ctx, char *nam, 
int namesize);
 void *parser_string_get(struct parser_context *ctx);
 uuid_le parser_id_get(struct parser_context *ctx);
 char *parser_simpleString_get(struct parser_context *ctx);
-void *parser_byte_stream_get(struct parser_context *ctx, ulong *nbytes);
+void *parser_byte_stream_get(struct parser_context *ctx, unsigned long 
*nbytes);
 void parser_done(struct parser_context *ctx);
 
 #endif
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 03/19] staging: unisys: visorchipset: Get rid of ugly BOOL/TRUE/FALSE usage

2015-04-13 Thread Jes . Sorensen
From: Jes Sorensen 

Signed-off-by: Jes Sorensen 
Tested-by: Benjamin Romer 
---
 drivers/staging/unisys/visorchipset/parser.c   | 24 +++---
 drivers/staging/unisys/visorchipset/parser.h   |  8 +-
 drivers/staging/unisys/visorchipset/visorchipset.h | 10 +--
 .../unisys/visorchipset/visorchipset_main.c| 98 +++---
 4 files changed, 70 insertions(+), 70 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/parser.c 
b/drivers/staging/unisys/visorchipset/parser.c
index d8a2d6f..b30e4c1 100644
--- a/drivers/staging/unisys/visorchipset/parser.c
+++ b/drivers/staging/unisys/visorchipset/parser.c
@@ -36,13 +36,13 @@ struct parser_context {
ulong param_bytes;
u8 *curr;
ulong bytes_remaining;
-   BOOL byte_stream;
+   bool byte_stream;
char data[0];
 };
 
 static struct parser_context *
-parser_init_guts(u64 addr, u32 bytes, BOOL local,
-BOOL standard_payload_header, BOOL *retry)
+parser_init_guts(u64 addr, u32 bytes, bool local,
+bool standard_payload_header, bool *retry)
 {
int allocbytes = sizeof(struct parser_context) + bytes;
struct parser_context *rc = NULL;
@@ -51,7 +51,7 @@ parser_init_guts(u64 addr, u32 bytes, BOOL local,
struct spar_controlvm_parameters_header *phdr = NULL;
 
if (retry)
-   *retry = FALSE;
+   *retry = false;
if (!standard_payload_header)
/* alloc and 0 extra byte to ensure payload is
 * '\0'-terminated
@@ -60,14 +60,14 @@ parser_init_guts(u64 addr, u32 bytes, BOOL local,
if ((controlvm_payload_bytes_buffered + bytes)
> MAX_CONTROLVM_PAYLOAD_BYTES) {
if (retry)
-   *retry = TRUE;
+   *retry = true;
rc = NULL;
goto cleanup;
}
ctx = kzalloc(allocbytes, GFP_KERNEL|__GFP_NORETRY);
if (!ctx) {
if (retry)
-   *retry = TRUE;
+   *retry = true;
rc = NULL;
goto cleanup;
}
@@ -76,7 +76,7 @@ parser_init_guts(u64 addr, u32 bytes, BOOL local,
ctx->param_bytes = bytes;
ctx->curr = NULL;
ctx->bytes_remaining = 0;
-   ctx->byte_stream = FALSE;
+   ctx->byte_stream = false;
if (local) {
void *p;
 
@@ -98,7 +98,7 @@ parser_init_guts(u64 addr, u32 bytes, BOOL local,
}
}
if (!standard_payload_header) {
-   ctx->byte_stream = TRUE;
+   ctx->byte_stream = true;
rc = ctx;
goto cleanup;
}
@@ -135,9 +135,9 @@ cleanup:
 }
 
 struct parser_context *
-parser_init(u64 addr, u32 bytes, BOOL local, BOOL *retry)
+parser_init(u64 addr, u32 bytes, bool local, bool *retry)
 {
-   return parser_init_guts(addr, bytes, local, TRUE, retry);
+   return parser_init_guts(addr, bytes, local, true, retry);
 }
 
 /* Call this instead of parser_init() if the payload area consists of just
@@ -146,9 +146,9 @@ parser_init(u64 addr, u32 bytes, BOOL local, BOOL *retry)
  * parser_byteStream_get() to obtain the data.
  */
 struct parser_context *
-parser_init_byte_stream(u64 addr, u32 bytes, BOOL local, BOOL *retry)
+parser_init_byte_stream(u64 addr, u32 bytes, bool local, bool *retry)
 {
-   return parser_init_guts(addr, bytes, local, FALSE, retry);
+   return parser_init_guts(addr, bytes, local, false, retry);
 }
 
 /* Obtain '\0'-terminated copy of string in payload area.
diff --git a/drivers/staging/unisys/visorchipset/parser.h 
b/drivers/staging/unisys/visorchipset/parser.h
index 2b903f1..d3b0b33 100644
--- a/drivers/staging/unisys/visorchipset/parser.h
+++ b/drivers/staging/unisys/visorchipset/parser.h
@@ -30,10 +30,10 @@ typedef enum {
PARSERSTRING_NAME,
 } PARSER_WHICH_STRING;
 
-struct parser_context *parser_init(u64 addr, u32 bytes, BOOL isLocal,
-  BOOL *tryAgain);
-struct parser_context *parser_init_byte_stream(u64 addr, u32 bytes, BOOL local,
-  BOOL *retry);
+struct parser_context *parser_init(u64 addr, u32 bytes, bool isLocal,
+  bool *tryAgain);
+struct parser_context *parser_init_byte_stream(u64 addr, u32 bytes, bool local,
+  bool *retry);
 void parser_param_start(struct parser_context *ctx,
PARSER_WHICH_STRING which_string);
 void *parser_param_get(struct parser_context *ctx, char *nam, int namesize);
diff --git a/drivers/staging/unisys/visorchipset/visorchipset.h 
b/drivers/staging/unisys/visorchipset/visorchipset.h
index bd46df9..4c1a74f 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset.h
+++ b/drivers/staging/unisys/visorchipset/visorchipset.h
@@ -217,19 +217,19 @@ typedef void (*SPARREPORTEVENT_COMPLETE_

[PATCH 04/19] staging: unisys: visorchipset: Do not use confuse size of long with size of u32

2015-04-13 Thread Jes . Sorensen
From: Jes Sorensen 

struct visorcipset_device_info defines bus_no and dev_no as u32, while
the deprecated ulong type is 64 bits. Hence avoid promoting the values
to 64 bit just to truncate them again later.

Signed-off-by: Jes Sorensen 
Tested-by: Benjamin Romer 
---
 drivers/staging/unisys/visorchipset/visorchipset.h | 35 ++-
 .../unisys/visorchipset/visorchipset_main.c| 67 +++---
 2 files changed, 50 insertions(+), 52 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset.h 
b/drivers/staging/unisys/visorchipset/visorchipset.h
index 4c1a74f..3a8aa56 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset.h
+++ b/drivers/staging/unisys/visorchipset/visorchipset.h
@@ -162,12 +162,12 @@ findbus(struct list_head *list, u32 bus_no)
  *  visorchipset.)
  */
 struct visorchipset_busdev_notifiers {
-   void (*bus_create)(ulong bus_no);
-   void (*bus_destroy)(ulong bus_no);
-   void (*device_create)(ulong bus_no, ulong dev_no);
-   void (*device_destroy)(ulong bus_no, ulong dev_no);
-   void (*device_pause)(ulong bus_no, ulong dev_no);
-   void (*device_resume)(ulong bus_no, ulong dev_no);
+   void (*bus_create)(u32 bus_no);
+   void (*bus_destroy)(u32 bus_no);
+   void (*device_create)(u32 bus_no, u32 dev_no);
+   void (*device_destroy)(u32 bus_no, u32 dev_no);
+   void (*device_pause)(u32 bus_no, u32 dev_no);
+   void (*device_resume)(u32 bus_no, u32 dev_no);
int (*get_channel_info)(uuid_le type_uuid, ulong *min_size,
ulong *max_size);
 };
@@ -179,12 +179,12 @@ struct visorchipset_busdev_notifiers {
  *  -1 = it failed
  */
 struct visorchipset_busdev_responders {
-   void (*bus_create)(ulong bus_no, int response);
-   void (*bus_destroy)(ulong bus_no, int response);
-   void (*device_create)(ulong bus_no, ulong dev_no, int response);
-   void (*device_destroy)(ulong bus_no, ulong dev_no, int response);
-   void (*device_pause)(ulong bus_no, ulong dev_no, int response);
-   void (*device_resume)(ulong bus_no, ulong dev_no, int response);
+   void (*bus_create)(u32 bus_no, int response);
+   void (*bus_destroy)(u32 bus_no, int response);
+   void (*device_create)(u32 bus_no, u32 dev_no, int response);
+   void (*device_destroy)(u32 bus_no, u32 dev_no, int response);
+   void (*device_pause)(u32 bus_no, u32 dev_no, int response);
+   void (*device_resume)(u32 bus_no, u32 dev_no, int response);
 };
 
 /** Register functions (in the bus driver) to get called by visorchipset
@@ -214,15 +214,14 @@ visorchipset_register_busdev_server(
 typedef void (*SPARREPORTEVENT_COMPLETE_FUNC) (struct controlvm_message *msg,
   int status);
 
-void visorchipset_device_pause_response(ulong bus_no, ulong dev_no,
-   int response);
+void visorchipset_device_pause_response(u32 bus_no, u32 dev_no, int response);
 
-bool visorchipset_get_bus_info(ulong bus_no,
+bool visorchipset_get_bus_info(u32 bus_no,
   struct visorchipset_bus_info *bus_info);
-bool visorchipset_get_device_info(ulong bus_no, ulong dev_no,
+bool visorchipset_get_device_info(u32 bus_no, u32 dev_no,
  struct visorchipset_device_info *dev_info);
-bool visorchipset_set_bus_context(ulong bus_no, void *context);
-bool visorchipset_set_device_context(ulong bus_no, ulong dev_no, void 
*context);
+bool visorchipset_set_bus_context(u32 bus_no, void *context);
+bool visorchipset_set_device_context(u32 bus_no, u32 dev_no, void *context);
 int visorchipset_chipset_ready(void);
 int visorchipset_chipset_selftest(void);
 int visorchipset_chipset_notready(void);
diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c 
b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index 0b016e3..54abe13 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -48,8 +48,8 @@
 * message, we switch back to fast polling mode.
 */
 #define MIN_IDLE_SECONDS 10
-static ulong poll_jiffies = POLLJIFFIES_CONTROLVMCHANNEL_FAST;
-static ulong most_recent_message_jiffies;  /* when we got our last
+static unsigned long poll_jiffies = POLLJIFFIES_CONTROLVMCHANNEL_FAST;
+static unsigned long most_recent_message_jiffies;  /* when we got our last
 * controlvm message */
 static int serverregistered;
 static int clientregistered;
@@ -67,8 +67,8 @@ static struct controlvm_message_header g_del_dump_msg_hdr;
 static const uuid_le spar_diag_pool_channel_protocol_uuid =
SPAR_DIAG_POOL_CHANNEL_PROTOCOL_UUID;
 /* 0xff is an invalid Bus/Device number */
-static ulong g_diagpool_bus_no = 0xff;
-static ulong g_diagpool_dev_no = 0xff;
+static u32 g_diagpool_bus_no = 0xff;
+static u32 g_diagpool_dev_no = 0xff

[PATCH 13/19] staging: unisys: visorchipset: Remove unncessary parenthesis

2015-04-13 Thread Jes . Sorensen
From: Jes Sorensen 

Signed-off-by: Jes Sorensen 
Tested-by: Benjamin Romer 
---
 drivers/staging/unisys/visorchipset/visorchipset_main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c 
b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index b7d2c2e..4c8d8ef7 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -519,7 +519,7 @@ static ssize_t remaining_steps_store(struct device *dev,
 static void
 bus_info_clear(void *v)
 {
-   struct visorchipset_bus_info *p = (struct visorchipset_bus_info *) (v);
+   struct visorchipset_bus_info *p = (struct visorchipset_bus_info *) v;
 
kfree(p->name);
p->name = NULL;
@@ -535,7 +535,7 @@ static void
 dev_info_clear(void *v)
 {
struct visorchipset_device_info *p =
-   (struct visorchipset_device_info *)(v);
+   (struct visorchipset_device_info *) v;
 
p->state.created = 0;
memset(p, 0, sizeof(struct visorchipset_device_info));
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 17/19] staging: unisys: visorchipset: Remove unused cache object counter

2015-04-13 Thread Jes . Sorensen
From: Jes Sorensen 

kmem_cache statistics are available through SLAB anyway

Signed-off-by: Jes Sorensen 
Tested-by: Benjamin Romer 
---
 drivers/staging/unisys/visorchipset/visorchipset_main.c | 4 
 1 file changed, 4 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c 
b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index 18ae71e..3538069 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -213,8 +213,6 @@ struct putfile_request {
int completion_status;
 };
 
-static atomic_t visorchipset_cache_buffers_in_use = ATOMIC_INIT(0);
-
 struct parahotplug_request {
struct list_head list;
int id;
@@ -2077,7 +2075,6 @@ visorchipset_cache_alloc(struct kmem_cache *pool, bool 
ok_to_block,
if (!p)
return NULL;
 
-   atomic_inc(&visorchipset_cache_buffers_in_use);
return p;
 }
 
@@ -2089,7 +2086,6 @@ visorchipset_cache_free(struct kmem_cache *pool, void *p, 
char *fn, int ln)
if (!p)
return;
 
-   atomic_dec(&visorchipset_cache_buffers_in_use);
kmem_cache_free(pool, p);
 }
 
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 15/19] staging: unisys: visorchipset: Do not initialize variables unnecessarily

2015-04-13 Thread Jes . Sorensen
From: Jes Sorensen 

Signed-off-by: Jes Sorensen 
Tested-by: Benjamin Romer 
---
 .../unisys/visorchipset/visorchipset_main.c| 36 +++---
 1 file changed, 18 insertions(+), 18 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c 
b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index 7c7e713..7f56563 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -782,7 +782,7 @@ EXPORT_SYMBOL_GPL(visorchipset_save_message);
 static void
 bus_responder(enum controlvm_id cmd_id, u32 bus_no, int response)
 {
-   struct visorchipset_bus_info *p = NULL;
+   struct visorchipset_bus_info *p;
bool need_clear = false;
 
p = findbus(&bus_info_list, bus_no);
@@ -818,7 +818,7 @@ device_changestate_responder(enum controlvm_id cmd_id,
 u32 bus_no, u32 dev_no, int response,
 struct spar_segment_state response_state)
 {
-   struct visorchipset_device_info *p = NULL;
+   struct visorchipset_device_info *p;
struct controlvm_message outmsg;
 
p = finddevice(&dev_info_list, bus_no, dev_no);
@@ -845,7 +845,7 @@ device_changestate_responder(enum controlvm_id cmd_id,
 static void
 device_responder(enum controlvm_id cmd_id, u32 bus_no, u32 dev_no, int 
response)
 {
-   struct visorchipset_device_info *p = NULL;
+   struct visorchipset_device_info *p;
bool need_clear = false;
 
p = finddevice(&dev_info_list, bus_no, dev_no);
@@ -943,7 +943,7 @@ device_epilog(u32 bus_no, u32 dev_no, struct 
spar_segment_state state, u32 cmd,
  struct controlvm_message_header *msg_hdr, int response,
  bool need_response, bool for_visorbus)
 {
-   struct visorchipset_busdev_notifiers *notifiers = NULL;
+   struct visorchipset_busdev_notifiers *notifiers;
bool notified = false;
 
struct visorchipset_device_info *dev_info =
@@ -1041,7 +1041,7 @@ bus_create(struct controlvm_message *inmsg)
struct controlvm_message_packet *cmd = &inmsg->cmd;
u32 bus_no = cmd->create_bus.bus_no;
int rc = CONTROLVM_RESP_SUCCESS;
-   struct visorchipset_bus_info *bus_info = NULL;
+   struct visorchipset_bus_info *bus_info;
 
bus_info = findbus(&bus_info_list, bus_no);
if (bus_info && (bus_info->state.created == 1)) {
@@ -1108,8 +1108,8 @@ bus_configure(struct controlvm_message *inmsg,
  struct parser_context *parser_ctx)
 {
struct controlvm_message_packet *cmd = &inmsg->cmd;
-   u32 bus_no = cmd->configure_bus.bus_no;
-   struct visorchipset_bus_info *bus_info = NULL;
+   u32 bus_no;
+   struct visorchipset_bus_info *bus_info;
int rc = CONTROLVM_RESP_SUCCESS;
char s[99];
 
@@ -1150,8 +1150,8 @@ my_device_create(struct controlvm_message *inmsg)
struct controlvm_message_packet *cmd = &inmsg->cmd;
u32 bus_no = cmd->create_device.bus_no;
u32 dev_no = cmd->create_device.dev_no;
-   struct visorchipset_device_info *dev_info = NULL;
-   struct visorchipset_bus_info *bus_info = NULL;
+   struct visorchipset_device_info *dev_info;
+   struct visorchipset_bus_info *bus_info;
int rc = CONTROLVM_RESP_SUCCESS;
 
dev_info = finddevice(&dev_info_list, bus_no, dev_no);
@@ -1221,7 +1221,7 @@ my_device_changestate(struct controlvm_message *inmsg)
u32 bus_no = cmd->device_change_state.bus_no;
u32 dev_no = cmd->device_change_state.dev_no;
struct spar_segment_state state = cmd->device_change_state.state;
-   struct visorchipset_device_info *dev_info = NULL;
+   struct visorchipset_device_info *dev_info;
int rc = CONTROLVM_RESP_SUCCESS;
 
dev_info = finddevice(&dev_info_list, bus_no, dev_no);
@@ -1248,7 +1248,7 @@ my_device_destroy(struct controlvm_message *inmsg)
struct controlvm_message_packet *cmd = &inmsg->cmd;
u32 bus_no = cmd->destroy_device.bus_no;
u32 dev_no = cmd->destroy_device.dev_no;
-   struct visorchipset_device_info *dev_info = NULL;
+   struct visorchipset_device_info *dev_info;
int rc = CONTROLVM_RESP_SUCCESS;
 
dev_info = finddevice(&dev_info_list, bus_no, dev_no);
@@ -1538,8 +1538,8 @@ parahotplug_request_kickoff(struct parahotplug_request 
*req)
 static void
 parahotplug_process_list(void)
 {
-   struct list_head *pos = NULL;
-   struct list_head *tmp = NULL;
+   struct list_head *pos;
+   struct list_head *tmp;
 
spin_lock(¶hotplug_request_list_lock);
 
@@ -1570,8 +1570,8 @@ parahotplug_process_list(void)
 static int
 parahotplug_request_complete(int id, u16 active)
 {
-   struct list_head *pos = NULL;
-   struct list_head *tmp = NULL;
+   struct list_head *pos;
+   struct list_hea

[PATCH 02/19] staging: unisys: visorchipset: Avoid struct typedef abuse

2015-04-13 Thread Jes . Sorensen
From: Jes Sorensen 

Signed-off-by: Jes Sorensen 
Tested-by: Benjamin Romer 
---
 .../staging/unisys/visorchipset/visorchipset_main.c  | 20 
 1 file changed, 12 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c 
b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index 64586ab..a1d0190 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -91,17 +91,19 @@ static LIST_HEAD(dev_info_list);
 static struct visorchannel *controlvm_channel;
 
 /* Manages the request payload in the controlvm channel */
-static struct controlvm_payload_info {
+struct visor_controlvm_payload_info {
u8 __iomem *ptr;/* pointer to base address of payload pool */
u64 offset; /* offset from beginning of controlvm
 * channel to beginning of payload * pool */
u32 bytes;  /* number of bytes in payload pool */
-} controlvm_payload_info;
+};
+
+static struct visor_controlvm_payload_info controlvm_payload_info;
 
 /* Manages the info for a CONTROLVM_DUMP_CAPTURESTATE /
  * CONTROLVM_DUMP_GETTEXTDUMP / CONTROLVM_DUMP_COMPLETE conversation.
  */
-static struct livedump_info {
+struct visor_livedump_info {
struct controlvm_message_header dumpcapture_header;
struct controlvm_message_header gettextdump_header;
struct controlvm_message_header dumpcomplete_header;
@@ -110,7 +112,9 @@ static struct livedump_info {
ulong length;
atomic_t buffers_in_use;
ulong destination;
-} livedump_info;
+};
+
+static struct visor_livedump_info livedump_info;
 
 /* The following globals are used to handle the scenario where we are unable to
  * offload the payload from a controlvm message due to memory requirements.  In
@@ -1262,7 +1266,7 @@ my_device_destroy(struct controlvm_message *inmsg)
  */
 static int
 initialize_controlvm_payload_info(HOSTADDRESS phys_addr, u64 offset, u32 bytes,
- struct controlvm_payload_info *info)
+ struct visor_controlvm_payload_info *info)
 {
u8 __iomem *payload = NULL;
int rc = CONTROLVM_RESP_SUCCESS;
@@ -1271,7 +1275,7 @@ initialize_controlvm_payload_info(HOSTADDRESS phys_addr, 
u64 offset, u32 bytes,
rc = -CONTROLVM_RESP_ERROR_PAYLOAD_INVALID;
goto cleanup;
}
-   memset(info, 0, sizeof(struct controlvm_payload_info));
+   memset(info, 0, sizeof(struct visor_controlvm_payload_info));
if ((offset == 0) || (bytes == 0)) {
rc = -CONTROLVM_RESP_ERROR_PAYLOAD_INVALID;
goto cleanup;
@@ -1297,13 +1301,13 @@ cleanup:
 }
 
 static void
-destroy_controlvm_payload_info(struct controlvm_payload_info *info)
+destroy_controlvm_payload_info(struct visor_controlvm_payload_info *info)
 {
if (info->ptr) {
iounmap(info->ptr);
info->ptr = NULL;
}
-   memset(info, 0, sizeof(struct controlvm_payload_info));
+   memset(info, 0, sizeof(struct visor_controlvm_payload_info));
 }
 
 static void
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 19/19] staging: unisys: visorchipset: Remove a couple of unnecessary blank lines

2015-04-13 Thread Jes . Sorensen
From: Jes Sorensen 

Signed-off-by: Jes Sorensen 
Tested-by: Benjamin Romer 
---
 drivers/staging/unisys/visorchipset/visorchipset.h | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset.h 
b/drivers/staging/unisys/visorchipset/visorchipset.h
index 3c57782..53bbc49 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset.h
+++ b/drivers/staging/unisys/visorchipset/visorchipset.h
@@ -68,7 +68,6 @@ struct visorchipset_channel_info {
u64 n_channel_bytes;
uuid_le channel_type_uuid;
uuid_le channel_inst_uuid;
-
 };
 
 /** Attributes for a particular Supervisor device.
@@ -90,7 +89,6 @@ struct visorchipset_device_info {
struct controlvm_message_header pending_msg_hdr;/* CONTROLVM_MESSAGE */
/** For private use by the bus driver */
void *bus_driver_context;
-
 };
 
 static inline struct visorchipset_device_info *finddevice(
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 16/19] staging: unisys: visorchipset: Get rid of uint usage

2015-04-13 Thread Jes . Sorensen
From: Jes Sorensen 

Signed-off-by: Jes Sorensen 
Tested-by: Benjamin Romer 
---
 drivers/staging/unisys/visorchipset/visorchipset_main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c 
b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index 7f56563..18ae71e 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -2120,7 +2120,7 @@ static ssize_t devicedisabled_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
 {
-   uint id;
+   unsigned int id;
 
if (kstrtouint(buf, 10, &id) != 0)
return -EINVAL;
@@ -2137,7 +2137,7 @@ static ssize_t deviceenabled_store(struct device *dev,
   struct device_attribute *attr,
   const char *buf, size_t count)
 {
-   uint id;
+   unsigned int id;
 
if (kstrtouint(buf, 10, &id) != 0)
return -EINVAL;
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 08/19] staging: unisys: visorchipset: Move module paramters around and mark static

2015-04-13 Thread Jes . Sorensen
From: Jes Sorensen 

Signed-off-by: Jes Sorensen 
Tested-by: Benjamin Romer 
---
 drivers/staging/unisys/visorchipset/globals.h  | 11 
 .../unisys/visorchipset/visorchipset_main.c| 33 +++---
 2 files changed, 17 insertions(+), 27 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/globals.h 
b/drivers/staging/unisys/visorchipset/globals.h
index f76e498..0884a68 100644
--- a/drivers/staging/unisys/visorchipset/globals.h
+++ b/drivers/staging/unisys/visorchipset/globals.h
@@ -28,15 +28,4 @@
 
 /* module parameters */
 
-extern int visorchipset_testvnic;
-extern int visorchipset_testvnicclient;
-extern int visorchipset_testmsg;
-extern int visorchipset_major;
-extern int visorchipset_serverregwait;
-extern int visorchipset_clientregwait;
-extern int visorchipset_testteardown;
-extern int visorchipset_disable_controlvm;
-extern int visorchipset_crash_kernel;
-extern int visorchipset_holdchipsetready;
-
 #endif
diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c 
b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index 54abe13..4f7d986 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -43,6 +43,20 @@
 #define POLLJIFFIES_CONTROLVMCHANNEL_FAST   1
 #define POLLJIFFIES_CONTROLVMCHANNEL_SLOW 100
 
+/*
+ * Module parameters
+ */
+static int visorchipset_testvnic;
+static int visorchipset_testvnicclient;
+static int visorchipset_testmsg;
+static int visorchipset_major;
+static int visorchipset_serverregwait;
+static int visorchipset_clientregwait = 1; /* default is on */
+static int visorchipset_testteardown;
+static int visorchipset_disable_controlvm;
+static int visorchipset_crash_kernel;
+static int visorchipset_holdchipsetready;
+
 /* When the controlvm channel is idle for at least MIN_IDLE_SECONDS,
 * we switch to slow polling mode.  As soon as we get a controlvm
 * message, we switch back to fast polling mode.
@@ -2279,47 +2293,34 @@ visorchipset_exit(void)
 
 module_param_named(testvnic, visorchipset_testvnic, int, S_IRUGO);
 MODULE_PARM_DESC(visorchipset_testvnic, "1 to test vnic, using dummy VNIC 
connected via a loopback to a physical ethernet");
-int visorchipset_testvnic = 0;
-
 module_param_named(testvnicclient, visorchipset_testvnicclient, int, S_IRUGO);
 MODULE_PARM_DESC(visorchipset_testvnicclient, "1 to test vnic, using real VNIC 
channel attached to a separate IOVM guest");
-int visorchipset_testvnicclient = 0;
-
 module_param_named(testmsg, visorchipset_testmsg, int, S_IRUGO);
 MODULE_PARM_DESC(visorchipset_testmsg,
 "1 to manufacture the chipset, bus, and switch messages");
-int visorchipset_testmsg = 0;
-
 module_param_named(major, visorchipset_major, int, S_IRUGO);
-MODULE_PARM_DESC(visorchipset_major, "major device number to use for the 
device node");
-int visorchipset_major = 0;
-
+MODULE_PARM_DESC(visorchipset_major,
+"major device number to use for the device node");
 module_param_named(serverregwait, visorchipset_serverregwait, int, S_IRUGO);
 MODULE_PARM_DESC(visorchipset_serverreqwait,
 "1 to have the module wait for the visor bus to register");
-int visorchipset_serverregwait = 0;/* default is off */
 module_param_named(clientregwait, visorchipset_clientregwait, int, S_IRUGO);
 MODULE_PARM_DESC(visorchipset_clientregwait, "1 to have the module wait for 
the visorclientbus to register");
-int visorchipset_clientregwait = 1;/* default is on */
 module_param_named(testteardown, visorchipset_testteardown, int, S_IRUGO);
 MODULE_PARM_DESC(visorchipset_testteardown,
 "1 to test teardown of the chipset, bus, and switch");
-int visorchipset_testteardown = 0; /* default is off */
 module_param_named(disable_controlvm, visorchipset_disable_controlvm, int,
   S_IRUGO);
 MODULE_PARM_DESC(visorchipset_disable_controlvm,
 "1 to disable polling of controlVm channel");
-int visorchipset_disable_controlvm = 0;/* default is off */
 module_param_named(crash_kernel, visorchipset_crash_kernel, int, S_IRUGO);
 MODULE_PARM_DESC(visorchipset_crash_kernel,
 "1 means we are running in crash kernel");
-int visorchipset_crash_kernel = 0; /* default is running in non-crash kernel */
 module_param_named(holdchipsetready, visorchipset_holdchipsetready,
   int, S_IRUGO);
 MODULE_PARM_DESC(visorchipset_holdchipsetready,
 "1 to hold response to CHIPSET_READY");
-int visorchipset_holdchipsetready = 0; /* default is to send CHIPSET_READY
- * response immediately */
+
 module_init(visorchipset_init);
 module_exit(visorchipset_exit);
 
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 09/19] staging: unisys: visorchipset: Move MYDRVNAME to visorchipset.h

2015-04-13 Thread Jes . Sorensen
From: Jes Sorensen 

Signed-off-by: Jes Sorensen 
Tested-by: Benjamin Romer 
---
 drivers/staging/unisys/visorchipset/globals.h  | 2 --
 drivers/staging/unisys/visorchipset/visorchipset.h | 2 ++
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/globals.h 
b/drivers/staging/unisys/visorchipset/globals.h
index 0884a68..ee7e3b4 100644
--- a/drivers/staging/unisys/visorchipset/globals.h
+++ b/drivers/staging/unisys/visorchipset/globals.h
@@ -24,8 +24,6 @@
 #include "visorchipset_umode.h"
 #include "version.h"
 
-#define MYDRVNAME "visorchipset"
-
 /* module parameters */
 
 #endif
diff --git a/drivers/staging/unisys/visorchipset/visorchipset.h 
b/drivers/staging/unisys/visorchipset/visorchipset.h
index 87b63f0..2c2d3fb 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset.h
+++ b/drivers/staging/unisys/visorchipset/visorchipset.h
@@ -28,6 +28,8 @@
 #include "vbusdeviceinfo.h"
 #include "vbushelper.h"
 
+#define MYDRVNAME "visorchipset"
+
 /** Describes the state from the perspective of which controlvm messages have
  *  been received for a bus or device.
  */
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 10/19] staging: unisys: visorchipset: Eliminate globals.h

2015-04-13 Thread Jes . Sorensen
From: Jes Sorensen 

Signed-off-by: Jes Sorensen 
Tested-by: Benjamin Romer 
---
 drivers/staging/unisys/visorchipset/file.c |  6 +++--
 drivers/staging/unisys/visorchipset/file.h |  2 --
 drivers/staging/unisys/visorchipset/globals.h  | 29 --
 .../unisys/visorchipset/visorchipset_main.c|  2 +-
 4 files changed, 5 insertions(+), 34 deletions(-)
 delete mode 100644 drivers/staging/unisys/visorchipset/globals.h

diff --git a/drivers/staging/unisys/visorchipset/file.c 
b/drivers/staging/unisys/visorchipset/file.c
index 6fc5689..7d8247a 100644
--- a/drivers/staging/unisys/visorchipset/file.c
+++ b/drivers/staging/unisys/visorchipset/file.c
@@ -19,10 +19,12 @@
  * communicate with the visorchipset driver using a device/file interface.
  */
 
-#include "globals.h"
-#include "visorchannel.h"
 #include 
 #include 
+#include "version.h"
+#include "visorchipset.h"
+#include "visorchipset_umode.h"
+#include "visorchannel.h"
 #include "uisutils.h"
 #include "file.h"
 
diff --git a/drivers/staging/unisys/visorchipset/file.h 
b/drivers/staging/unisys/visorchipset/file.h
index 51f7699..6ff28a1 100644
--- a/drivers/staging/unisys/visorchipset/file.h
+++ b/drivers/staging/unisys/visorchipset/file.h
@@ -18,8 +18,6 @@
 #ifndef __FILE_H__
 #define __FILE_H__
 
-#include "globals.h"
-
 int visorchipset_file_init(dev_t majorDev,
   struct visorchannel **pControlVm_channel);
 void visorchipset_file_cleanup(dev_t major_dev);
diff --git a/drivers/staging/unisys/visorchipset/globals.h 
b/drivers/staging/unisys/visorchipset/globals.h
deleted file mode 100644
index ee7e3b4..000
--- a/drivers/staging/unisys/visorchipset/globals.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/* globals.h
- *
- * Copyright (C) 2010 - 2013 UNISYS CORPORATION
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or (at
- * your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
- * NON INFRINGEMENT.  See the GNU General Public License for more
- * details.
- */
-
-#ifndef __VISORCHIPSET_GLOBALS_H__
-#define __VISORCHIPSET_GLOBALS_H__
-
-#include "diagnostics/appos_subsystems.h"
-#include "timskmod.h"
-#include "visorchipset.h"
-#include "visorchipset_umode.h"
-#include "version.h"
-
-/* module parameters */
-
-#endif
diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c 
b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index 4f7d986..b7d2c2e 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -15,7 +15,7 @@
  * details.
  */
 
-#include "globals.h"
+#include "version.h"
 #include "visorchipset.h"
 #include "procobjecttree.h"
 #include "visorchannel.h"
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 06/19] staging: unisys: visorchipset: Remove unused get_channel_info notifier

2015-04-13 Thread Jes . Sorensen
From: Jes Sorensen 

Signed-off-by: Jes Sorensen 
Tested-by: Benjamin Romer 
---
 drivers/staging/unisys/visorchipset/visorchipset.h | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset.h 
b/drivers/staging/unisys/visorchipset/visorchipset.h
index 3848de2..87b63f0 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset.h
+++ b/drivers/staging/unisys/visorchipset/visorchipset.h
@@ -167,8 +167,6 @@ struct visorchipset_busdev_notifiers {
void (*device_destroy)(u32 bus_no, u32 dev_no);
void (*device_pause)(u32 bus_no, u32 dev_no);
void (*device_resume)(u32 bus_no, u32 dev_no);
-   int (*get_channel_info)(uuid_le type_uuid, ulong *min_size,
-   ulong *max_size);
 };
 
 /*  These functions live inside visorchipset, and will be called to indicate
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: Anybody working on rtl8712?

2015-05-05 Thread Jes Sorensen
Xose Vazquez Perez  writes:
> On 06/20/2014 10:52 PM, Christian Lamparter wrote:
>
>> rtl8192su development is chugging along. It just doesn't take place on
>> driverdev list. The driver reached "feature parity" with rtl8192cu for
>> some time ago. But as with rtl8192cu, I would recommend adding just
>> a friendly "printk". Yup, Realtek really outdid themselves with the USB
>> devices.
>
> IMO rtl8192u staging driver should be replaced asap with
> https://github.com/chunkeey/rtl8192su
> Because people are wasting time fixing the staging code with no future.
>
> It also happens with rtl8188eu/rtl8xxxu

Looking at that page, the first thing that stands out is
"r92su: update to cfg80211 API 3.19-rc2"

None of the rtl drivers should be using cfg80211, they should be running
against mac80211 - unless the 8192su is that fundamentally different.

Jes
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 079/141] staging: unisys: visorchannel_write(): Handle partial channel_header writes

2015-05-06 Thread Jes Sorensen
Dan Carpenter  writes:
> On Tue, May 05, 2015 at 06:36:56PM -0400, Benjamin Romer wrote:
>> From: Jes Sorensen 
>> 
>> Signed-off-by: Jes Sorensen 
>> Signed-off-by: Benjamin Romer 
>> ---
>>  drivers/staging/unisys/visorbus/visorchannel.c | 9 ++---
>>  1 file changed, 6 insertions(+), 3 deletions(-)
>> 
>> diff --git a/drivers/staging/unisys/visorbus/visorchannel.c 
>> b/drivers/staging/unisys/visorbus/visorchannel.c
>> index cae62fed..da7bd9c 100644
>> --- a/drivers/staging/unisys/visorbus/visorchannel.c
>> +++ b/drivers/staging/unisys/visorbus/visorchannel.c
>> @@ -213,13 +213,16 @@ int
>>  visorchannel_write(struct visorchannel *channel, ulong offset,
>> void *local, ulong nbytes)
>>  {
>> -size_t size = sizeof(struct channel_header);
>> +size_t chdr_size = sizeof(struct channel_header);
>> +size_t copy_size;
>>  
>>  if (offset + nbytes > channel->memregion.nbytes)
>>  return -EIO;
>>  
>> -if (!offset && nbytes >= size)
>> -memcpy(&channel->chan_hdr, local, size);
>> +if (offset < chdr_size) {
>> +copy_size = min(chdr_size, nbytes) - offset;
>> +memcpy(&channel->chan_hdr + offset, local, copy_size);
>
> You get memory corrution if nbytes is less than offset and chdr_size.
>
> My reading was that in the original code this memcpy() was dead code but
> I could have been wrong.

Good point - the call path is not currently used, but we should fix the
check.

I'd prefer to add this in a follow-on patch, if you have no objection?

Cheers,
Jes
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: Anybody working on rtl8712?

2015-05-06 Thread Jes Sorensen
Christian Lamparter  writes:
> On Tue, May 5, 2015 at 7:23 PM, Jes Sorensen  wrote:
>> Xose Vazquez Perez  writes:
>>> On 06/20/2014 10:52 PM, Christian Lamparter wrote:
>>>
>>>> rtl8192su development is chugging along. It just doesn't take place on
>>>> driverdev list. The driver reached "feature parity" with rtl8192cu for
>>>> some time ago. But as with rtl8192cu, I would recommend adding just
>>>> a friendly "printk". Yup, Realtek really outdid themselves with the USB
>>>> devices.
>>>
>>> IMO rtl8192u staging driver should be replaced asap with
>>> https://github.com/chunkeey/rtl8192su
>>> Because people are wasting time fixing the staging code with no future.
>>>
>>> It also happens with rtl8188eu/rtl8xxxu
>>
>> Looking at that page, the first thing that stands out is
>> "r92su: update to cfg80211 API 3.19-rc2"
>>
>> None of the rtl drivers should be using cfg80211, they should be running
>> against mac80211 - unless the 8192su is that fundamentally different.
> The rtl8712u firmware interface is fundamentally different.
> For starters, the firmware expects you to use connect/joinibss, scan,
> disconnect commands with an API much like cfg80211.

OK, I don't know that much about the 8712, my primary target has been
the 8188 and 8192. I think I did pick up an 8712 when I went gadget
shopping, but I need to double check :)

> But as I mentioned before: "I would recommend adding just a _friendly_
> printk"

I'm happy adding a printk - what would you like it to say?

Cheers,
Jes
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: rtl8723au : remove goto & return error directly

2015-05-07 Thread Jes Sorensen
"Gujulan Elango, Hari Prasath (H.)"  writes:
> Remove the goto and return error directly thereby removing a variable
>
> Signed-off-by: Hari Prasath Gujulan Elango 
> ---
>  drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c | 7 ++-
>  1 file changed, 2 insertions(+), 5 deletions(-)

NACK!

The goto is cleaner and more consistent, rather than hiding a return in
the middle of the code.

Jes

>
> diff --git a/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c 
> b/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c
> index b139ed4..a979048 100644
> --- a/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c
> +++ b/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c
> @@ -1209,7 +1209,6 @@ static int cfg80211_rtw_change_iface(struct wiphy 
> *wiphy,
>   struct rtw_adapter *padapter = wiphy_to_adapter(wiphy);
>   struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
>   struct wireless_dev *rtw_wdev = wiphy_to_wdev(wiphy);
> - int ret = 0;
>  
>   DBG_8723A("%s(%s): call netdev_open23a\n", __func__, ndev->name);
>  
> @@ -1238,14 +1237,12 @@ static int cfg80211_rtw_change_iface(struct wiphy 
> *wiphy,
>  
>   if (cfg80211_infrastructure_mode(padapter, type) != _SUCCESS) {
>   rtw_wdev->iftype = old_type;
> - ret = -EPERM;
> - goto exit;
> + return -EPERM;
>   }
>  
>   rtw_setopmode_cmd23a(padapter, type);
>  
> -exit:
> - return ret;
> + return 0;
>  }
>  
>  void rtw_cfg80211_indicate_scan_done(struct rtw_wdev_priv *pwdev_priv,
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: rtl8723au : remove goto & return error directly

2015-05-07 Thread Jes Sorensen
Dan Carpenter  writes:
> On Thu, May 07, 2015 at 08:03:06AM -0400, Jes Sorensen wrote:
>> "Gujulan Elango, Hari Prasath (H.)"  writes:
>> > Remove the goto and return error directly thereby removing a variable
>> >
>> > Signed-off-by: Hari Prasath Gujulan Elango 
>> > ---
>> >  drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c | 7 ++-
>> >  1 file changed, 2 insertions(+), 5 deletions(-)
>> 
>> NACK!
>
> SHOUTING!

It's normal to write NACK in upper case
>
>> 
>> The goto is cleaner and more consistent, rather than hiding a return in
>> the middle of the code.
>
> More consistent with what?  There are already returns earlier in the
> function.  Do-nothing gotos are pointless and annoying.

That is *your* preference!

Having returns scattered randomly throughout the code is annoying and
hard to catch when reading the code!

This case is *not* a bug, so it comes down to personal preference of the
maintainer. For code you maintain, feel free to do as you like, I will
*not* never bother you for this kind of preference issues, I will tell
you if I spot an actual bug.

This is one of the problems with checkpatch style tools, they have
become harassment tools, for some people to impose their personal
preferences onto others.

It would be so much more valuable if they just focused on real bugs!

Jes
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: rtl8723au : remove goto & return error directly

2015-05-07 Thread Jes Sorensen
"Gujulan Elango, Hari Prasath (H.)"  writes:
> On Thu, May 07, 2015 at 03:19:34PM +0300, Dan Carpenter wrote:
>> On Thu, May 07, 2015 at 08:03:06AM -0400, Jes Sorensen wrote:
>> > "Gujulan Elango, Hari Prasath (H.)"  writes:
>> > > Remove the goto and return error directly thereby removing a variable
>> > >
>> > > Signed-off-by: Hari Prasath Gujulan Elango 
>> > > ---
>> > >  drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c | 7 ++-
>> > >  1 file changed, 2 insertions(+), 5 deletions(-)
>> > 
>> > NACK!
>> 
>> SHOUTING!
>> 
>> > 
>> > The goto is cleaner and more consistent, rather than hiding a return in
>> > the middle of the code.
>> 
>> More consistent with what?  There are already returns earlier in the
>> function.  Do-nothing gotos are pointless and annoying.
>> 
>> regards,
>> dan carpenter
>> 
>
> I sent this patch  because goto & return was mixed up in this function.
> There was a return as well as goto used. And i guess goto is not 
> encouraged anywhere. In this case especially,I couldn't see any 
> significant cleanup being done in the goto label.

I will accept a patch to remove the returns in the middle of the
function, if you wish to submit that.

A return at the very beginning of a function is OK, but in the middle of
a larger function they make it harder to catch when code exists.

Jes
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


  1   2   3   4   5   6   7   8   >