Skip to content

Commit

Permalink
Bluetooth: btintel: Export few static functions
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Kiran K authored and Luiz Augusto von Dentz committed May 14, 2024
1 parent 84a4bb6 commit 67d4dba
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 10 deletions.
26 changes: 16 additions & 10 deletions drivers/bluetooth/btintel.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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)
{
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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];
Expand Down Expand Up @@ -2682,8 +2685,9 @@ static int btintel_bootloader_setup_tlv(struct hci_dev *hdev,

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 */
Expand All @@ -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)
{
Expand Down Expand Up @@ -3078,7 +3083,7 @@ static int btintel_setup_combined(struct hci_dev *hdev)
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;
Expand Down Expand Up @@ -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)
{
Expand Down
43 changes: 43 additions & 0 deletions drivers/bluetooth/btintel.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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

0 comments on commit 67d4dba

Please sign in to comment.