Skip to content

Commit 62a9199

Browse files
Matthias Kaehlckeholtmann
authored andcommitted
Bluetooth: hci_qca: Rename STATE_<flags> to QCA_<flags>
Rename STATE_IN_BAND_SLEEP_ENABLED to QCA_IBS_ENABLED. The constant represents a flag (multiple flags can be set at once), not a unique state of the controller or driver. Also make the flag an enum value instead of a pre-processor constant (more flags will be added to the enum group by another patch). Signed-off-by: Matthias Kaehlcke <[email protected]> Reviewed-by: Balakrishna Godavarthi <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]>
1 parent f80c5da commit 62a9199

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

drivers/bluetooth/hci_qca.c

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,6 @@
5454
#define HCI_IBS_WAKE_ACK 0xFC
5555
#define HCI_MAX_IBS_SIZE 10
5656

57-
/* Controller states */
58-
#define STATE_IN_BAND_SLEEP_ENABLED 1
59-
6057
#define IBS_WAKE_RETRANS_TIMEOUT_MS 100
6158
#define IBS_TX_IDLE_TIMEOUT_MS 2000
6259
#define CMD_TRANS_TIMEOUT_MS 100
@@ -67,6 +64,10 @@
6764
/* Controller debug log header */
6865
#define QCA_DEBUG_HANDLE 0x2EDC
6966

67+
enum qca_flags {
68+
QCA_IBS_ENABLED,
69+
};
70+
7071
/* HCI_IBS transmit side sleep protocol states */
7172
enum tx_ibs_states {
7273
HCI_IBS_TX_ASLEEP,
@@ -792,7 +793,7 @@ static int qca_enqueue(struct hci_uart *hu, struct sk_buff *skb)
792793
/* Don't go to sleep in middle of patch download or
793794
* Out-Of-Band(GPIOs control) sleep is selected.
794795
*/
795-
if (!test_bit(STATE_IN_BAND_SLEEP_ENABLED, &qca->flags)) {
796+
if (!test_bit(QCA_IBS_ENABLED, &qca->flags)) {
796797
skb_queue_tail(&qca->txq, skb);
797798
spin_unlock_irqrestore(&qca->hci_ibs_lock, flags);
798799
return 0;
@@ -1202,7 +1203,7 @@ static int qca_setup(struct hci_uart *hu)
12021203
return ret;
12031204

12041205
/* Patch downloading has to be done without IBS mode */
1205-
clear_bit(STATE_IN_BAND_SLEEP_ENABLED, &qca->flags);
1206+
clear_bit(QCA_IBS_ENABLED, &qca->flags);
12061207

12071208
if (qca_is_wcn399x(soc_type)) {
12081209
bt_dev_info(hdev, "setting up wcn3990");
@@ -1246,7 +1247,7 @@ static int qca_setup(struct hci_uart *hu)
12461247
/* Setup patch / NVM configurations */
12471248
ret = qca_uart_setup(hdev, qca_baudrate, soc_type, soc_ver);
12481249
if (!ret) {
1249-
set_bit(STATE_IN_BAND_SLEEP_ENABLED, &qca->flags);
1250+
set_bit(QCA_IBS_ENABLED, &qca->flags);
12501251
qca_debugfs_init(hdev);
12511252
} else if (ret == -ENOENT) {
12521253
/* No patch/nvm-config found, run with original fw/config */
@@ -1315,7 +1316,7 @@ static void qca_power_shutdown(struct hci_uart *hu)
13151316
* data in skb's.
13161317
*/
13171318
spin_lock_irqsave(&qca->hci_ibs_lock, flags);
1318-
clear_bit(STATE_IN_BAND_SLEEP_ENABLED, &qca->flags);
1319+
clear_bit(QCA_IBS_ENABLED, &qca->flags);
13191320
qca_flush(hu);
13201321
spin_unlock_irqrestore(&qca->hci_ibs_lock, flags);
13211322

0 commit comments

Comments
 (0)