mirror of
https://gitdl.cn/https://github.com/chakralinux/core.git
synced 2025-02-15 05:39:07 +08:00
184 lines
5.0 KiB
Diff
184 lines
5.0 KiB
Diff
--- a/src/wl/sys/wl_cfg80211_hybrid.c 2013-08-01 08:52:22.000000000 +0200
|
|
+++ b/src/wl/sys/wl_cfg80211_hybrid.c 2014-06-09 15:57:03.269734785 +0200
|
|
@@ -1841,7 +1841,26 @@
|
|
wl_get_assoc_ies(wl);
|
|
memcpy(&wl->bssid, &e->addr, ETHER_ADDR_LEN);
|
|
wl_update_bss_info(wl);
|
|
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 15, 0)
|
|
+ {
|
|
+ struct wl_bss_info *bi;
|
|
+ u16 bss_info_channel;
|
|
+ struct ieee80211_channel *channel;
|
|
+ u32 freq;
|
|
+
|
|
+ bi = (struct wl_bss_info *)(wl->extra_buf + 4);
|
|
+ bss_info_channel = bi->ctl_ch ? bi->ctl_ch : CHSPEC_CHANNEL(bi->chanspec);
|
|
+
|
|
+ freq = ieee80211_channel_to_frequency(bss_info_channel,
|
|
+ (bss_info_channel <= CH_MAX_2G_CHANNEL) ?
|
|
+ IEEE80211_BAND_2GHZ : IEEE80211_BAND_5GHZ);
|
|
+
|
|
+ channel = ieee80211_get_channel(wl_to_wiphy(wl), freq);
|
|
+ cfg80211_ibss_joined(ndev, (u8 *)&wl->bssid, channel, GFP_KERNEL);
|
|
+ }
|
|
+#else
|
|
cfg80211_ibss_joined(ndev, (u8 *)&wl->bssid, GFP_KERNEL);
|
|
+#endif
|
|
set_bit(WL_STATUS_CONNECTED, &wl->status);
|
|
wl->profile->active = true;
|
|
}
|
|
--- a/src/wl/sys/wl_linux.c 2013-08-01 08:52:22.000000000 +0200
|
|
+++ b/src/wl/sys/wl_linux.c 2014-06-09 15:56:53.587566642 +0200
|
|
@@ -910,7 +910,11 @@
|
|
pci_set_drvdata(pdev, NULL);
|
|
}
|
|
|
|
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 8, 0)
|
|
static struct pci_driver wl_pci_driver = {
|
|
+#else
|
|
+static struct pci_driver wl_pci_driver __refdata = {
|
|
+#endif
|
|
name: "wl",
|
|
probe: wl_pci_probe,
|
|
suspend: wl_suspend,
|
|
@@ -3236,7 +3240,12 @@
|
|
wl_tkip_printstats(wl_info_t *wl, bool group_key)
|
|
{
|
|
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 14)
|
|
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0)
|
|
+ struct seq_file sfile;
|
|
+ struct seq_file *debug_buf = &sfile;
|
|
+#else
|
|
char debug_buf[512];
|
|
+#endif
|
|
int idx;
|
|
if (wl->tkipmodops) {
|
|
if (group_key) {
|
|
@@ -3249,7 +3258,11 @@
|
|
wl->tkipmodops->print_stats(debug_buf, wl->tkip_ucast_data);
|
|
else
|
|
return;
|
|
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0)
|
|
+ printk("%s: TKIP stats from module: %s\n", debug_buf->buf, group_key?"Bcast":"Ucast");
|
|
+#else
|
|
printk("%s: TKIP stats from module: %s\n", debug_buf, group_key?"Bcast":"Ucast");
|
|
+#endif
|
|
}
|
|
#endif
|
|
}
|
|
@@ -3408,11 +3421,19 @@
|
|
return 0;
|
|
}
|
|
|
|
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 10, 0)
|
|
static int
|
|
wl_proc_read(char *buffer, char **start, off_t offset, int length, int *eof, void *data)
|
|
{
|
|
wl_info_t * wl = (wl_info_t *)data;
|
|
+#else
|
|
+static int
|
|
+wl_proc_read(struct seq_file *seq, void *offset)
|
|
+{
|
|
+ wl_info_t * wl = (wl_info_t *)seq->private;
|
|
+#endif
|
|
int bcmerror, to_user;
|
|
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 10, 0)
|
|
int len;
|
|
|
|
if (offset > 0) {
|
|
@@ -3424,17 +3445,33 @@
|
|
WL_ERROR(("%s: Not enough return buf space\n", __FUNCTION__));
|
|
return 0;
|
|
}
|
|
+#endif
|
|
WL_LOCK(wl);
|
|
bcmerror = wlc_ioctl(wl->wlc, WLC_GET_MONITOR, &to_user, sizeof(int), NULL);
|
|
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 10, 0)
|
|
len = sprintf(buffer, "%d\n", to_user);
|
|
+#endif
|
|
WL_UNLOCK(wl);
|
|
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 10, 0)
|
|
return len;
|
|
+#else
|
|
+ seq_printf(seq, "%d\n", to_user);
|
|
+ return bcmerror;
|
|
+#endif
|
|
}
|
|
|
|
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 10, 0)
|
|
static int
|
|
wl_proc_write(struct file *filp, const char *buff, unsigned long length, void *data)
|
|
{
|
|
wl_info_t * wl = (wl_info_t *)data;
|
|
+#else
|
|
+static ssize_t
|
|
+wl_proc_write(struct file *filp, const char __user *buff, size_t length, loff_t *ppos)
|
|
+{
|
|
+ struct seq_file *seq = filp->private_data;
|
|
+ wl_info_t * wl = (wl_info_t *)seq->private;
|
|
+#endif
|
|
int from_user = 0;
|
|
int bcmerror;
|
|
|
|
@@ -3445,7 +3482,11 @@
|
|
}
|
|
if (copy_from_user(&from_user, buff, 1)) {
|
|
WL_ERROR(("%s: copy from user failed\n", __FUNCTION__));
|
|
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 10, 0)
|
|
return -EIO;
|
|
+#else
|
|
+ return -EFAULT;
|
|
+#endif
|
|
}
|
|
|
|
if (from_user >= 0x30)
|
|
@@ -3459,22 +3500,48 @@
|
|
WL_ERROR(("%s: SET_MONITOR failed with %d\n", __FUNCTION__, bcmerror));
|
|
return -EIO;
|
|
}
|
|
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0)
|
|
+ *ppos += length;
|
|
+#endif
|
|
return length;
|
|
}
|
|
|
|
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0)
|
|
+static int wl_proc_open(struct inode *inode, struct file *file)
|
|
+{
|
|
+ return single_open(file, wl_proc_read, PDE_DATA(inode));
|
|
+}
|
|
+
|
|
+static const struct file_operations wl_fops = {
|
|
+ .owner = THIS_MODULE,
|
|
+ .open = wl_proc_open,
|
|
+ .read = seq_read,
|
|
+ .write = wl_proc_write,
|
|
+ .llseek = seq_lseek,
|
|
+ .release = single_release,
|
|
+};
|
|
+#endif
|
|
+
|
|
static int
|
|
wl_reg_proc_entry(wl_info_t *wl)
|
|
{
|
|
char tmp[32];
|
|
sprintf(tmp, "%s%d", HYBRID_PROC, wl->pub->unit);
|
|
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 10, 0)
|
|
if ((wl->proc_entry = create_proc_entry(tmp, 0644, NULL)) == NULL) {
|
|
WL_ERROR(("%s: create_proc_entry %s failed\n", __FUNCTION__, tmp));
|
|
+#else
|
|
+ if ((wl->proc_entry = proc_create_data(tmp, 0644, NULL, &wl_fops, wl)) == NULL) {
|
|
+ WL_ERROR(("%s: proc_create_data %s failed\n", __FUNCTION__, tmp));
|
|
+#endif
|
|
ASSERT(0);
|
|
return -1;
|
|
}
|
|
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 10, 0)
|
|
wl->proc_entry->read_proc = wl_proc_read;
|
|
wl->proc_entry->write_proc = wl_proc_write;
|
|
wl->proc_entry->data = wl;
|
|
+#endif
|
|
return 0;
|
|
}
|
|
#ifdef WLOFFLD
|