Commit 4599f772 authored by David S. Miller's avatar David S. Miller

Merge branch 'for-upstream' of...

Merge branch 'for-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next

Johan Hedberg says:

====================
pull request: bluetooth-next 2016-07-19

Here's likely the last bluetooth-next pull request for the 4.8 kernel:

 - Fix for L2CAP setsockopt
 - Fix for is_suspending flag handling in btmrvl driver
 - Addition of Bluetooth HW & FW info fields to debugfs
 - Fix to use int instead of char for callback status.

The last one (from Geert Uytterhoeven) is actually not purely a
Bluetooth (or 802.15.4) patch, but it was agreed with other maintainers
that we take it through the bluetooth-next tree.

Please let me know if there are any issues pulling. Thanks.
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents b02b94b3 e7acf430
...@@ -274,6 +274,8 @@ static int bpa10x_setup(struct hci_dev *hdev) ...@@ -274,6 +274,8 @@ static int bpa10x_setup(struct hci_dev *hdev)
BT_INFO("%s: %s", hdev->name, (char *)(skb->data + 1)); BT_INFO("%s: %s", hdev->name, (char *)(skb->data + 1));
hci_set_fw_info(hdev, "%s", skb->data + 1);
kfree_skb(skb); kfree_skb(skb);
return 0; return 0;
} }
......
...@@ -1625,6 +1625,7 @@ static int btmrvl_sdio_suspend(struct device *dev) ...@@ -1625,6 +1625,7 @@ static int btmrvl_sdio_suspend(struct device *dev)
if (priv->adapter->hs_state != HS_ACTIVATED) { if (priv->adapter->hs_state != HS_ACTIVATED) {
if (btmrvl_enable_hs(priv)) { if (btmrvl_enable_hs(priv)) {
BT_ERR("HS not actived, suspend failed!"); BT_ERR("HS not actived, suspend failed!");
priv->adapter->is_suspending = false;
return -EBUSY; return -EBUSY;
} }
} }
......
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
*/ */
struct ti_st { struct ti_st {
struct hci_dev *hdev; struct hci_dev *hdev;
char reg_status; int reg_status;
long (*st_write) (struct sk_buff *); long (*st_write) (struct sk_buff *);
struct completion wait_reg_completion; struct completion wait_reg_completion;
}; };
...@@ -83,7 +83,7 @@ static inline void ti_st_tx_complete(struct ti_st *hst, int pkt_type) ...@@ -83,7 +83,7 @@ static inline void ti_st_tx_complete(struct ti_st *hst, int pkt_type)
* status.ti_st_open() function will wait for signal from this * status.ti_st_open() function will wait for signal from this
* API when st_register() function returns ST_PENDING. * API when st_register() function returns ST_PENDING.
*/ */
static void st_reg_completion_cb(void *priv_data, char data) static void st_reg_completion_cb(void *priv_data, int data)
{ {
struct ti_st *lhst = priv_data; struct ti_st *lhst = priv_data;
......
...@@ -1472,7 +1472,7 @@ static long fm_st_receive(void *arg, struct sk_buff *skb) ...@@ -1472,7 +1472,7 @@ static long fm_st_receive(void *arg, struct sk_buff *skb)
* Called by ST layer to indicate protocol registration completion * Called by ST layer to indicate protocol registration completion
* status. * status.
*/ */
static void fm_st_reg_comp_cb(void *arg, char data) static void fm_st_reg_comp_cb(void *arg, int data)
{ {
struct fmdev *fmdev; struct fmdev *fmdev;
......
...@@ -141,7 +141,7 @@ static void st_send_frame(unsigned char chnl_id, struct st_data_s *st_gdata) ...@@ -141,7 +141,7 @@ static void st_send_frame(unsigned char chnl_id, struct st_data_s *st_gdata)
* This function is being called with spin lock held, protocol drivers are * This function is being called with spin lock held, protocol drivers are
* only expected to complete their waits and do nothing more than that. * only expected to complete their waits and do nothing more than that.
*/ */
static void st_reg_complete(struct st_data_s *st_gdata, char err) static void st_reg_complete(struct st_data_s *st_gdata, int err)
{ {
unsigned char i = 0; unsigned char i = 0;
pr_info(" %s ", __func__); pr_info(" %s ", __func__);
......
...@@ -94,7 +94,7 @@ struct nfcwilink { ...@@ -94,7 +94,7 @@ struct nfcwilink {
struct nci_dev *ndev; struct nci_dev *ndev;
unsigned long flags; unsigned long flags;
char st_register_cb_status; int st_register_cb_status;
long (*st_write) (struct sk_buff *); long (*st_write) (struct sk_buff *);
struct completion completed; struct completion completed;
...@@ -320,7 +320,7 @@ static int nfcwilink_download_fw(struct nfcwilink *drv) ...@@ -320,7 +320,7 @@ static int nfcwilink_download_fw(struct nfcwilink *drv)
} }
/* Called by ST when registration is complete */ /* Called by ST when registration is complete */
static void nfcwilink_register_complete(void *priv_data, char data) static void nfcwilink_register_complete(void *priv_data, int data)
{ {
struct nfcwilink *drv = priv_data; struct nfcwilink *drv = priv_data;
......
...@@ -71,7 +71,7 @@ struct st_proto_s { ...@@ -71,7 +71,7 @@ struct st_proto_s {
enum proto_type type; enum proto_type type;
long (*recv) (void *, struct sk_buff *); long (*recv) (void *, struct sk_buff *);
unsigned char (*match_packet) (const unsigned char *data); unsigned char (*match_packet) (const unsigned char *data);
void (*reg_complete_cb) (void *, char data); void (*reg_complete_cb) (void *, int data);
long (*write) (struct sk_buff *skb); long (*write) (struct sk_buff *skb);
void *priv_data; void *priv_data;
......
...@@ -372,6 +372,8 @@ struct hci_dev { ...@@ -372,6 +372,8 @@ struct hci_dev {
atomic_t promisc; atomic_t promisc;
const char *hw_info;
const char *fw_info;
struct dentry *debugfs; struct dentry *debugfs;
struct device dev; struct device dev;
...@@ -1022,6 +1024,10 @@ void hci_unregister_dev(struct hci_dev *hdev); ...@@ -1022,6 +1024,10 @@ void hci_unregister_dev(struct hci_dev *hdev);
int hci_suspend_dev(struct hci_dev *hdev); int hci_suspend_dev(struct hci_dev *hdev);
int hci_resume_dev(struct hci_dev *hdev); int hci_resume_dev(struct hci_dev *hdev);
int hci_reset_dev(struct hci_dev *hdev); int hci_reset_dev(struct hci_dev *hdev);
int hci_recv_frame(struct hci_dev *hdev, struct sk_buff *skb);
int hci_recv_diag(struct hci_dev *hdev, struct sk_buff *skb);
void hci_set_hw_info(struct hci_dev *hdev, const char *fmt, ...);
void hci_set_fw_info(struct hci_dev *hdev, const char *fmt, ...);
int hci_dev_open(__u16 dev); int hci_dev_open(__u16 dev);
int hci_dev_close(__u16 dev); int hci_dev_close(__u16 dev);
int hci_dev_do_close(struct hci_dev *hdev); int hci_dev_do_close(struct hci_dev *hdev);
...@@ -1098,9 +1104,6 @@ int hci_remove_adv_instance(struct hci_dev *hdev, u8 instance); ...@@ -1098,9 +1104,6 @@ int hci_remove_adv_instance(struct hci_dev *hdev, u8 instance);
void hci_event_packet(struct hci_dev *hdev, struct sk_buff *skb); void hci_event_packet(struct hci_dev *hdev, struct sk_buff *skb);
int hci_recv_frame(struct hci_dev *hdev, struct sk_buff *skb);
int hci_recv_diag(struct hci_dev *hdev, struct sk_buff *skb);
void hci_init_sysfs(struct hci_dev *hdev); void hci_init_sysfs(struct hci_dev *hdev);
void hci_conn_init_sysfs(struct hci_conn *conn); void hci_conn_init_sysfs(struct hci_conn *conn);
void hci_conn_add_sysfs(struct hci_conn *conn); void hci_conn_add_sysfs(struct hci_conn *conn);
......
...@@ -3163,6 +3163,8 @@ void hci_unregister_dev(struct hci_dev *hdev) ...@@ -3163,6 +3163,8 @@ void hci_unregister_dev(struct hci_dev *hdev)
device_del(&hdev->dev); device_del(&hdev->dev);
debugfs_remove_recursive(hdev->debugfs); debugfs_remove_recursive(hdev->debugfs);
kfree_const(hdev->hw_info);
kfree_const(hdev->fw_info);
destroy_workqueue(hdev->workqueue); destroy_workqueue(hdev->workqueue);
destroy_workqueue(hdev->req_workqueue); destroy_workqueue(hdev->req_workqueue);
...@@ -3266,6 +3268,28 @@ int hci_recv_diag(struct hci_dev *hdev, struct sk_buff *skb) ...@@ -3266,6 +3268,28 @@ int hci_recv_diag(struct hci_dev *hdev, struct sk_buff *skb)
} }
EXPORT_SYMBOL(hci_recv_diag); EXPORT_SYMBOL(hci_recv_diag);
void hci_set_hw_info(struct hci_dev *hdev, const char *fmt, ...)
{
va_list vargs;
va_start(vargs, fmt);
kfree_const(hdev->hw_info);
hdev->hw_info = kvasprintf_const(GFP_KERNEL, fmt, vargs);
va_end(vargs);
}
EXPORT_SYMBOL(hci_set_hw_info);
void hci_set_fw_info(struct hci_dev *hdev, const char *fmt, ...)
{
va_list vargs;
va_start(vargs, fmt);
kfree_const(hdev->fw_info);
hdev->fw_info = kvasprintf_const(GFP_KERNEL, fmt, vargs);
va_end(vargs);
}
EXPORT_SYMBOL(hci_set_fw_info);
/* ---- Interface to upper protocols ---- */ /* ---- Interface to upper protocols ---- */
int hci_register_cb(struct hci_cb *cb) int hci_register_cb(struct hci_cb *cb)
......
...@@ -76,6 +76,30 @@ static const struct file_operations __name ## _fops = { \ ...@@ -76,6 +76,30 @@ static const struct file_operations __name ## _fops = { \
.llseek = default_llseek, \ .llseek = default_llseek, \
} \ } \
#define DEFINE_INFO_ATTRIBUTE(__name, __field) \
static int __name ## _show(struct seq_file *f, void *ptr) \
{ \
struct hci_dev *hdev = f->private; \
\
hci_dev_lock(hdev); \
seq_printf(f, "%s\n", hdev->__field ? : ""); \
hci_dev_unlock(hdev); \
\
return 0; \
} \
\
static int __name ## _open(struct inode *inode, struct file *file) \
{ \
return single_open(file, __name ## _show, inode->i_private); \
} \
\
static const struct file_operations __name ## _fops = { \
.open = __name ## _open, \
.read = seq_read, \
.llseek = seq_lseek, \
.release = single_release, \
} \
static int features_show(struct seq_file *f, void *ptr) static int features_show(struct seq_file *f, void *ptr)
{ {
struct hci_dev *hdev = f->private; struct hci_dev *hdev = f->private;
...@@ -349,6 +373,9 @@ static const struct file_operations sc_only_mode_fops = { ...@@ -349,6 +373,9 @@ static const struct file_operations sc_only_mode_fops = {
.llseek = default_llseek, .llseek = default_llseek,
}; };
DEFINE_INFO_ATTRIBUTE(hardware_info, hw_info);
DEFINE_INFO_ATTRIBUTE(firmware_info, fw_info);
void hci_debugfs_create_common(struct hci_dev *hdev) void hci_debugfs_create_common(struct hci_dev *hdev)
{ {
debugfs_create_file("features", 0444, hdev->debugfs, hdev, debugfs_create_file("features", 0444, hdev->debugfs, hdev,
...@@ -382,6 +409,14 @@ void hci_debugfs_create_common(struct hci_dev *hdev) ...@@ -382,6 +409,14 @@ void hci_debugfs_create_common(struct hci_dev *hdev)
if (lmp_sc_capable(hdev) || lmp_le_capable(hdev)) if (lmp_sc_capable(hdev) || lmp_le_capable(hdev))
debugfs_create_file("sc_only_mode", 0444, hdev->debugfs, debugfs_create_file("sc_only_mode", 0444, hdev->debugfs,
hdev, &sc_only_mode_fops); hdev, &sc_only_mode_fops);
if (hdev->hw_info)
debugfs_create_file("hardware_info", 0444, hdev->debugfs,
hdev, &hardware_info_fops);
if (hdev->fw_info)
debugfs_create_file("firmware_info", 0444, hdev->debugfs,
hdev, &firmware_info_fops);
} }
static int inquiry_cache_show(struct seq_file *f, void *p) static int inquiry_cache_show(struct seq_file *f, void *p)
......
...@@ -927,7 +927,7 @@ static int l2cap_sock_setsockopt(struct socket *sock, int level, int optname, ...@@ -927,7 +927,7 @@ static int l2cap_sock_setsockopt(struct socket *sock, int level, int optname,
break; break;
} }
if (get_user(opt, (u32 __user *) optval)) { if (get_user(opt, (u16 __user *) optval)) {
err = -EFAULT; err = -EFAULT;
break; break;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment