Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 311030 Details for
Bug 453390
wifi problems with kernel 2.6.25.9-74
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Corrected wireless fixup patch for kernel-2.6.25.9-81.fc9
linux-2.6-wireless-fixups.patch (text/plain), 38.94 KB, created by
Stefan Becker
on 2008-07-04 10:22:08 UTC
(
hide
)
Description:
Corrected wireless fixup patch for kernel-2.6.25.9-81.fc9
Filename:
MIME Type:
Creator:
Stefan Becker
Created:
2008-07-04 10:22:08 UTC
Size:
38.94 KB
patch
obsolete
>diff -up linux-2.6.25.noarch/drivers/net/wireless/airo.c.orig linux-2.6.25.noarch/drivers/net/wireless/airo.c >--- linux-2.6.25.noarch/drivers/net/wireless/airo.c.orig 2008-07-01 14:22:15.000000000 -0400 >+++ linux-2.6.25.noarch/drivers/net/wireless/airo.c 2008-07-01 14:24:27.000000000 -0400 >@@ -3659,7 +3659,7 @@ void mpi_receive_802_11 (struct airo_inf > ptr += hdrlen; > if (hdrlen == 24) > ptr += 6; >- gap = get_unaligned_le16(ptr); >+ gap = le16_to_cpu(get_unaligned((__le16 *)ptr)); > ptr += sizeof(__le16); > if (gap) { > if (gap <= 8) >@@ -4349,28 +4349,24 @@ static int proc_config_open( struct inod > static int proc_wepkey_open( struct inode *inode, struct file *file ); > > static const struct file_operations proc_statsdelta_ops = { >- .owner = THIS_MODULE, > .read = proc_read, > .open = proc_statsdelta_open, > .release = proc_close > }; > > static const struct file_operations proc_stats_ops = { >- .owner = THIS_MODULE, > .read = proc_read, > .open = proc_stats_open, > .release = proc_close > }; > > static const struct file_operations proc_status_ops = { >- .owner = THIS_MODULE, > .read = proc_read, > .open = proc_status_open, > .release = proc_close > }; > > static const struct file_operations proc_SSID_ops = { >- .owner = THIS_MODULE, > .read = proc_read, > .write = proc_write, > .open = proc_SSID_open, >@@ -4378,7 +4374,6 @@ static const struct file_operations proc > }; > > static const struct file_operations proc_BSSList_ops = { >- .owner = THIS_MODULE, > .read = proc_read, > .write = proc_write, > .open = proc_BSSList_open, >@@ -4386,7 +4381,6 @@ static const struct file_operations proc > }; > > static const struct file_operations proc_APList_ops = { >- .owner = THIS_MODULE, > .read = proc_read, > .write = proc_write, > .open = proc_APList_open, >@@ -4394,7 +4388,6 @@ static const struct file_operations proc > }; > > static const struct file_operations proc_config_ops = { >- .owner = THIS_MODULE, > .read = proc_read, > .write = proc_write, > .open = proc_config_open, >@@ -4402,7 +4395,6 @@ static const struct file_operations proc > }; > > static const struct file_operations proc_wepkey_ops = { >- .owner = THIS_MODULE, > .read = proc_read, > .write = proc_write, > .open = proc_wepkey_open, >@@ -4421,6 +4413,10 @@ struct proc_data { > void (*on_close) (struct inode *, struct file *); > }; > >+#ifndef SETPROC_OPS >+#define SETPROC_OPS(entry, ops) (entry)->proc_fops = &(ops) >+#endif >+ > static int setup_proc_entry( struct net_device *dev, > struct airo_info *apriv ) { > struct proc_dir_entry *entry; >@@ -4436,76 +4432,100 @@ static int setup_proc_entry( struct net_ > apriv->proc_entry->owner = THIS_MODULE; > > /* Setup the StatsDelta */ >- entry = proc_create_data("StatsDelta", >- S_IFREG | (S_IRUGO&proc_perm), >- apriv->proc_entry, &proc_statsdelta_ops, dev); >+ entry = create_proc_entry("StatsDelta", >+ S_IFREG | (S_IRUGO&proc_perm), >+ apriv->proc_entry); > if (!entry) > goto fail_stats_delta; > entry->uid = proc_uid; > entry->gid = proc_gid; >+ entry->data = dev; >+ entry->owner = THIS_MODULE; >+ SETPROC_OPS(entry, proc_statsdelta_ops); > > /* Setup the Stats */ >- entry = proc_create_data("Stats", >- S_IFREG | (S_IRUGO&proc_perm), >- apriv->proc_entry, &proc_stats_ops, dev); >+ entry = create_proc_entry("Stats", >+ S_IFREG | (S_IRUGO&proc_perm), >+ apriv->proc_entry); > if (!entry) > goto fail_stats; > entry->uid = proc_uid; > entry->gid = proc_gid; >+ entry->data = dev; >+ entry->owner = THIS_MODULE; >+ SETPROC_OPS(entry, proc_stats_ops); > > /* Setup the Status */ >- entry = proc_create_data("Status", >- S_IFREG | (S_IRUGO&proc_perm), >- apriv->proc_entry, &proc_status_ops, dev); >+ entry = create_proc_entry("Status", >+ S_IFREG | (S_IRUGO&proc_perm), >+ apriv->proc_entry); > if (!entry) > goto fail_status; > entry->uid = proc_uid; > entry->gid = proc_gid; >+ entry->data = dev; >+ entry->owner = THIS_MODULE; >+ SETPROC_OPS(entry, proc_status_ops); > > /* Setup the Config */ >- entry = proc_create_data("Config", >- S_IFREG | proc_perm, >- apriv->proc_entry, &proc_config_ops, dev); >+ entry = create_proc_entry("Config", >+ S_IFREG | proc_perm, >+ apriv->proc_entry); > if (!entry) > goto fail_config; > entry->uid = proc_uid; > entry->gid = proc_gid; >+ entry->data = dev; >+ entry->owner = THIS_MODULE; >+ SETPROC_OPS(entry, proc_config_ops); > > /* Setup the SSID */ >- entry = proc_create_data("SSID", >- S_IFREG | proc_perm, >- apriv->proc_entry, &proc_SSID_ops, dev); >+ entry = create_proc_entry("SSID", >+ S_IFREG | proc_perm, >+ apriv->proc_entry); > if (!entry) > goto fail_ssid; > entry->uid = proc_uid; > entry->gid = proc_gid; >+ entry->data = dev; >+ entry->owner = THIS_MODULE; >+ SETPROC_OPS(entry, proc_SSID_ops); > > /* Setup the APList */ >- entry = proc_create_data("APList", >- S_IFREG | proc_perm, >- apriv->proc_entry, &proc_APList_ops, dev); >+ entry = create_proc_entry("APList", >+ S_IFREG | proc_perm, >+ apriv->proc_entry); > if (!entry) > goto fail_aplist; > entry->uid = proc_uid; > entry->gid = proc_gid; >+ entry->data = dev; >+ entry->owner = THIS_MODULE; >+ SETPROC_OPS(entry, proc_APList_ops); > > /* Setup the BSSList */ >- entry = proc_create_data("BSSList", >- S_IFREG | proc_perm, >- apriv->proc_entry, &proc_BSSList_ops, dev); >+ entry = create_proc_entry("BSSList", >+ S_IFREG | proc_perm, >+ apriv->proc_entry); > if (!entry) > goto fail_bsslist; > entry->uid = proc_uid; > entry->gid = proc_gid; >+ entry->data = dev; >+ entry->owner = THIS_MODULE; >+ SETPROC_OPS(entry, proc_BSSList_ops); > > /* Setup the WepKey */ >- entry = proc_create_data("WepKey", >- S_IFREG | proc_perm, >- apriv->proc_entry, &proc_wepkey_ops, dev); >+ entry = create_proc_entry("WepKey", >+ S_IFREG | proc_perm, >+ apriv->proc_entry); > if (!entry) > goto fail_wepkey; > entry->uid = proc_uid; > entry->gid = proc_gid; >+ entry->data = dev; >+ entry->owner = THIS_MODULE; >+ SETPROC_OPS(entry, proc_wepkey_ops); > > return 0; > >diff -up linux-2.6.25.noarch/drivers/net/wireless/ath5k/base.c.orig linux-2.6.25.noarch/drivers/net/wireless/ath5k/base.c >--- linux-2.6.25.noarch/drivers/net/wireless/ath5k/base.c.orig 2008-07-01 14:22:15.000000000 -0400 >+++ linux-2.6.25.noarch/drivers/net/wireless/ath5k/base.c 2008-07-01 14:24:27.000000000 -0400 >@@ -58,6 +58,10 @@ > #include "reg.h" > #include "debug.h" > >+/* unaligned little endian access */ >+#define LE_READ_2(_p) (le16_to_cpu(get_unaligned((__le16 *)(_p)))) >+#define LE_READ_4(_p) (le32_to_cpu(get_unaligned((__le32 *)(_p)))) >+ > static int ath5k_calinterval = 10; /* Calibrate PHY every 10 secs (TODO: Fixme) */ > > >@@ -2858,9 +2862,9 @@ static void ath5k_configure_filter(struc > if (!mclist) > break; > /* calculate XOR of eight 6-bit values */ >- val = get_unaligned_le32(mclist->dmi_addr + 0); >+ val = LE_READ_4(mclist->dmi_addr + 0); > pos = (val >> 18) ^ (val >> 12) ^ (val >> 6) ^ val; >- val = get_unaligned_le32(mclist->dmi_addr + 3); >+ val = LE_READ_4(mclist->dmi_addr + 3); > pos ^= (val >> 18) ^ (val >> 12) ^ (val >> 6) ^ val; > pos &= 0x3f; > mfilt[pos / 32] |= (1 << (pos % 32)); >diff -up linux-2.6.25.noarch/drivers/net/wireless/b43/b43.h.orig linux-2.6.25.noarch/drivers/net/wireless/b43/b43.h >--- linux-2.6.25.noarch/drivers/net/wireless/b43/b43.h.orig 2008-07-01 14:22:15.000000000 -0400 >+++ linux-2.6.25.noarch/drivers/net/wireless/b43/b43.h 2008-07-01 14:24:27.000000000 -0400 >@@ -967,6 +967,22 @@ static inline bool __b43_warn_on_dummy(b > # define B43_WARN_ON(x) __b43_warn_on_dummy(unlikely(!!(x))) > #endif > >+/** Limit a value between two limits */ >+#ifdef limit_value >+# undef limit_value >+#endif >+#define limit_value(value, min, max) \ >+ ({ \ >+ typeof(value) __value = (value); \ >+ typeof(value) __min = (min); \ >+ typeof(value) __max = (max); \ >+ if (__value < __min) \ >+ __value = __min; \ >+ else if (__value > __max) \ >+ __value = __max; \ >+ __value; \ >+ }) >+ > /* Convert an integer to a Q5.2 value */ > #define INT_TO_Q52(i) ((i) << 2) > /* Convert a Q5.2 value to an integer (precision loss!) */ >diff -up linux-2.6.25.noarch/drivers/net/wireless/b43legacy/b43legacy.h.orig linux-2.6.25.noarch/drivers/net/wireless/b43legacy/b43legacy.h >--- linux-2.6.25.noarch/drivers/net/wireless/b43legacy/b43legacy.h.orig 2008-07-01 14:22:15.000000000 -0400 >+++ linux-2.6.25.noarch/drivers/net/wireless/b43legacy/b43legacy.h 2008-07-01 14:24:27.000000000 -0400 >@@ -823,6 +823,23 @@ void b43legacydbg(struct b43legacy_wl *w > # define b43legacydbg(wl, fmt...) do { /* nothing */ } while (0) > #endif /* DEBUG */ > >+ >+/** Limit a value between two limits */ >+#ifdef limit_value >+# undef limit_value >+#endif >+#define limit_value(value, min, max) \ >+ ({ \ >+ typeof(value) __value = (value); \ >+ typeof(value) __min = (min); \ >+ typeof(value) __max = (max); \ >+ if (__value < __min) \ >+ __value = __min; \ >+ else if (__value > __max) \ >+ __value = __max; \ >+ __value; \ >+ }) >+ > /* Macros for printing a value in Q5.2 format */ > #define Q52_FMT "%u.%u" > #define Q52_ARG(q52) ((q52) / 4), (((q52) & 3) * 100 / 4) >diff -up linux-2.6.25.noarch/drivers/net/wireless/b43legacy/main.c.orig linux-2.6.25.noarch/drivers/net/wireless/b43legacy/main.c >--- linux-2.6.25.noarch/drivers/net/wireless/b43legacy/main.c.orig 2008-07-01 14:22:15.000000000 -0400 >+++ linux-2.6.25.noarch/drivers/net/wireless/b43legacy/main.c 2008-07-01 14:24:27.000000000 -0400 >@@ -846,10 +846,10 @@ static void handle_irq_noise(struct b43l > /* Get the noise samples. */ > B43legacy_WARN_ON(dev->noisecalc.nr_samples >= 8); > i = dev->noisecalc.nr_samples; >- noise[0] = clamp_val(noise[0], 0, ARRAY_SIZE(phy->nrssi_lt) - 1); >- noise[1] = clamp_val(noise[1], 0, ARRAY_SIZE(phy->nrssi_lt) - 1); >- noise[2] = clamp_val(noise[2], 0, ARRAY_SIZE(phy->nrssi_lt) - 1); >- noise[3] = clamp_val(noise[3], 0, ARRAY_SIZE(phy->nrssi_lt) - 1); >+ noise[0] = limit_value(noise[0], 0, ARRAY_SIZE(phy->nrssi_lt) - 1); >+ noise[1] = limit_value(noise[1], 0, ARRAY_SIZE(phy->nrssi_lt) - 1); >+ noise[2] = limit_value(noise[2], 0, ARRAY_SIZE(phy->nrssi_lt) - 1); >+ noise[3] = limit_value(noise[3], 0, ARRAY_SIZE(phy->nrssi_lt) - 1); > dev->noisecalc.samples[i][0] = phy->nrssi_lt[noise[0]]; > dev->noisecalc.samples[i][1] = phy->nrssi_lt[noise[1]]; > dev->noisecalc.samples[i][2] = phy->nrssi_lt[noise[2]]; >@@ -1720,7 +1720,7 @@ static int b43legacy_write_initvals(stru > goto err_format; > array_size -= sizeof(iv->data.d32); > >- value = get_unaligned_be32(&iv->data.d32); >+ value = be32_to_cpu(get_unaligned(&iv->data.d32)); > b43legacy_write32(dev, offset, value); > > iv = (const struct b43legacy_iv *)((const uint8_t *)iv + >diff -up linux-2.6.25.noarch/drivers/net/wireless/b43legacy/phy.c.orig linux-2.6.25.noarch/drivers/net/wireless/b43legacy/phy.c >--- linux-2.6.25.noarch/drivers/net/wireless/b43legacy/phy.c.orig 2008-07-01 14:22:15.000000000 -0400 >+++ linux-2.6.25.noarch/drivers/net/wireless/b43legacy/phy.c 2008-07-01 14:24:27.000000000 -0400 >@@ -1088,7 +1088,7 @@ static void b43legacy_phy_initg(struct b > * the value 0x7FFFFFFF here. I think that is some weird > * compiler optimization in the original driver. > * Essentially, what we do here is resetting all NRSSI LT >- * entries to -32 (see the clamp_val() in nrssi_hw_update()) >+ * entries to -32 (see the limit_value() in nrssi_hw_update()) > */ > b43legacy_nrssi_hw_update(dev, 0xFFFF); > b43legacy_calc_nrssi_threshold(dev); >@@ -1756,7 +1756,7 @@ static s8 b43legacy_phy_estimate_power_o > switch (phy->type) { > case B43legacy_PHYTYPE_B: > case B43legacy_PHYTYPE_G: >- tmp = clamp_val(tmp, 0x00, 0x3F); >+ tmp = limit_value(tmp, 0x00, 0x3F); > dbm = phy->tssi2dbm[tmp]; > break; > default: >@@ -1859,7 +1859,7 @@ void b43legacy_phy_xmitpower(struct b43l > > /* find the desired power in Q5.2 - power_level is in dBm > * and limit it - max_pwr is already in Q5.2 */ >- desired_pwr = clamp_val(phy->power_level << 2, 0, max_pwr); >+ desired_pwr = limit_value(phy->power_level << 2, 0, max_pwr); > if (b43legacy_debug(dev, B43legacy_DBG_XMITPOWER)) > b43legacydbg(dev->wl, "Current TX power output: " Q52_FMT > " dBm, Desired TX power output: " Q52_FMT >@@ -1905,7 +1905,7 @@ void b43legacy_phy_xmitpower(struct b43l > radio_attenuation++; > } > } >- baseband_attenuation = clamp_val(baseband_attenuation, 0, 11); >+ baseband_attenuation = limit_value(baseband_attenuation, 0, 11); > > txpower = phy->txctl1; > if ((phy->radio_ver == 0x2050) && (phy->radio_rev == 2)) { >@@ -1933,8 +1933,8 @@ void b43legacy_phy_xmitpower(struct b43l > } > /* Save the control values */ > phy->txctl1 = txpower; >- baseband_attenuation = clamp_val(baseband_attenuation, 0, 11); >- radio_attenuation = clamp_val(radio_attenuation, 0, 9); >+ baseband_attenuation = limit_value(baseband_attenuation, 0, 11); >+ radio_attenuation = limit_value(radio_attenuation, 0, 9); > phy->rfatt = radio_attenuation; > phy->bbatt = baseband_attenuation; > >@@ -1979,7 +1979,7 @@ s8 b43legacy_tssi2dbm_entry(s8 entry [], > f = q; > i++; > } while (delta >= 2); >- entry[index] = clamp_val(b43legacy_tssi2dbm_ad(m1 * f, 8192), >+ entry[index] = limit_value(b43legacy_tssi2dbm_ad(m1 * f, 8192), > -127, 128); > return 0; > } >diff -up linux-2.6.25.noarch/drivers/net/wireless/b43legacy/radio.c.orig linux-2.6.25.noarch/drivers/net/wireless/b43legacy/radio.c >--- linux-2.6.25.noarch/drivers/net/wireless/b43legacy/radio.c.orig 2008-07-01 14:22:15.000000000 -0400 >+++ linux-2.6.25.noarch/drivers/net/wireless/b43legacy/radio.c 2008-07-01 14:24:27.000000000 -0400 >@@ -357,7 +357,7 @@ void b43legacy_nrssi_hw_update(struct b4 > for (i = 0; i < 64; i++) { > tmp = b43legacy_nrssi_hw_read(dev, i); > tmp -= val; >- tmp = clamp_val(tmp, -32, 31); >+ tmp = limit_value(tmp, -32, 31); > b43legacy_nrssi_hw_write(dev, i, tmp); > } > } >@@ -375,7 +375,7 @@ void b43legacy_nrssi_mem_update(struct b > tmp = (i - delta) * phy->nrssislope; > tmp /= 0x10000; > tmp += 0x3A; >- tmp = clamp_val(tmp, 0, 0x3F); >+ tmp = limit_value(tmp, 0, 0x3F); > phy->nrssi_lt[i] = tmp; > } > } >@@ -839,7 +839,7 @@ void b43legacy_calc_nrssi_threshold(stru > } else > threshold = phy->nrssi[1] - 5; > >- threshold = clamp_val(threshold, 0, 0x3E); >+ threshold = limit_value(threshold, 0, 0x3E); > b43legacy_phy_read(dev, 0x0020); /* dummy read */ > b43legacy_phy_write(dev, 0x0020, (((u16)threshold) << 8) > | 0x001C); >@@ -892,7 +892,7 @@ void b43legacy_calc_nrssi_threshold(stru > else > a += 32; > a = a >> 6; >- a = clamp_val(a, -31, 31); >+ a = limit_value(a, -31, 31); > > b = b * (phy->nrssi[1] - phy->nrssi[0]); > b += (phy->nrssi[0] << 6); >@@ -901,7 +901,7 @@ void b43legacy_calc_nrssi_threshold(stru > else > b += 32; > b = b >> 6; >- b = clamp_val(b, -31, 31); >+ b = limit_value(b, -31, 31); > > tmp_u16 = b43legacy_phy_read(dev, 0x048A) & 0xF000; > tmp_u16 |= ((u32)b & 0x0000003F); >@@ -1905,7 +1905,7 @@ void b43legacy_radio_set_txpower_a(struc > u16 dac; > u16 ilt; > >- txpower = clamp_val(txpower, 0, 63); >+ txpower = limit_value(txpower, 0, 63); > > pamp = b43legacy_get_txgain_freq_power_amp(txpower); > pamp <<= 5; >diff -up linux-2.6.25.noarch/drivers/net/wireless/b43/lo.c.orig linux-2.6.25.noarch/drivers/net/wireless/b43/lo.c >--- linux-2.6.25.noarch/drivers/net/wireless/b43/lo.c.orig 2008-07-01 14:22:15.000000000 -0400 >+++ linux-2.6.25.noarch/drivers/net/wireless/b43/lo.c 2008-07-01 14:24:27.000000000 -0400 >@@ -199,7 +199,7 @@ static void lo_measure_txctl_values(stru > if (lb_gain > 10) { > radio_pctl_reg = 0; > pga = abs(10 - lb_gain) / 6; >- pga = clamp_val(pga, 0, 15); >+ pga = limit_value(pga, 0, 15); > } else { > int cmp_val; > int tmp; >@@ -321,7 +321,7 @@ static void lo_measure_gain_values(struc > phy->lna_lod_gain = 1; > trsw_rx_gain -= 8; > } >- trsw_rx_gain = clamp_val(trsw_rx_gain, 0, 0x2D); >+ trsw_rx_gain = limit_value(trsw_rx_gain, 0, 0x2D); > phy->pga_gain = trsw_rx_gain / 3; > if (phy->pga_gain >= 5) { > phy->pga_gain -= 5; >diff -up linux-2.6.25.noarch/drivers/net/wireless/b43/main.c.orig linux-2.6.25.noarch/drivers/net/wireless/b43/main.c >--- linux-2.6.25.noarch/drivers/net/wireless/b43/main.c.orig 2008-07-01 14:22:15.000000000 -0400 >+++ linux-2.6.25.noarch/drivers/net/wireless/b43/main.c 2008-07-01 14:24:27.000000000 -0400 >@@ -1211,10 +1211,10 @@ static void handle_irq_noise(struct b43_ > /* Get the noise samples. */ > B43_WARN_ON(dev->noisecalc.nr_samples >= 8); > i = dev->noisecalc.nr_samples; >- noise[0] = clamp_val(noise[0], 0, ARRAY_SIZE(phy->nrssi_lt) - 1); >- noise[1] = clamp_val(noise[1], 0, ARRAY_SIZE(phy->nrssi_lt) - 1); >- noise[2] = clamp_val(noise[2], 0, ARRAY_SIZE(phy->nrssi_lt) - 1); >- noise[3] = clamp_val(noise[3], 0, ARRAY_SIZE(phy->nrssi_lt) - 1); >+ noise[0] = limit_value(noise[0], 0, ARRAY_SIZE(phy->nrssi_lt) - 1); >+ noise[1] = limit_value(noise[1], 0, ARRAY_SIZE(phy->nrssi_lt) - 1); >+ noise[2] = limit_value(noise[2], 0, ARRAY_SIZE(phy->nrssi_lt) - 1); >+ noise[3] = limit_value(noise[3], 0, ARRAY_SIZE(phy->nrssi_lt) - 1); > dev->noisecalc.samples[i][0] = phy->nrssi_lt[noise[0]]; > dev->noisecalc.samples[i][1] = phy->nrssi_lt[noise[1]]; > dev->noisecalc.samples[i][2] = phy->nrssi_lt[noise[2]]; >@@ -2355,7 +2355,7 @@ static int b43_write_initvals(struct b43 > goto err_format; > array_size -= sizeof(iv->data.d32); > >- value = get_unaligned_be32(&iv->data.d32); >+ value = be32_to_cpu(get_unaligned(&iv->data.d32)); > b43_write32(dev, offset, value); > > iv = (const struct b43_iv *)((const uint8_t *)iv + >diff -up linux-2.6.25.noarch/drivers/net/wireless/b43/phy.c.orig linux-2.6.25.noarch/drivers/net/wireless/b43/phy.c >--- linux-2.6.25.noarch/drivers/net/wireless/b43/phy.c.orig 2008-07-01 14:22:15.000000000 -0400 >+++ linux-2.6.25.noarch/drivers/net/wireless/b43/phy.c 2008-07-01 14:24:27.000000000 -0400 >@@ -1400,7 +1400,7 @@ static void b43_phy_initg(struct b43_wld > * the value 0x7FFFFFFF here. I think that is some weird > * compiler optimization in the original driver. > * Essentially, what we do here is resetting all NRSSI LT >- * entries to -32 (see the clamp_val() in nrssi_hw_update()) >+ * entries to -32 (see the limit_value() in nrssi_hw_update()) > */ > b43_nrssi_hw_update(dev, 0xFFFF); //FIXME? > b43_calc_nrssi_threshold(dev); >@@ -1462,13 +1462,13 @@ static s8 b43_phy_estimate_power_out(str > switch (phy->type) { > case B43_PHYTYPE_A: > tmp += 0x80; >- tmp = clamp_val(tmp, 0x00, 0xFF); >+ tmp = limit_value(tmp, 0x00, 0xFF); > dbm = phy->tssi2dbm[tmp]; > //TODO: There's a FIXME on the specs > break; > case B43_PHYTYPE_B: > case B43_PHYTYPE_G: >- tmp = clamp_val(tmp, 0x00, 0x3F); >+ tmp = limit_value(tmp, 0x00, 0x3F); > dbm = phy->tssi2dbm[tmp]; > break; > default: >@@ -1527,8 +1527,8 @@ void b43_put_attenuation_into_ranges(str > break; > } > >- *_rfatt = clamp_val(rfatt, rf_min, rf_max); >- *_bbatt = clamp_val(bbatt, bb_min, bb_max); >+ *_rfatt = limit_value(rfatt, rf_min, rf_max); >+ *_bbatt = limit_value(bbatt, bb_min, bb_max); > } > > /* http://bcm-specs.sipsolutions.net/RecalculateTransmissionPower */ >@@ -1623,7 +1623,7 @@ void b43_phy_xmitpower(struct b43_wldev > /* Get desired power (in Q5.2) */ > desired_pwr = INT_TO_Q52(phy->power_level); > /* And limit it. max_pwr already is Q5.2 */ >- desired_pwr = clamp_val(desired_pwr, 0, max_pwr); >+ desired_pwr = limit_value(desired_pwr, 0, max_pwr); > if (b43_debug(dev, B43_DBG_XMITPOWER)) { > b43dbg(dev->wl, > "Current TX power output: " Q52_FMT >@@ -1733,7 +1733,7 @@ static inline > f = q; > i++; > } while (delta >= 2); >- entry[index] = clamp_val(b43_tssi2dbm_ad(m1 * f, 8192), -127, 128); >+ entry[index] = limit_value(b43_tssi2dbm_ad(m1 * f, 8192), -127, 128); > return 0; > } > >@@ -2259,7 +2259,7 @@ void b43_nrssi_hw_update(struct b43_wlde > for (i = 0; i < 64; i++) { > tmp = b43_nrssi_hw_read(dev, i); > tmp -= val; >- tmp = clamp_val(tmp, -32, 31); >+ tmp = limit_value(tmp, -32, 31); > b43_nrssi_hw_write(dev, i, tmp); > } > } >@@ -2276,7 +2276,7 @@ void b43_nrssi_mem_update(struct b43_wld > tmp = (i - delta) * phy->nrssislope; > tmp /= 0x10000; > tmp += 0x3A; >- tmp = clamp_val(tmp, 0, 0x3F); >+ tmp = limit_value(tmp, 0, 0x3F); > phy->nrssi_lt[i] = tmp; > } > } >@@ -2713,7 +2713,7 @@ void b43_calc_nrssi_threshold(struct b43 > } else > threshold = phy->nrssi[1] - 5; > >- threshold = clamp_val(threshold, 0, 0x3E); >+ threshold = limit_value(threshold, 0, 0x3E); > b43_phy_read(dev, 0x0020); /* dummy read */ > b43_phy_write(dev, 0x0020, > (((u16) threshold) << 8) | 0x001C); >@@ -2764,7 +2764,7 @@ void b43_calc_nrssi_threshold(struct b43 > else > a += 32; > a = a >> 6; >- a = clamp_val(a, -31, 31); >+ a = limit_value(a, -31, 31); > > b = b * (phy->nrssi[1] - phy->nrssi[0]); > b += (phy->nrssi[0] << 6); >@@ -2773,7 +2773,7 @@ void b43_calc_nrssi_threshold(struct b43 > else > b += 32; > b = b >> 6; >- b = clamp_val(b, -31, 31); >+ b = limit_value(b, -31, 31); > > tmp_u16 = b43_phy_read(dev, 0x048A) & 0xF000; > tmp_u16 |= ((u32) b & 0x0000003F); >diff -up linux-2.6.25.noarch/drivers/net/wireless/iwlwifi/iwl-3945.c.orig linux-2.6.25.noarch/drivers/net/wireless/iwlwifi/iwl-3945.c >--- linux-2.6.25.noarch/drivers/net/wireless/iwlwifi/iwl-3945.c.orig 2008-07-01 14:22:15.000000000 -0400 >+++ linux-2.6.25.noarch/drivers/net/wireless/iwlwifi/iwl-3945.c 2008-07-01 14:24:27.000000000 -0400 >@@ -556,36 +556,40 @@ static void iwl3945_add_radiotap(struct > iwl3945_rt->rt_hdr.it_pad = 0; > > /* total header + data */ >- put_unaligned_le16(sizeof(*iwl3945_rt), &iwl3945_rt->rt_hdr.it_len); >+ put_unaligned(cpu_to_le16(sizeof(*iwl3945_rt)), >+ &iwl3945_rt->rt_hdr.it_len); > > /* Indicate all the fields we add to the radiotap header */ >- put_unaligned_le32((1 << IEEE80211_RADIOTAP_TSFT) | >- (1 << IEEE80211_RADIOTAP_FLAGS) | >- (1 << IEEE80211_RADIOTAP_RATE) | >- (1 << IEEE80211_RADIOTAP_CHANNEL) | >- (1 << IEEE80211_RADIOTAP_DBM_ANTSIGNAL) | >- (1 << IEEE80211_RADIOTAP_DBM_ANTNOISE) | >- (1 << IEEE80211_RADIOTAP_ANTENNA), >- &iwl3945_rt->rt_hdr.it_present); >+ put_unaligned(cpu_to_le32((1 << IEEE80211_RADIOTAP_TSFT) | >+ (1 << IEEE80211_RADIOTAP_FLAGS) | >+ (1 << IEEE80211_RADIOTAP_RATE) | >+ (1 << IEEE80211_RADIOTAP_CHANNEL) | >+ (1 << IEEE80211_RADIOTAP_DBM_ANTSIGNAL) | >+ (1 << IEEE80211_RADIOTAP_DBM_ANTNOISE) | >+ (1 << IEEE80211_RADIOTAP_ANTENNA)), >+ &iwl3945_rt->rt_hdr.it_present); > > /* Zero the flags, we'll add to them as we go */ > iwl3945_rt->rt_flags = 0; > >- put_unaligned_le64(tsf, &iwl3945_rt->rt_tsf); >+ put_unaligned(cpu_to_le64(tsf), &iwl3945_rt->rt_tsf); > > iwl3945_rt->rt_dbmsignal = signal; > iwl3945_rt->rt_dbmnoise = noise; > > /* Convert the channel frequency and set the flags */ >- put_unaligned_le16(stats->freq, &iwl3945_rt->rt_channelMHz); >+ put_unaligned(cpu_to_le16(stats->freq), &iwl3945_rt->rt_channelMHz); > if (!(phy_flags_hw & RX_RES_PHY_FLAGS_BAND_24_MSK)) >- put_unaligned_le16(IEEE80211_CHAN_OFDM | IEEE80211_CHAN_5GHZ, >+ put_unaligned(cpu_to_le16(IEEE80211_CHAN_OFDM | >+ IEEE80211_CHAN_5GHZ), > &iwl3945_rt->rt_chbitmask); > else if (phy_flags_hw & RX_RES_PHY_FLAGS_MOD_CCK_MSK) >- put_unaligned_le16(IEEE80211_CHAN_CCK | IEEE80211_CHAN_2GHZ, >+ put_unaligned(cpu_to_le16(IEEE80211_CHAN_CCK | >+ IEEE80211_CHAN_2GHZ), > &iwl3945_rt->rt_chbitmask); > else /* 802.11g */ >- put_unaligned_le16(IEEE80211_CHAN_OFDM | IEEE80211_CHAN_2GHZ, >+ put_unaligned(cpu_to_le16(IEEE80211_CHAN_OFDM | >+ IEEE80211_CHAN_2GHZ), > &iwl3945_rt->rt_chbitmask); > > if (rate == -1) >diff -up linux-2.6.25.noarch/drivers/net/wireless/libertas/scan.c.orig linux-2.6.25.noarch/drivers/net/wireless/libertas/scan.c >--- linux-2.6.25.noarch/drivers/net/wireless/libertas/scan.c.orig 2008-07-01 14:22:16.000000000 -0400 >+++ linux-2.6.25.noarch/drivers/net/wireless/libertas/scan.c 2008-07-01 14:24:27.000000000 -0400 >@@ -523,7 +523,7 @@ static int lbs_process_bss(struct bss_de > > if (*bytesleft >= sizeof(beaconsize)) { > /* Extract & convert beacon size from the command buffer */ >- beaconsize = get_unaligned_le16(*pbeaconinfo); >+ beaconsize = le16_to_cpu(get_unaligned((__le16 *)*pbeaconinfo)); > *bytesleft -= sizeof(beaconsize); > *pbeaconinfo += sizeof(beaconsize); > } >diff -up linux-2.6.25.noarch/drivers/net/wireless/mac80211_hwsim.c.orig linux-2.6.25.noarch/drivers/net/wireless/mac80211_hwsim.c >--- linux-2.6.25.noarch/drivers/net/wireless/mac80211_hwsim.c.orig 2008-07-01 14:22:16.000000000 -0400 >+++ linux-2.6.25.noarch/drivers/net/wireless/mac80211_hwsim.c 2008-07-01 14:24:27.000000000 -0400 >@@ -430,16 +430,15 @@ static int __init init_mac80211_hwsim(vo > hwsim_radios[i] = hw; > > data = hw->priv; >- data->dev = device_create_drvdata(hwsim_class, NULL, 0, hw, >- "hwsim%d", i); >+ data->dev = device_create(hwsim_class, NULL, 0, "hwsim%d", i); > if (IS_ERR(data->dev)) { >- printk(KERN_DEBUG >- "mac80211_hwsim: device_create_drvdata " >+ printk(KERN_DEBUG "mac80211_hwsim: device_create " > "failed (%ld)\n", PTR_ERR(data->dev)); > err = -ENOMEM; > goto failed; > } > data->dev->driver = &mac80211_hwsim_driver; >+ dev_set_drvdata(data->dev, hw); > > SET_IEEE80211_DEV(hw, data->dev); > addr[3] = i >> 8; >diff -up linux-2.6.25.noarch/drivers/net/wireless/zd1211rw/zd_usb.c.orig linux-2.6.25.noarch/drivers/net/wireless/zd1211rw/zd_usb.c >--- linux-2.6.25.noarch/drivers/net/wireless/zd1211rw/zd_usb.c.orig 2008-07-01 14:22:16.000000000 -0400 >+++ linux-2.6.25.noarch/drivers/net/wireless/zd1211rw/zd_usb.c 2008-07-01 14:24:27.000000000 -0400 >@@ -556,11 +556,11 @@ static void handle_rx_packet(struct zd_u > * be padded. Unaligned access might also happen if the length_info > * structure is not present. > */ >- if (get_unaligned_le16(&length_info->tag) == RX_LENGTH_INFO_TAG) >+ if (get_unaligned(&length_info->tag) == cpu_to_le16(RX_LENGTH_INFO_TAG)) > { > unsigned int l, k, n; > for (i = 0, l = 0;; i++) { >- k = get_unaligned_le16(&length_info->length[i]); >+ k = le16_to_cpu(get_unaligned(&length_info->length[i])); > if (k == 0) > return; > n = l+k; >diff -up linux-2.6.25.noarch/include/linux/input.h.orig linux-2.6.25.noarch/include/linux/input.h >--- linux-2.6.25.noarch/include/linux/input.h.orig 2008-07-01 14:23:01.000000000 -0400 >+++ linux-2.6.25.noarch/include/linux/input.h 2008-07-01 14:23:41.000000000 -0400 >@@ -638,6 +638,7 @@ struct input_absinfo { > #define SW_TABLET_MODE 0x01 /* set = tablet mode */ > #define SW_HEADPHONE_INSERT 0x02 /* set = inserted */ > #define SW_RADIO 0x03 /* set = radio enabled */ >+#define SW_RFKILL_ALL SW_RADIO > #define SW_MAX 0x0f > #define SW_CNT (SW_MAX+1) > >diff -up linux-2.6.25.noarch/net/mac80211/iface.c.orig linux-2.6.25.noarch/net/mac80211/iface.c >--- linux-2.6.25.noarch/net/mac80211/iface.c.orig 2008-07-01 14:22:17.000000000 -0400 >+++ linux-2.6.25.noarch/net/mac80211/iface.c 2008-07-01 14:24:27.000000000 -0400 >@@ -53,15 +53,6 @@ int ieee80211_if_add(struct net_device * > if (!ndev) > return -ENOMEM; > >- ndev->needed_headroom = local->tx_headroom + >- 4*6 /* four MAC addresses */ >- + 2 + 2 + 2 + 2 /* ctl, dur, seq, qos */ >- + 6 /* mesh */ >- + 8 /* rfc1042/bridge tunnel */ >- - ETH_HLEN /* ethernet hard_header_len */ >- + IEEE80211_ENCRYPT_HEADROOM; >- ndev->needed_tailroom = IEEE80211_ENCRYPT_TAILROOM; >- > ret = dev_alloc_name(ndev, ndev->name); > if (ret < 0) > goto fail; >diff -up linux-2.6.25.noarch/net/mac80211/mesh_hwmp.c.orig linux-2.6.25.noarch/net/mac80211/mesh_hwmp.c >--- linux-2.6.25.noarch/net/mac80211/mesh_hwmp.c.orig 2008-07-01 14:22:17.000000000 -0400 >+++ linux-2.6.25.noarch/net/mac80211/mesh_hwmp.c 2008-07-01 14:24:27.000000000 -0400 >@@ -26,7 +26,7 @@ static inline u32 u32_field_get(u8 *preq > { > if (ae) > offset += 6; >- return get_unaligned_le32(preq_elem + offset); >+ return le32_to_cpu(get_unaligned((__le32 *) (preq_elem + offset))); > } > > /* HWMP IE processing macros */ >diff -up linux-2.6.25.noarch/net/mac80211/michael.c.orig linux-2.6.25.noarch/net/mac80211/michael.c >--- linux-2.6.25.noarch/net/mac80211/michael.c.orig 2008-07-01 14:22:17.000000000 -0400 >+++ linux-2.6.25.noarch/net/mac80211/michael.c 2008-07-01 14:24:27.000000000 -0400 >@@ -29,17 +29,16 @@ static void michael_block(struct michael > static void michael_mic_hdr(struct michael_mic_ctx *mctx, > const u8 *key, const u8 *da, const u8 *sa, u8 priority) > { >- mctx->l = get_unaligned_le32(key); >- mctx->r = get_unaligned_le32(key + 4); >+ mctx->l = key[0] | key[1] << 8 | key[2] << 16 | key[3] << 24; >+ mctx->r = key[4] | key[5] << 8 | key[6] << 16 | key[7] << 24; > > /* > * A pseudo header (DA, SA, Priority, 0, 0, 0) is used in Michael MIC > * calculation, but it is _not_ transmitted > */ >- michael_block(mctx, get_unaligned_le32(da)); >- michael_block(mctx, get_unaligned_le16(&da[4]) | >- (get_unaligned_le16(sa) << 16)); >- michael_block(mctx, get_unaligned_le32(&sa[2])); >+ michael_block(mctx, da[0] | da[1] << 8 | da[2] << 16 | da[3] << 24); >+ michael_block(mctx, da[4] | da[5] << 8 | sa[0] << 16 | sa[1] << 24); >+ michael_block(mctx, sa[2] | sa[3] << 8 | sa[4] << 16 | sa[5] << 24); > michael_block(mctx, priority); > } > >@@ -57,7 +56,9 @@ void michael_mic(const u8 *key, const u8 > left = data_len % 4; > > for (block = 0; block < blocks; block++) >- michael_block(&mctx, get_unaligned_le32(&data[block * 4])); >+ michael_block(&mctx, >+ data[block * 4] | data[block * 4 + 1] << 8 | >+ data[block * 4 + 2] << 16 | data[block * 4 + 3] << 24); > > /* Partial block of 0..3 bytes and padding: 0x5a + 4..7 zeros to make > * total length a multiple of 4. */ >@@ -71,6 +72,12 @@ void michael_mic(const u8 *key, const u8 > michael_block(&mctx, val); > michael_block(&mctx, 0); > >- put_unaligned_le32(mctx.l, mic); >- put_unaligned_le32(mctx.r, mic + 4); >+ mic[0] = mctx.l & 0xff; >+ mic[1] = (mctx.l >> 8) & 0xff; >+ mic[2] = (mctx.l >> 16) & 0xff; >+ mic[3] = (mctx.l >> 24) & 0xff; >+ mic[4] = mctx.r & 0xff; >+ mic[5] = (mctx.r >> 8) & 0xff; >+ mic[6] = (mctx.r >> 16) & 0xff; >+ mic[7] = (mctx.r >> 24) & 0xff; > } >diff -up linux-2.6.25.noarch/net/mac80211/tkip.c.orig linux-2.6.25.noarch/net/mac80211/tkip.c >--- linux-2.6.25.noarch/net/mac80211/tkip.c.orig 2008-07-01 14:22:17.000000000 -0400 >+++ linux-2.6.25.noarch/net/mac80211/tkip.c 2008-07-01 14:24:27.000000000 -0400 >@@ -7,22 +7,23 @@ > * published by the Free Software Foundation. > */ > #include <linux/kernel.h> >-#include <linux/bitops.h> > #include <linux/types.h> > #include <linux/netdevice.h> >-#include <asm/unaligned.h> > > #include <net/mac80211.h> > #include "key.h" > #include "tkip.h" > #include "wep.h" > >+ >+/* TKIP key mixing functions */ >+ >+ > #define PHASE1_LOOP_COUNT 8 > >-/* >- * 2-byte by 2-byte subset of the full AES S-box table; second part of this >- * table is identical to first part but byte-swapped >- */ >+ >+/* 2-byte by 2-byte subset of the full AES S-box table; second part of this >+ * table is identical to first part but byte-swapped */ > static const u16 tkip_sbox[256] = > { > 0xC6A5, 0xF884, 0xEE99, 0xF68D, 0xFF0D, 0xD6BD, 0xDEB1, 0x9154, >@@ -59,11 +60,51 @@ static const u16 tkip_sbox[256] = > 0x82C3, 0x29B0, 0x5A77, 0x1E11, 0x7BCB, 0xA8FC, 0x6DD6, 0x2C3A, > }; > >-static u16 tkipS(u16 val) >+ >+static inline u16 Mk16(u8 x, u8 y) >+{ >+ return ((u16) x << 8) | (u16) y; >+} >+ >+ >+static inline u8 Hi8(u16 v) >+{ >+ return v >> 8; >+} >+ >+ >+static inline u8 Lo8(u16 v) >+{ >+ return v & 0xff; >+} >+ >+ >+static inline u16 Hi16(u32 v) > { >- return tkip_sbox[val & 0xff] ^ swab16(tkip_sbox[val >> 8]); >+ return v >> 16; > } > >+ >+static inline u16 Lo16(u32 v) >+{ >+ return v & 0xffff; >+} >+ >+ >+static inline u16 RotR1(u16 v) >+{ >+ return (v >> 1) | ((v & 0x0001) << 15); >+} >+ >+ >+static inline u16 tkip_S(u16 val) >+{ >+ u16 a = tkip_sbox[Hi8(val)]; >+ >+ return tkip_sbox[Lo8(val)] ^ Hi8(a) ^ (Lo8(a) << 8); >+} >+ >+ > static u8 *write_tkip_iv(u8 *pos, u16 iv16) > { > *pos++ = iv16 >> 8; >@@ -85,19 +126,19 @@ static void tkip_mixing_phase1(const u8 > int i, j; > u16 *p1k = ctx->p1k; > >- p1k[0] = tsc_IV32 & 0xFFFF; >- p1k[1] = tsc_IV32 >> 16; >- p1k[2] = get_unaligned_le16(ta + 0); >- p1k[3] = get_unaligned_le16(ta + 2); >- p1k[4] = get_unaligned_le16(ta + 4); >+ p1k[0] = Lo16(tsc_IV32); >+ p1k[1] = Hi16(tsc_IV32); >+ p1k[2] = Mk16(ta[1], ta[0]); >+ p1k[3] = Mk16(ta[3], ta[2]); >+ p1k[4] = Mk16(ta[5], ta[4]); > > for (i = 0; i < PHASE1_LOOP_COUNT; i++) { > j = 2 * (i & 1); >- p1k[0] += tkipS(p1k[4] ^ get_unaligned_le16(tk + 0 + j)); >- p1k[1] += tkipS(p1k[0] ^ get_unaligned_le16(tk + 4 + j)); >- p1k[2] += tkipS(p1k[1] ^ get_unaligned_le16(tk + 8 + j)); >- p1k[3] += tkipS(p1k[2] ^ get_unaligned_le16(tk + 12 + j)); >- p1k[4] += tkipS(p1k[3] ^ get_unaligned_le16(tk + 0 + j)) + i; >+ p1k[0] += tkip_S(p1k[4] ^ Mk16(tk[ 1 + j], tk[ 0 + j])); >+ p1k[1] += tkip_S(p1k[0] ^ Mk16(tk[ 5 + j], tk[ 4 + j])); >+ p1k[2] += tkip_S(p1k[1] ^ Mk16(tk[ 9 + j], tk[ 8 + j])); >+ p1k[3] += tkip_S(p1k[2] ^ Mk16(tk[13 + j], tk[12 + j])); >+ p1k[4] += tkip_S(p1k[3] ^ Mk16(tk[ 1 + j], tk[ 0 + j])) + i; > } > ctx->initialized = 1; > } >@@ -116,24 +157,26 @@ static void tkip_mixing_phase2(const u8 > ppk[4] = p1k[4]; > ppk[5] = p1k[4] + tsc_IV16; > >- ppk[0] += tkipS(ppk[5] ^ get_unaligned_le16(tk + 0)); >- ppk[1] += tkipS(ppk[0] ^ get_unaligned_le16(tk + 2)); >- ppk[2] += tkipS(ppk[1] ^ get_unaligned_le16(tk + 4)); >- ppk[3] += tkipS(ppk[2] ^ get_unaligned_le16(tk + 6)); >- ppk[4] += tkipS(ppk[3] ^ get_unaligned_le16(tk + 8)); >- ppk[5] += tkipS(ppk[4] ^ get_unaligned_le16(tk + 10)); >- ppk[0] += ror16(ppk[5] ^ get_unaligned_le16(tk + 12), 1); >- ppk[1] += ror16(ppk[0] ^ get_unaligned_le16(tk + 14), 1); >- ppk[2] += ror16(ppk[1], 1); >- ppk[3] += ror16(ppk[2], 1); >- ppk[4] += ror16(ppk[3], 1); >- ppk[5] += ror16(ppk[4], 1); >+ ppk[0] += tkip_S(ppk[5] ^ Mk16(tk[ 1], tk[ 0])); >+ ppk[1] += tkip_S(ppk[0] ^ Mk16(tk[ 3], tk[ 2])); >+ ppk[2] += tkip_S(ppk[1] ^ Mk16(tk[ 5], tk[ 4])); >+ ppk[3] += tkip_S(ppk[2] ^ Mk16(tk[ 7], tk[ 6])); >+ ppk[4] += tkip_S(ppk[3] ^ Mk16(tk[ 9], tk[ 8])); >+ ppk[5] += tkip_S(ppk[4] ^ Mk16(tk[11], tk[10])); >+ ppk[0] += RotR1(ppk[5] ^ Mk16(tk[13], tk[12])); >+ ppk[1] += RotR1(ppk[0] ^ Mk16(tk[15], tk[14])); >+ ppk[2] += RotR1(ppk[1]); >+ ppk[3] += RotR1(ppk[2]); >+ ppk[4] += RotR1(ppk[3]); >+ ppk[5] += RotR1(ppk[4]); > > rc4key = write_tkip_iv(rc4key, tsc_IV16); >- *rc4key++ = ((ppk[5] ^ get_unaligned_le16(tk)) >> 1) & 0xFF; >+ *rc4key++ = Lo8((ppk[5] ^ Mk16(tk[1], tk[0])) >> 1); > >- for (i = 0; i < 6; i++) >- put_unaligned_le16(ppk[i], rc4key + 2 * i); >+ for (i = 0; i < 6; i++) { >+ rc4key[0 + 2 * i] = Lo8(ppk[i]); >+ rc4key[1 + 2 * i] = Hi8(ppk[i]); >+ } > } > > /* Add TKIP IV and Ext. IV at @pos. @iv0, @iv1, and @iv2 are the first octets >@@ -143,8 +186,11 @@ u8 *ieee80211_tkip_add_iv(u8 *pos, struc > { > pos = write_tkip_iv(pos, iv16); > *pos++ = (key->conf.keyidx << 6) | (1 << 5) /* Ext IV */; >- put_unaligned_le32(key->u.tkip.tx.iv32, pos); >- return pos + 4; >+ *pos++ = key->u.tkip.tx.iv32 & 0xff; >+ *pos++ = (key->u.tkip.tx.iv32 >> 8) & 0xff; >+ *pos++ = (key->u.tkip.tx.iv32 >> 16) & 0xff; >+ *pos++ = (key->u.tkip.tx.iv32 >> 24) & 0xff; >+ return pos; > } > > void ieee80211_get_tkip_key(struct ieee80211_key_conf *keyconf, >@@ -162,7 +208,8 @@ void ieee80211_get_tkip_key(struct ieee8 > > data = (u8 *)hdr + ieee80211_hdrlen(hdr->frame_control); > iv16 = data[2] | (data[0] << 8); >- iv32 = get_unaligned_le32(&data[4]); >+ iv32 = data[4] | (data[5] << 8) | >+ (data[6] << 16) | (data[7] << 24); > > tk = &key->conf.key[NL80211_TKIP_DATA_OFFSET_ENCR_KEY]; > ctx = &key->u.tkip.tx; >@@ -217,6 +264,7 @@ void ieee80211_tkip_encrypt_data(struct > ieee80211_wep_encrypt_data(tfm, rc4key, 16, pos, payload_len); > } > >+ > /* Decrypt packet payload with TKIP using @key. @pos is a pointer to the > * beginning of the buffer containing IEEE 802.11 header payload, i.e., > * including IV, Ext. IV, real data, Michael MIC, ICV. @payload_len is the >@@ -238,7 +286,7 @@ int ieee80211_tkip_decrypt_data(struct c > > iv16 = (pos[0] << 8) | pos[2]; > keyid = pos[3]; >- iv32 = get_unaligned_le32(pos + 4); >+ iv32 = pos[4] | (pos[5] << 8) | (pos[6] << 16) | (pos[7] << 24); > pos += 8; > #ifdef CONFIG_MAC80211_TKIP_DEBUG > { >@@ -341,3 +389,5 @@ int ieee80211_tkip_decrypt_data(struct c > > return res; > } >+ >+ >diff -up linux-2.6.25.noarch/net/wireless/core.c.orig linux-2.6.25.noarch/net/wireless/core.c >--- linux-2.6.25.noarch/net/wireless/core.c.orig 2008-07-01 14:22:17.000000000 -0400 >+++ linux-2.6.25.noarch/net/wireless/core.c 2008-07-01 14:24:27.000000000 -0400 >@@ -167,13 +167,13 @@ int cfg80211_dev_rename(struct cfg80211_ > > /* Ignore nop renames */ > result = 0; >- if (strcmp(newname, dev_name(&rdev->wiphy.dev)) == 0) >+ if (strcmp(newname, rdev->wiphy.dev.bus_id) == 0) > goto out_unlock; > > /* Ensure another device does not already have this name. */ > list_for_each_entry(drv, &cfg80211_drv_list, list) { > result = -EINVAL; >- if (strcmp(newname, dev_name(&drv->wiphy.dev)) == 0) >+ if (strcmp(newname, drv->wiphy.dev.bus_id) == 0) > goto out_unlock; > } > >diff -up linux-2.6.25.noarch/net/wireless/radiotap.c.orig linux-2.6.25.noarch/net/wireless/radiotap.c >--- linux-2.6.25.noarch/net/wireless/radiotap.c.orig 2008-07-01 14:22:17.000000000 -0400 >+++ linux-2.6.25.noarch/net/wireless/radiotap.c 2008-07-01 14:24:27.000000000 -0400 >@@ -59,21 +59,23 @@ int ieee80211_radiotap_iterator_init( > return -EINVAL; > > /* sanity check for allowed length and radiotap length field */ >- if (max_length < get_unaligned_le16(&radiotap_header->it_len)) >+ if (max_length < le16_to_cpu(get_unaligned(&radiotap_header->it_len))) > return -EINVAL; > > iterator->rtheader = radiotap_header; >- iterator->max_length = get_unaligned_le16(&radiotap_header->it_len); >+ iterator->max_length = le16_to_cpu(get_unaligned( >+ &radiotap_header->it_len)); > iterator->arg_index = 0; >- iterator->bitmap_shifter = get_unaligned_le32(&radiotap_header->it_present); >+ iterator->bitmap_shifter = le32_to_cpu(get_unaligned( >+ &radiotap_header->it_present)); > iterator->arg = (u8 *)radiotap_header + sizeof(*radiotap_header); > iterator->this_arg = NULL; > > /* find payload start allowing for extended bitmap(s) */ > > if (unlikely(iterator->bitmap_shifter & (1<<IEEE80211_RADIOTAP_EXT))) { >- while (get_unaligned_le32(iterator->arg) & >- (1 << IEEE80211_RADIOTAP_EXT)) { >+ while (le32_to_cpu(get_unaligned((__le32 *)iterator->arg)) & >+ (1<<IEEE80211_RADIOTAP_EXT)) { > iterator->arg += sizeof(u32); > > /* >@@ -239,8 +241,8 @@ int ieee80211_radiotap_iterator_next( > if (iterator->bitmap_shifter & 1) { > /* b31 was set, there is more */ > /* move to next u32 bitmap */ >- iterator->bitmap_shifter = >- get_unaligned_le32(iterator->next_bitmap); >+ iterator->bitmap_shifter = le32_to_cpu( >+ get_unaligned(iterator->next_bitmap)); > iterator->next_bitmap++; > } else > /* no more bitmaps: end */ >diff -up linux-2.6.25.noarch/net/wireless/wext.c.orig linux-2.6.25.noarch/net/wireless/wext.c >--- linux-2.6.25.noarch/net/wireless/wext.c.orig 2008-07-01 14:22:17.000000000 -0400 >+++ linux-2.6.25.noarch/net/wireless/wext.c 2008-07-01 14:24:27.000000000 -0400 >@@ -1299,7 +1299,7 @@ static void rtmsg_iwinfo(struct net_devi > struct sk_buff *skb; > int err; > >- if (dev_net(dev) != &init_net) >+ if (dev->nd_net != &init_net) > return; > > skb = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_ATOMIC); >diff -up linux-2.6.25.noarch/net/socket.c.orig linux-2.6.25.noarch/net/socket.c >--- linux-2.6.25.noarch/net/socket.c.orig 2008-04-16 22:49:44.000000000 -0400 >+++ linux-2.6.25.noarch/net/socket.c 2008-06-30 14:05:20.000000000 -0400 >@@ -2215,7 +2215,7 @@ static long compat_sock_ioctl(struct fil > struct net *net; > > sk = sock->sk; >- net = sock_net(sk); >+ net = sk->sk_net; > > if (sock->ops->compat_ioctl) > ret = sock->ops->compat_ioctl(sock, cmd, arg);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 453390
:
310568
|
310569
|
310888
|
310926
|
311029
| 311030 |
312090