Kevin Lo
9da96c5e7e
rtlwifi: fix REG_USTIME_TSF register definition
...
The REG_USTIME_TSF (US Time Tuning for TSF) definition of Realtek chips
should be 0x55C.
Signed-off-by: Kevin Lo <kevlo@kevlo.org >
Signed-off-by: Kalle Valo <kvalo@codeaurora.org >
2017-06-21 18:23:43 +03:00
yuan linyu
b952f4dff2
net: manual clean code which call skb_put_[data:zero]
...
Signed-off-by: yuan linyu <Linyu.Yuan@alcatel-sbell.com.cn >
Signed-off-by: David S. Miller <davem@davemloft.net >
2017-06-20 13:30:15 -04:00
yuan linyu
ad941e693b
net: replace more place to skb_put_[data:zero]
...
spatch file,
@@
expression skb, len, data;
type t;
@@
-memcpy((t *)skb_put(skb, len), data, len);
+skb_put_data(skb, data, len);
@@
identifier p;
expression skb, len, data;
type t;
@@
-p = (t *)memset(skb_put(skb, len), data, len);
+p = skb_put_zero(skb, len);
@@
expression skb, len, data;
type t;
@@
-memcpy((t *)__skb_put(skb, len), data, len);
+__skb_put_data(skb, data, len);
@@
identifier p;
expression skb, len, data;
type t;
@@
-p = (t *)memset(__skb_put(skb, len), data, len);
+p = __skb_put_zero(skb, len);
Signed-off-by: yuan linyu <Linyu.Yuan@alcatel-sbell.com.cn >
Signed-off-by: David S. Miller <davem@davemloft.net >
2017-06-20 13:30:14 -04:00
Johannes Berg
d58ff35122
networking: make skb_push & __skb_push return void pointers
...
It seems like a historic accident that these return unsigned char *,
and in many places that means casts are required, more often than not.
Make these functions return void * and remove all the casts across
the tree, adding a (u8 *) cast only where the unsigned char pointer
was used directly, all done with the following spatch:
@@
expression SKB, LEN;
typedef u8;
identifier fn = { skb_push, __skb_push, skb_push_rcsum };
@@
- *(fn(SKB, LEN))
+ *(u8 *)fn(SKB, LEN)
@@
expression E, SKB, LEN;
identifier fn = { skb_push, __skb_push, skb_push_rcsum };
type T;
@@
- E = ((T *)(fn(SKB, LEN)))
+ E = fn(SKB, LEN)
@@
expression SKB, LEN;
identifier fn = { skb_push, __skb_push, skb_push_rcsum };
@@
- fn(SKB, LEN)[0]
+ *(u8 *)fn(SKB, LEN)
Note that the last part there converts from push(...)[0] to the
more idiomatic *(u8 *)push(...).
Signed-off-by: Johannes Berg <johannes.berg@intel.com >
Signed-off-by: David S. Miller <davem@davemloft.net >
2017-06-16 11:48:40 -04:00
Johannes Berg
4df864c1d9
networking: make skb_put & friends return void pointers
...
It seems like a historic accident that these return unsigned char *,
and in many places that means casts are required, more often than not.
Make these functions (skb_put, __skb_put and pskb_put) return void *
and remove all the casts across the tree, adding a (u8 *) cast only
where the unsigned char pointer was used directly, all done with the
following spatch:
@@
expression SKB, LEN;
typedef u8;
identifier fn = { skb_put, __skb_put };
@@
- *(fn(SKB, LEN))
+ *(u8 *)fn(SKB, LEN)
@@
expression E, SKB, LEN;
identifier fn = { skb_put, __skb_put };
type T;
@@
- E = ((T *)(fn(SKB, LEN)))
+ E = fn(SKB, LEN)
which actually doesn't cover pskb_put since there are only three
users overall.
A handful of stragglers were converted manually, notably a macro in
drivers/isdn/i4l/isdn_bsdcomp.c and, oddly enough, one of the many
instances in net/bluetooth/hci_sock.c. In the former file, I also
had to fix one whitespace problem spatch introduced.
Signed-off-by: Johannes Berg <johannes.berg@intel.com >
Signed-off-by: David S. Miller <davem@davemloft.net >
2017-06-16 11:48:39 -04:00
Johannes Berg
59ae1d127a
networking: introduce and use skb_put_data()
...
A common pattern with skb_put() is to just want to memcpy()
some data into the new space, introduce skb_put_data() for
this.
An spatch similar to the one for skb_put_zero() converts many
of the places using it:
@@
identifier p, p2;
expression len, skb, data;
type t, t2;
@@
(
-p = skb_put(skb, len);
+p = skb_put_data(skb, data, len);
|
-p = (t)skb_put(skb, len);
+p = skb_put_data(skb, data, len);
)
(
p2 = (t2)p;
-memcpy(p2, data, len);
|
-memcpy(p, data, len);
)
@@
type t, t2;
identifier p, p2;
expression skb, data;
@@
t *p;
...
(
-p = skb_put(skb, sizeof(t));
+p = skb_put_data(skb, data, sizeof(t));
|
-p = (t *)skb_put(skb, sizeof(t));
+p = skb_put_data(skb, data, sizeof(t));
)
(
p2 = (t2)p;
-memcpy(p2, data, sizeof(*p));
|
-memcpy(p, data, sizeof(*p));
)
@@
expression skb, len, data;
@@
-memcpy(skb_put(skb, len), data, len);
+skb_put_data(skb, data, len);
(again, manually post-processed to retain some comments)
Reviewed-by: Stephen Hemminger <stephen@networkplumber.org >
Signed-off-by: Johannes Berg <johannes.berg@intel.com >
Signed-off-by: David S. Miller <davem@davemloft.net >
2017-06-16 11:48:37 -04:00
Johannes Berg
b080db5853
networking: convert many more places to skb_put_zero()
...
There were many places that my previous spatch didn't find,
as pointed out by yuan linyu in various patches.
The following spatch found many more and also removes the
now unnecessary casts:
@@
identifier p, p2;
expression len;
expression skb;
type t, t2;
@@
(
-p = skb_put(skb, len);
+p = skb_put_zero(skb, len);
|
-p = (t)skb_put(skb, len);
+p = skb_put_zero(skb, len);
)
... when != p
(
p2 = (t2)p;
-memset(p2, 0, len);
|
-memset(p, 0, len);
)
@@
type t, t2;
identifier p, p2;
expression skb;
@@
t *p;
...
(
-p = skb_put(skb, sizeof(t));
+p = skb_put_zero(skb, sizeof(t));
|
-p = (t *)skb_put(skb, sizeof(t));
+p = skb_put_zero(skb, sizeof(t));
)
... when != p
(
p2 = (t2)p;
-memset(p2, 0, sizeof(*p));
|
-memset(p, 0, sizeof(*p));
)
@@
expression skb, len;
@@
-memset(skb_put(skb, len), 0, len);
+skb_put_zero(skb, len);
Apply it to the tree (with one manual fixup to keep the
comment in vxlan.c, which spatch removed.)
Signed-off-by: Johannes Berg <johannes.berg@intel.com >
Signed-off-by: David S. Miller <davem@davemloft.net >
2017-06-16 11:48:35 -04:00
Yan-Hsuan Chuang
c42ea61335
rtlwifi: btcoex: let btcoex get wifi rssi and link status
...
Instead of rssi status, the btcoex also needs to get the link status of
the wifi. In addition, some of the rssi status can be merged into link
status.
Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com >
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net >
Cc: Ping-Ke Shih <pkshih@realtek.com >
Cc: Birming Chiu <birming@realtek.com >
Cc: Shaofu <shaofu@realtek.com >
Cc: Steven Ting <steventing@realtek.com >
Signed-off-by: Kalle Valo <kvalo@codeaurora.org >
2017-06-13 10:02:30 +03:00
Yan-Hsuan Chuang
6aafa23074
rtlwifi: btcoex: remove unused display functions
...
These display functions are useless and will not be called in the
future.
Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com >
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net >
Cc: Ping-Ke Shih <pkshih@realtek.com >
Cc: Birming Chiu <birming@realtek.com >
Cc: Shaofu <shaofu@realtek.com >
Cc: Steven Ting <steventing@realtek.com >
Signed-off-by: Kalle Valo <kvalo@codeaurora.org >
2017-06-13 10:02:30 +03:00
Yan-Hsuan Chuang
0199103ea7
rtlwifi: btcoex: bind BT coex information with wifi driver
...
When initializing, gather BT information in struct btcoexist and
provide them to wifi driver.
Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com >
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net >
Cc: Ping-Ke Shih <pkshih@realtek.com >
Cc: Birming Chiu <birming@realtek.com >
Cc: Shaofu <shaofu@realtek.com >
Cc: Steven Ting <steventing@realtek.com >
Signed-off-by: Kalle Valo <kvalo@codeaurora.org >
2017-06-13 10:02:29 +03:00
Yan-Hsuan Chuang
7937f02d19
rtlwifi: btcoex: hook external functions for newer chips
...
Hook the external functions for newer ICs such as 8821a and 8192e.
Rename ex_halbtc8192e2ant_halt_notify to ex_btc8192e2ant_halt_notify.
Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com >
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net >
Cc: Ping-Ke Shih <pkshih@realtek.com >
Cc: Birming Chiu <birming@realtek.com >
Cc: Shaofu <shaofu@realtek.com >
Cc: Steven Ting <steventing@realtek.com >
Signed-off-by: Kalle Valo <kvalo@codeaurora.org >
2017-06-13 10:02:29 +03:00
Yan-Hsuan Chuang
60f44100ee
rtlwifi: btcoex: add settings before the hardware is ready
...
When the hardware is turned on and in the initialization stage, the PTA
circuit is unstable. Hence we need to force some hardware settings to
make sure the PTA circuit work correctly, otherwise it may affect the
user's experience.
Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com >
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net >
Cc: Ping-Ke Shih <pkshih@realtek.com >
Cc: Birming Chiu <birming@realtek.com >
Cc: Shaofu <shaofu@realtek.com >
Cc: Steven Ting <steventing@realtek.com >
Signed-off-by: Kalle Valo <kvalo@codeaurora.org >
2017-06-13 10:02:28 +03:00
Yan-Hsuan Chuang
86f9ab2ef4
rtlwifi: btcoex: hook external PnP notify by chip for wifi driver
...
Hook the chip-specific PnP notify functions for the wifi driver to
notify btcoexistence.
Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com >
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net >
Cc: Ping-Ke Shih <pkshih@realtek.com >
Cc: Birming Chiu <birming@realtek.com >
Cc: Shaofu <shaofu@realtek.com >
Cc: Steven Ting <steventing@realtek.com >
Signed-off-by: Kalle Valo <kvalo@codeaurora.org >
2017-06-13 10:02:28 +03:00
Yan-Hsuan Chuang
6fbbc82adf
rtlwifi: btcoex: settings before firmware is downloaded
...
The btcoex is sometimes unstable because there are some unexpected
behaviors before the firmware has been downloaded successfully.
Therefore we force the antenna path settings to avoid this, then let the
firmware control the btcoexistence when the firmware is ready.
Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com >
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net >
Cc: Ping-Ke Shih <pkshih@realtek.com >
Cc: Birming Chiu <birming@realtek.com >
Cc: Shaofu <shaofu@realtek.com >
Cc: Steven Ting <steventing@realtek.com >
Signed-off-by: Kalle Valo <kvalo@codeaurora.org >
2017-06-13 10:02:27 +03:00
Yan-Hsuan Chuang
753c953bae
rtlwifi: btcoex: rename ex_halbtc*ant to ex_btc*ant
...
These external functions are for BT-coexistence, so remove the "hal"
prefix for consistancy.
Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com >
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net >
Cc: Ping-Ke Shih <pkshih@realtek.com >
Cc: Birming Chiu <birming@realtek.com >
Cc: Shaofu <shaofu@realtek.com >
Cc: Steven Ting <steventing@realtek.com >
Signed-off-by: Kalle Valo <kvalo@codeaurora.org >
2017-06-13 10:02:27 +03:00
Yan-Hsuan Chuang
d178b1321e
rtlwifi: btcoex: add macros to check chip type
...
For some external functions that have hardware dependency, we need to
know the type of the hardware before invoking them.
Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com >
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net >
Cc: Ping-Ke Shih <pkshih@realtek.com >
Cc: Birming Chiu <birming@realtek.com >
Cc: Shaofu <shaofu@realtek.com >
Cc: Steven Ting <steventing@realtek.com >
Signed-off-by: Kalle Valo <kvalo@codeaurora.org >
2017-06-13 10:02:26 +03:00
Dan Carpenter
e578618934
rtlwifi: btcoex: 23b 1ant: initialize bt_disabled to false
...
We only want to disable this if bt_disable_cnt is >= 2.
Fixes: f66509e3d7 ("rtlwifi: btcoex: Remove 23b 1ant configuration parameter")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com >
Acked-by: Larry Finger <Larry.Finger@lwfinger.net >
Signed-off-by: Kalle Valo <kvalo@codeaurora.org >
2017-05-24 16:51:30 +03:00
Yan-Hsuan Chuang
86aeb82563
rtlwifi: btcoex: 23b 1ant: turn off ps and tdma mechanism when concurrent mode
...
When wifi is under concurrent mode, we can not distinguish if it is the
real PS or just a fake one by sending null data, so we turn it off
in case of miracast scenario.
Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com >
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net >
Cc: Yan-Hsuan Chuang <yhchuang@realtek.com >
Cc: Birming Chiu <birming@realtek.com >
Cc: Shaofu <shaofu@realtek.com >
Cc: Steven Ting <steventing@realtek.com >
Signed-off-by: Kalle Valo <kvalo@codeaurora.org >
2017-05-24 16:50:38 +03:00
Ping-Ke Shih
f9cbb5b4e9
rtlwifi: btcoex: 23b 1ant: fine tune for bt_sco_hid busy
...
Fine tune the parameters in case of act_bt_sco_hid_only_busy.
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com >
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net >
Cc: Yan-Hsuan Chuang <yhchuang@realtek.com >
Cc: Birming Chiu <birming@realtek.com >
Cc: Shaofu <shaofu@realtek.com >
Cc: Steven Ting <steventing@realtek.com >
Signed-off-by: Kalle Valo <kvalo@codeaurora.org >
2017-05-24 16:50:38 +03:00
Ping-Ke Shih
40ca188235
rtlwifi: btcoex: 23b 1ant: fine tune for wifi not connected
...
Fine tune the parameters in cases of scan, assoc and auth when wifi isn't
connected.
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com >
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net >
Cc: Yan-Hsuan Chuang <yhchuang@realtek.com >
Cc: Birming Chiu <birming@realtek.com >
Cc: Shaofu <shaofu@realtek.com >
Cc: Steven Ting <steventing@realtek.com >
Signed-off-by: Kalle Valo <kvalo@codeaurora.org >
2017-05-24 16:50:37 +03:00
Ping-Ke Shih
1ecdc4363f
rtlwifi: btcoex: 23b 1ant: fine tune for wifi connected
...
Fine tune the parameters in cases of bt_acl_busy and scan when wifi is
connected.
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com >
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net >
Cc: Yan-Hsuan Chuang <yhchuang@realtek.com >
Cc: Birming Chiu <birming@realtek.com >
Cc: Shaofu <shaofu@realtek.com >
Cc: Steven Ting <steventing@realtek.com >
Signed-off-by: Kalle Valo <kvalo@codeaurora.org >
2017-05-24 16:50:37 +03:00
Ping-Ke Shih
056faad2e9
rtlwifi: btcoex: 23b 1ant: coex table fine tune
...
Set register settings for coex table fine tune.
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com >
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net >
Cc: Yan-Hsuan Chuang <yhchuang@realtek.com >
Cc: Birming Chiu <birming@realtek.com >
Cc: Shaofu <shaofu@realtek.com >
Cc: Steven Ting <steventing@realtek.com >
Signed-off-by: Kalle Valo <kvalo@codeaurora.org >
2017-05-24 16:50:36 +03:00
Ping-Ke Shih
46b5689c37
rtlwifi: btcoex: 23b 1ant: Add coex_table_type to log
...
Display coex_table_type in log.
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com >
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net >
Cc: Yan-Hsuan Chuang <yhchuang@realtek.com >
Cc: Birming Chiu <birming@realtek.com >
Cc: Shaofu <shaofu@realtek.com >
Cc: Steven Ting <steventing@realtek.com >
Signed-off-by: Kalle Valo <kvalo@codeaurora.org >
2017-05-24 16:50:36 +03:00
Ping-Ke Shih
8be514054d
rtlwifi: btcoex: 23b 1ant: remove verbose log from periodic function
...
Simplify the debug trace log.
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com >
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net >
Cc: Yan-Hsuan Chuang <yhchuang@realtek.com >
Cc: Birming Chiu <birming@realtek.com >
Cc: Shaofu <shaofu@realtek.com >
Cc: Steven Ting <steventing@realtek.com >
Signed-off-by: Kalle Valo <kvalo@codeaurora.org >
2017-05-24 16:50:35 +03:00
Ping-Ke Shih
5ae40d9935
rtlwifi: btcoex: 23b 1ant: check more cases when bt is queing
...
If bt is queing, we need to set the packet priority properly.
Originally we only consider if wifi was connected or not, but now we
also consider if bt is under abnormal scan or wifi is scanning, roaming
or linking, and set the coex table.
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com >
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net >
Cc: Yan-Hsuan Chuang <yhchuang@realtek.com >
Cc: Birming Chiu <birming@realtek.com >
Cc: Shaofu <shaofu@realtek.com >
Cc: Steven Ting <steventing@realtek.com >
Signed-off-by: Kalle Valo <kvalo@codeaurora.org >
2017-05-24 16:50:35 +03:00
Ping-Ke Shih
c34e42aa3e
rtlwifi: btcoex: 23b 1ant: define wifi in high priority task.
...
Add the definition of wifi in high priority task for bt inquiry.
According to driver's notifications, btc will knows whether wifi is in high
priority tasks or not.
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com >
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net >
Cc: Yan-Hsuan Chuang <yhchuang@realtek.com >
Cc: Birming Chiu <birming@realtek.com >
Cc: Shaofu <shaofu@realtek.com >
Cc: Steven Ting <steventing@realtek.com >
Signed-off-by: Kalle Valo <kvalo@codeaurora.org >
2017-05-24 16:50:34 +03:00
Ping-Ke Shih
fa73a1ebe7
rtlwifi: btcoex: 23b 1ant: Special packets statistic in notification
...
Count and log special packets of DHCP, EAPOL and ARP, and check whether
the interface is in 4-way handshake.
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com >
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net >
Cc: Yan-Hsuan Chuang <yhchuang@realtek.com >
Cc: Birming Chiu <birming@realtek.com >
Cc: Shaofu <shaofu@realtek.com >
Cc: Steven Ting <steventing@realtek.com >
Signed-off-by: Kalle Valo <kvalo@codeaurora.org >
2017-05-24 16:50:34 +03:00
Ping-Ke Shih
29c1de9193
rtlwifi: btcoex: 23b 1ant: Revise media status notify to fix no scan result issue
...
Force antenna setup for no scan result issue
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com >
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net >
Cc: Yan-Hsuan Chuang <yhchuang@realtek.com >
Cc: Birming Chiu <birming@realtek.com >
Cc: Shaofu <shaofu@realtek.com >
Cc: Steven Ting <steventing@realtek.com >
Signed-off-by: Kalle Valo <kvalo@codeaurora.org >
2017-05-24 16:49:21 +03:00
Ping-Ke Shih
f9af7af4a1
rtlwifi: btcoex: 23b 1ant: fine tune connect notify
...
When association starts, force antenna setup for no scan result issue.
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com >
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net >
Cc: Yan-Hsuan Chuang <yhchuang@realtek.com >
Cc: Birming Chiu <birming@realtek.com >
Cc: Shaofu <shaofu@realtek.com >
Cc: Steven Ting <steventing@realtek.com >
Signed-off-by: Kalle Valo <kvalo@codeaurora.org >
2017-05-24 16:49:21 +03:00
Ping-Ke Shih
3ceac0a772
rtlwifi: btcoex: 23b 1ant: Add rf status notification
...
If driver announce wifi RF status is off, btc can switch antenna to BT.
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com >
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net >
Cc: Yan-Hsuan Chuang <yhchuang@realtek.com >
Cc: Birming Chiu <birming@realtek.com >
Cc: Shaofu <shaofu@realtek.com >
Cc: Steven Ting <steventing@realtek.com >
Signed-off-by: Kalle Valo <kvalo@codeaurora.org >
2017-05-24 16:49:20 +03:00
Ping-Ke Shih
53e18bcf3c
rtlwifi: btcoex: 23b 1ant: Setup register for BT WHCK test
...
If BT is under WHCK, we enter a special mode.
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com >
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net >
Cc: Yan-Hsuan Chuang <yhchuang@realtek.com >
Cc: Birming Chiu <birming@realtek.com >
Cc: Shaofu <shaofu@realtek.com >
Cc: Steven Ting <steventing@realtek.com >
Signed-off-by: Kalle Valo <kvalo@codeaurora.org >
2017-05-24 16:49:20 +03:00
Ping-Ke Shih
7d0d2c14cc
rtlwifi: btcoex: 23b 1ant: parse more BT information from C2H
...
BT FW provide more BT status as clues, thus we also display them in
coex log to help debug in field.
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com >
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net >
Cc: Yan-Hsuan Chuang <yhchuang@realtek.com >
Cc: Birming Chiu <birming@realtek.com >
Cc: Shaofu <shaofu@realtek.com >
Cc: Steven Ting <steventing@realtek.com >
Signed-off-by: Kalle Valo <kvalo@codeaurora.org >
2017-05-24 16:49:19 +03:00
Ping-Ke Shih
f9c6ede79a
rtlwifi: btcoex: 23b 1ant: Add power_on_setting
...
This change is highly related to init_hwconfig that was decomposed into
two parts for better program flow.
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com >
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net >
Cc: Yan-Hsuan Chuang <yhchuang@realtek.com >
Cc: Birming Chiu <birming@realtek.com >
Cc: Shaofu <shaofu@realtek.com >
Cc: Steven Ting <steventing@realtek.com >
Signed-off-by: Kalle Valo <kvalo@codeaurora.org >
2017-05-24 16:49:19 +03:00
Ping-Ke Shih
8ffb5b6926
rtlwifi: btcoex: 23b 1ant: add wifi_only argument to init_hwconfig
...
In case of wifi_only, we can simply switch antenna to wifi.
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com >
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net >
Cc: Yan-Hsuan Chuang <yhchuang@realtek.com >
Cc: Birming Chiu <birming@realtek.com >
Cc: Shaofu <shaofu@realtek.com >
Cc: Steven Ting <steventing@realtek.com >
Signed-off-by: Kalle Valo <kvalo@codeaurora.org >
2017-05-24 16:49:18 +03:00
Ping-Ke Shih
0d4ae14226
rtlwifi: btcoex: 23b 1ant: adjust wifi duration for bt a2dp
...
The larger the bt a2dp bit pool is, the more time bt needs to receive
them. If we do not adjust the wifi duration, the voice quality will be
low. Hence we reduce the time that wifi holds, to improve the a2dp
service.
If the bt is slave, it may receive a packet at any time, so we
need to mark them as high priority packets in case of packet loss
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com >
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net >
Cc: Yan-Hsuan Chuang <yhchuang@realtek.com >
Cc: Birming Chiu <birming@realtek.com >
Cc: Shaofu <shaofu@realtek.com >
Cc: Steven Ting <steventing@realtek.com >
Signed-off-by: Kalle Valo <kvalo@codeaurora.org >
2017-05-24 16:49:18 +03:00
Ping-Ke Shih
c01fd117e5
rtlwifi: btcoex: 23b 1ant: need these information when scan
...
Log the scan procedure, and update ap_num for future usage when scan done.
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com >
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net >
Cc: Yan-Hsuan Chuang <yhchuang@realtek.com >
Cc: Birming Chiu <birming@realtek.com >
Cc: Shaofu <shaofu@realtek.com >
Cc: Steven Ting <steventing@realtek.com >
Signed-off-by: Kalle Valo <kvalo@codeaurora.org >
2017-05-24 16:49:17 +03:00
Ping-Ke Shih
96e3baadd0
rtlwifi: btcoex: 23b 1ant: Switch antenna to wifi or BT.
...
Since wifi and BT share the same physical antenna, we should switch antenna
to fit every situation.
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com >
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net >
Cc: Yan-Hsuan Chuang <yhchuang@realtek.com >
Cc: Birming Chiu <birming@realtek.com >
Cc: Shaofu <shaofu@realtek.com >
Cc: Steven Ting <steventing@realtek.com >
Signed-off-by: Kalle Valo <kvalo@codeaurora.org >
2017-05-24 16:49:17 +03:00
Colin Ian King
e8dc072dd5
rtlwifi: rtl8723ae: fix spelling mistake: "Coexistance" -> "Coexistence"
...
Trivial fix to spelling mistake in RT_TRACE text
Signed-off-by: Colin Ian King <colin.king@canonical.com >
Signed-off-by: Kalle Valo <kvalo@codeaurora.org >
2017-05-18 17:15:00 +03:00
Colin Ian King
6b9e6f6255
rtlwifi: fix spelling mistake: "Pairwiase" -> "Pairwise"
...
trivial fixes to spelling mistakes in RT_TRACE messages.
Signed-off-by: Colin Ian King <colin.king@canonical.com >
Signed-off-by: Kalle Valo <kvalo@codeaurora.org >
2017-05-18 17:14:18 +03:00
Ping-Ke Shih
12515a08e7
rtlwifi: btcoex: 23b 1ant: check PS state before setting tdma duration
...
For time division multiple access, the wifi and bt take turns to
transmit, but we need to let AP know that wifi is under standby mode by
sending null data to "pretend" entering power saving state using lps
rpwm.
But, the fw does not know if it is the actual power saving mode or just a
fake one to cheat to the AP. Hence, before fw setting the tdma duration,
the fw needs the driver to check the power saving state first.
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com >
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net >
Cc: Yan-Hsuan Chuang <yhchuang@realtek.com >
Cc: Birming Chiu <birming@realtek.com >
Cc: Shaofu <shaofu@realtek.com >
Cc: Steven Ting <steventing@realtek.com >
Signed-off-by: Kalle Valo <kvalo@codeaurora.org >
2017-05-18 17:09:52 +03:00
Ping-Ke Shih
12e87c09cf
rtlwifi: btcoex: 23b 1ant: monitor bt is enabled or disabled
...
Check BT's status, and record it in field bt_disabled. When BT is disabled,
We do special action called wifi_only. Also, we move the field from
'struct btc_coexist' to 'struct coex_sta_8723b_1ant'.
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com >
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net >
Cc: Yan-Hsuan Chuang <yhchuang@realtek.com >
Cc: Birming Chiu <birming@realtek.com >
Cc: Shaofu <shaofu@realtek.com >
Cc: Steven Ting <steventing@realtek.com >
Signed-off-by: Kalle Valo <kvalo@codeaurora.org >
2017-05-18 17:09:52 +03:00
Ping-Ke Shih
75717802c9
rtlwifi: btcoex: 23b 1ant: check if BT high priority packet exist
...
If there are BT high priority packets, we arrange more time to BT.
To make user experience to be better, HID and SCO are also seen as
high priority packet exist.
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com >
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net >
Cc: Yan-Hsuan Chuang <yhchuang@realtek.com >
Cc: Birming Chiu <birming@realtek.com >
Cc: Shaofu <shaofu@realtek.com >
Cc: Steven Ting <steventing@realtek.com >
Signed-off-by: Kalle Valo <kvalo@codeaurora.org >
2017-05-18 17:09:51 +03:00
Ping-Ke Shih
37a5be0cfc
rtlwifi: btcoex: 23b 1ant: monitor wifi and BT counter
...
In field debug, we check wifi and BT counter to analyze problems.
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com >
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net >
Cc: Yan-Hsuan Chuang <yhchuang@realtek.com >
Cc: Birming Chiu <birming@realtek.com >
Cc: Shaofu <shaofu@realtek.com >
Cc: Steven Ting <steventing@realtek.com >
Signed-off-by: Kalle Valo <kvalo@codeaurora.org >
2017-05-18 17:09:51 +03:00
Ping-Ke Shih
2622d7d86a
rtlwifi: btcoex: 23b 1ant: TDMA duration for ACL busy
...
BT ACL is a special case, so we create a routine to deal this case.
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com >
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net >
Cc: Yan-Hsuan Chuang <yhchuang@realtek.com >
Cc: Birming Chiu <birming@realtek.com >
Cc: Shaofu <shaofu@realtek.com >
Cc: Steven Ting <steventing@realtek.com >
Signed-off-by: Kalle Valo <kvalo@codeaurora.org >
2017-05-18 17:09:51 +03:00
Ping-Ke Shih
2d446a5653
rtlwifi: btcoex: 23b 1ant: rename and coding style modification.
...
Rename:
* tdma_adj_type to ps_tdma_du_adj_type
* wifiCentralChnl to wifi_central_chnl
Coding style:
* move constant from right to left side in if-statement
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com >
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net >
Cc: Yan-Hsuan Chuang <yhchuang@realtek.com >
Cc: Birming Chiu <birming@realtek.com >
Cc: Shaofu <shaofu@realtek.com >
Cc: Steven Ting <steventing@realtek.com >
Signed-off-by: Kalle Valo <kvalo@codeaurora.org >
2017-05-18 17:09:50 +03:00
Larry Finger
158707f958
rtlwifi: btcoex: Restore 23b 1ant routine for tdma adjustment
...
Routine btc8723b1ant_tdma_dur_adj_for_acl() was removed in a set of
Sparse fixes; however, this routine will be needed later.
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net >
Cc: Yan-Hsuan Chuang <yhchuang@realtek.com >
Cc: Pkshih <pkshih@realtek.com >
Cc: Birming Chiu <birming@realtek.com >
Cc: Shaofu <shaofu@realtek.com >
Cc: Steven Ting <steventing@realtek.com >
Signed-off-by: Kalle Valo <kvalo@codeaurora.org >
2017-05-18 17:09:50 +03:00
Yan-Hsuan Chuang
63ad6ea938
rtlwifi: btcoex: 21a 1ant: add bt_tx_rx_mask into bt info
...
Set rf register if the tx rx mask is switched.
Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com >
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net >
Cc: Pkshih <pkshih@realtek.com >
Cc: Birming Chiu <birming@realtek.com >
Cc: Shaofu <shaofu@realtek.com >
Cc: Steven Ting <steventing@realtek.com >
Signed-off-by: Kalle Valo <kvalo@codeaurora.org >
2017-05-18 17:09:49 +03:00
Yan-Hsuan Chuang
0ad7bd2d1b
rtlwifi: btcoex: 21a 1ant: fix some coding style issues
...
Fix alignment for coding style consistency.
Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com >
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net >
Cc: Pkshih <pkshih@realtek.com >
Cc: Birming Chiu <birming@realtek.com >
Cc: Shaofu <shaofu@realtek.com >
Cc: Steven Ting <steventing@realtek.com >
Signed-off-by: Kalle Valo <kvalo@codeaurora.org >
2017-05-18 17:09:49 +03:00
Yan-Hsuan Chuang
de202ba39f
rtlwifi: btcoex: 21a 1ant: treat ARP as special packet
...
We need to pay attention to ARP packets to correctly establish
connection, and reset the ARP counter when disconnected.
Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com >
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net >
Cc: Pkshih <pkshih@realtek.com >
Cc: Birming Chiu <birming@realtek.com >
Cc: Shaofu <shaofu@realtek.com >
Cc: Steven Ting <steventing@realtek.com >
Signed-off-by: Kalle Valo <kvalo@codeaurora.org >
2017-05-18 17:09:48 +03:00
Yan-Hsuan Chuang
ee406cec87
rtlwifi: btcoex: 21a 1ant: re-init coex after wifi leaves IPS
...
Before entering IPS, set the PTA control to default value and re-init it
after it leaves IPS to avoid running some redundant code in
run_coexist_mechanism.
Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com >
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net >
Cc: Pkshih <pkshih@realtek.com >
Cc: Birming Chiu <birming@realtek.com >
Cc: Shaofu <shaofu@realtek.com >
Cc: Steven Ting <steventing@realtek.com >
Signed-off-by: Kalle Valo <kvalo@codeaurora.org >
2017-05-18 17:08:28 +03:00