@@ -128,6 +128,10 @@ struct btmtk_hci_wmt_params {
typedef int (*btmtk_reset_sync_func_t)(struct hci_dev *, void *);
+enum {
+ __BTMTK_NUM_FLAGS,
+};
+
struct btmtk_coredump_info {
const char *driver_name;
u32 fw_version;
@@ -136,11 +140,30 @@ struct btmtk_coredump_info {
};
struct btmediatek_data {
+ DECLARE_BITMAP(flags, __BTMTK_NUM_FLAGS);
+
u32 dev_id;
btmtk_reset_sync_func_t reset_sync;
struct btmtk_coredump_info cd_info;
};
+#define btmtk_set_flag(hdev, nr) \
+ do { \
+ struct btmediatek_data *mediatek = hci_get_priv((hdev)); \
+ set_bit((nr), mediatek->flags); \
+ } while (0)
+
+#define btmtk_clear_flag(hdev, nr) \
+ do { \
+ struct btmediatek_data *mediatek = hci_get_priv((hdev)); \
+ clear_bit((nr), mediatek->flags); \
+ } while (0)
+
+#define btmtk_get_flag(hdev) \
+ (((struct btmediatek_data *)hci_get_priv(hdev))->flags)
+
+#define btmtk_test_flag(hdev, nr) test_bit((nr), btmtk_get_flag(hdev))
+
typedef int (*wmt_cmd_sync_func_t)(struct hci_dev *,
struct btmtk_hci_wmt_params *);