Bluetooth: btintel: Export few static functions
authorKiran K <kiran.k@intel.com>
Tue, 7 May 2024 15:56:56 +0000 (21:26 +0530)
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Tue, 14 May 2024 14:54:55 +0000 (10:54 -0400)
Some of the functions used in btintel.c is made global so that they can
be reused in other transport drivers apart from USB.

Signed-off-by: Kiran K <kiran.k@intel.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
drivers/bluetooth/btintel.c
drivers/bluetooth/btintel.h

index 4f4bd55..0c855c3 100644 (file)
@@ -245,7 +245,7 @@ static int btintel_set_diag_combined(struct hci_dev *hdev, bool enable)
        return ret;
 }
 
-static void btintel_hw_error(struct hci_dev *hdev, u8 code)
+void btintel_hw_error(struct hci_dev *hdev, u8 code)
 {
        struct sk_buff *skb;
        u8 type = 0x00;
@@ -277,6 +277,7 @@ static void btintel_hw_error(struct hci_dev *hdev, u8 code)
 
        kfree_skb(skb);
 }
+EXPORT_SYMBOL_GPL(btintel_hw_error);
 
 int btintel_version_info(struct hci_dev *hdev, struct intel_version *ver)
 {
@@ -455,8 +456,8 @@ int btintel_read_version(struct hci_dev *hdev, struct intel_version *ver)
 }
 EXPORT_SYMBOL_GPL(btintel_read_version);
 
-static int btintel_version_info_tlv(struct hci_dev *hdev,
-                                   struct intel_version_tlv *version)
+int btintel_version_info_tlv(struct hci_dev *hdev,
+                            struct intel_version_tlv *version)
 {
        const char *variant;
 
@@ -544,10 +545,11 @@ static int btintel_version_info_tlv(struct hci_dev *hdev,
 
        return 0;
 }
+EXPORT_SYMBOL_GPL(btintel_version_info_tlv);
 
-static int btintel_parse_version_tlv(struct hci_dev *hdev,
-                                    struct intel_version_tlv *version,
-                                    struct sk_buff *skb)
+int btintel_parse_version_tlv(struct hci_dev *hdev,
+                             struct intel_version_tlv *version,
+                             struct sk_buff *skb)
 {
        /* Consume Command Complete Status field */
        skb_pull(skb, 1);
@@ -649,6 +651,7 @@ static int btintel_parse_version_tlv(struct hci_dev *hdev,
 
        return 0;
 }
+EXPORT_SYMBOL_GPL(btintel_parse_version_tlv);
 
 static int btintel_read_version_tlv(struct hci_dev *hdev,
                                    struct intel_version_tlv *version)
@@ -2597,8 +2600,8 @@ static void btintel_set_dsm_reset_method(struct hci_dev *hdev,
        data->acpi_reset_method = btintel_acpi_reset_method;
 }
 
-static int btintel_bootloader_setup_tlv(struct hci_dev *hdev,
-                                       struct intel_version_tlv *ver)
+int btintel_bootloader_setup_tlv(struct hci_dev *hdev,
+                                struct intel_version_tlv *ver)
 {
        u32 boot_param;
        char ddcname[64];
@@ -2682,8 +2685,9 @@ finish:
 
        return 0;
 }
+EXPORT_SYMBOL_GPL(btintel_bootloader_setup_tlv);
 
-static void btintel_set_msft_opcode(struct hci_dev *hdev, u8 hw_variant)
+void btintel_set_msft_opcode(struct hci_dev *hdev, u8 hw_variant)
 {
        switch (hw_variant) {
        /* Legacy bootloader devices that supports MSFT Extension */
@@ -2707,6 +2711,7 @@ static void btintel_set_msft_opcode(struct hci_dev *hdev, u8 hw_variant)
                break;
        }
 }
+EXPORT_SYMBOL_GPL(btintel_set_msft_opcode);
 
 static void btintel_print_fseq_info(struct hci_dev *hdev)
 {
@@ -3078,7 +3083,7 @@ exit_error:
        return err;
 }
 
-static int btintel_shutdown_combined(struct hci_dev *hdev)
+int btintel_shutdown_combined(struct hci_dev *hdev)
 {
        struct sk_buff *skb;
        int ret;
@@ -3112,6 +3117,7 @@ static int btintel_shutdown_combined(struct hci_dev *hdev)
 
        return 0;
 }
+EXPORT_SYMBOL_GPL(btintel_shutdown_combined);
 
 int btintel_configure_setup(struct hci_dev *hdev, const char *driver_name)
 {
index 64ab5a2..1462a57 100644 (file)
@@ -234,6 +234,16 @@ void btintel_bootup(struct hci_dev *hdev, const void *ptr, unsigned int len);
 void btintel_secure_send_result(struct hci_dev *hdev,
                                const void *ptr, unsigned int len);
 int btintel_set_quality_report(struct hci_dev *hdev, bool enable);
+int btintel_version_info_tlv(struct hci_dev *hdev,
+                            struct intel_version_tlv *version);
+int btintel_parse_version_tlv(struct hci_dev *hdev,
+                             struct intel_version_tlv *version,
+                             struct sk_buff *skb);
+void btintel_set_msft_opcode(struct hci_dev *hdev, u8 hw_variant);
+int btintel_bootloader_setup_tlv(struct hci_dev *hdev,
+                                struct intel_version_tlv *ver);
+int btintel_shutdown_combined(struct hci_dev *hdev);
+void btintel_hw_error(struct hci_dev *hdev, u8 code);
 #else
 
 static inline int btintel_check_bdaddr(struct hci_dev *hdev)
@@ -330,4 +340,37 @@ static inline int btintel_set_quality_report(struct hci_dev *hdev, bool enable)
 {
        return -ENODEV;
 }
+
+static inline int btintel_version_info_tlv(struct hci_dev *hdev,
+                                          struct intel_version_tlv *version)
+{
+       return -EOPNOTSUPP;
+}
+
+static inline int btintel_parse_version_tlv(struct hci_dev *hdev,
+                                           struct intel_version_tlv *version,
+                                           struct sk_buff *skb)
+{
+       return -EOPNOTSUPP;
+}
+
+static inline void btintel_set_msft_opcode(struct hci_dev *hdev, u8 hw_variant)
+
+{
+}
+
+static inline int btintel_bootloader_setup_tlv(struct hci_dev *hdev,
+                                              struct intel_version_tlv *ver)
+{
+       return -ENODEV;
+}
+
+static inline int btintel_shutdown_combined(struct hci_dev *hdev)
+{
+       return -ENODEV;
+}
+
+static void btintel_hw_error(struct hci_dev *hdev, u8 code)
+{
+}
 #endif