ext4: fixes block group number being set to a negative value

2008-01-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=2aa9fc4c405467f6afbbb2162ff8afaced47d99b
Commit: 2aa9fc4c405467f6afbbb2162ff8afaced47d99b
Parent: fd2d42912f9f09e5250cb3b024ee0625704e9cb7
Author: Avantika Mathur [EMAIL PROTECTED]
AuthorDate: Mon Jan 28 23:58:27 2008 -0500
Committer:  Theodore Ts'o [EMAIL PROTECTED]
CommitDate: Mon Jan 28 23:58:27 2008 -0500

ext4: fixes block group number being set to a negative value

This patch fixes various places where the group number is set to a negative
value.

Signed-off-by: Avantika Mathur [EMAIL PROTECTED]
Signed-off-by: Theodore Ts'o [EMAIL PROTECTED]
---
 fs/ext4/ialloc.c |  101 -
 1 files changed, 53 insertions(+), 48 deletions(-)

diff --git a/fs/ext4/ialloc.c b/fs/ext4/ialloc.c
index 64dea86..7b5cfa6 100644
--- a/fs/ext4/ialloc.c
+++ b/fs/ext4/ialloc.c
@@ -260,12 +260,14 @@ error_return:
  * For other inodes, search forward from the parent directory\'s block
  * group to find a free inode.
  */
-static ext4_group_t find_group_dir(struct super_block *sb, struct inode 
*parent)
+static int find_group_dir(struct super_block *sb, struct inode *parent,
+   ext4_group_t *best_group)
 {
ext4_group_t ngroups = EXT4_SB(sb)-s_groups_count;
unsigned int freei, avefreei;
struct ext4_group_desc *desc, *best_desc = NULL;
-   ext4_group_t group, best_group = -1;
+   ext4_group_t group;
+   int ret = -1;
 
freei = 
percpu_counter_read_positive(EXT4_SB(sb)-s_freeinodes_counter);
avefreei = freei / ngroups;
@@ -279,11 +281,12 @@ static ext4_group_t find_group_dir(struct super_block 
*sb, struct inode *parent)
if (!best_desc ||
(le16_to_cpu(desc-bg_free_blocks_count) 
 le16_to_cpu(best_desc-bg_free_blocks_count))) {
-   best_group = group;
+   *best_group = group;
best_desc = desc;
+   ret = 0;
}
}
-   return best_group;
+   return ret;
 }
 
 /*
@@ -314,8 +317,8 @@ static ext4_group_t find_group_dir(struct super_block *sb, 
struct inode *parent)
 #define INODE_COST 64
 #define BLOCK_COST 256
 
-static ext4_group_t find_group_orlov(struct super_block *sb,
- struct inode *parent)
+static int find_group_orlov(struct super_block *sb, struct inode *parent,
+   ext4_group_t *group)
 {
ext4_group_t parent_group = EXT4_I(parent)-i_block_group;
struct ext4_sb_info *sbi = EXT4_SB(sb);
@@ -328,7 +331,7 @@ static ext4_group_t find_group_orlov(struct super_block *sb,
unsigned int ndirs;
int max_debt, max_dirs, min_inodes;
ext4_grpblk_t min_blocks;
-   ext4_group_t group = -1, i;
+   ext4_group_t i;
struct ext4_group_desc *desc;
 
freei = percpu_counter_read_positive(sbi-s_freeinodes_counter);
@@ -341,13 +344,14 @@ static ext4_group_t find_group_orlov(struct super_block 
*sb,
if ((parent == sb-s_root-d_inode) ||
(EXT4_I(parent)-i_flags  EXT4_TOPDIR_FL)) {
int best_ndir = inodes_per_group;
-   ext4_group_t best_group = -1;
+   ext4_group_t grp;
+   int ret = -1;
 
-   get_random_bytes(group, sizeof(group));
-   parent_group = (unsigned)group % ngroups;
+   get_random_bytes(grp, sizeof(grp));
+   parent_group = (unsigned)grp % ngroups;
for (i = 0; i  ngroups; i++) {
-   group = (parent_group + i) % ngroups;
-   desc = ext4_get_group_desc (sb, group, NULL);
+   grp = (parent_group + i) % ngroups;
+   desc = ext4_get_group_desc(sb, grp, NULL);
if (!desc || !desc-bg_free_inodes_count)
continue;
if (le16_to_cpu(desc-bg_used_dirs_count) = best_ndir)
@@ -356,11 +360,12 @@ static ext4_group_t find_group_orlov(struct super_block 
*sb,
continue;
if (le16_to_cpu(desc-bg_free_blocks_count)  avefreeb)
continue;
-   best_group = group;
+   *group = grp;
+   ret = 0;
best_ndir = le16_to_cpu(desc-bg_used_dirs_count);
}
-   if (best_group = 0)
-   return best_group;
+   if (ret == 0)
+   return ret;
goto fallback;
}
 
@@ -381,8 +386,8 @@ static ext4_group_t find_group_orlov(struct super_block *sb,
max_debt = 1;
 
for (i = 0; i  ngroups; i++) {
-   group = (parent_group + i) % ngroups;
-   desc 

ext4 extents: remove unneeded casts

2008-01-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=bba907433b85ba2adae1bb3b6fd29b4e5f35c468
Commit: bba907433b85ba2adae1bb3b6fd29b4e5f35c468
Parent: 725d26d3f09ccb5bac4b4293096b985a312a0d67
Author: Eric Sandeen [EMAIL PROTECTED]
AuthorDate: Mon Jan 28 23:58:27 2008 -0500
Committer:  Theodore Ts'o [EMAIL PROTECTED]
CommitDate: Mon Jan 28 23:58:27 2008 -0500

ext4 extents: remove unneeded casts

There are many casts in extents.c which are not needed,
as the variables are already the type of the cast, or
are being promoted for no particular reason in printk's.

Signed-off-by: Eric Sandeen [EMAIL PROTECTED]
Signed-off-by: Mingming Cao [EMAIL PROTECTED]
---
 fs/ext4/extents.c |   49 ++---
 1 files changed, 22 insertions(+), 27 deletions(-)

diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index 19d8059..6853722 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -374,7 +374,7 @@ ext4_ext_binsearch_idx(struct inode *inode,
struct ext4_extent_idx *r, *l, *m;
 
 
-   ext_debug(binsearch for %lu(idx):  , (unsigned long)block);
+   ext_debug(binsearch for %u(idx):  , block);
 
l = EXT_FIRST_INDEX(eh) + 1;
r = EXT_LAST_INDEX(eh);
@@ -440,7 +440,7 @@ ext4_ext_binsearch(struct inode *inode,
return;
}
 
-   ext_debug(binsearch for %lu:  , (unsigned long)block);
+   ext_debug(binsearch for %u:  , block);
 
l = EXT_FIRST_EXTENT(eh) + 1;
r = EXT_LAST_EXTENT(eh);
@@ -766,7 +766,7 @@ static int ext4_ext_split(handle_t *handle, struct inode 
*inode,
while (k--) {
oldblock = newblock;
newblock = ablocks[--a];
-   bh = sb_getblk(inode-i_sb, (ext4_fsblk_t)newblock);
+   bh = sb_getblk(inode-i_sb, newblock);
if (!bh) {
err = -EIO;
goto cleanup;
@@ -786,9 +786,8 @@ static int ext4_ext_split(handle_t *handle, struct inode 
*inode,
fidx-ei_block = border;
ext4_idx_store_pblock(fidx, oldblock);
 
-   ext_debug(int.index at %d (block %llu): %lu - %llu\n, i,
-   newblock, (unsigned long) le32_to_cpu(border),
-   oldblock);
+   ext_debug(int.index at %d (block %llu): %u - %llu\n,
+   i, newblock, le32_to_cpu(border), oldblock);
/* copy indexes */
m = 0;
path[i].p_idx++;
@@ -1476,10 +1475,10 @@ ext4_ext_put_gap_in_cache(struct inode *inode, struct 
ext4_ext_path *path,
} else if (block  le32_to_cpu(ex-ee_block)) {
lblock = block;
len = le32_to_cpu(ex-ee_block) - block;
-   ext_debug(cache gap(before): %lu [%lu:%lu],
-   (unsigned long) block,
-   (unsigned long) le32_to_cpu(ex-ee_block),
-   (unsigned long) ext4_ext_get_actual_len(ex));
+   ext_debug(cache gap(before): %u [%u:%u],
+   block,
+   le32_to_cpu(ex-ee_block),
+ext4_ext_get_actual_len(ex));
} else if (block = le32_to_cpu(ex-ee_block)
+ ext4_ext_get_actual_len(ex)) {
ext4_lblk_t next;
@@ -1487,10 +1486,10 @@ ext4_ext_put_gap_in_cache(struct inode *inode, struct 
ext4_ext_path *path,
+ ext4_ext_get_actual_len(ex);
 
next = ext4_ext_next_allocated_block(path);
-   ext_debug(cache gap(after): [%lu:%lu] %lu,
-   (unsigned long) le32_to_cpu(ex-ee_block),
-   (unsigned long) ext4_ext_get_actual_len(ex),
-   (unsigned long) block);
+   ext_debug(cache gap(after): [%u:%u] %u,
+   le32_to_cpu(ex-ee_block),
+   ext4_ext_get_actual_len(ex),
+   block);
BUG_ON(next == lblock);
len = next - lblock;
} else {
@@ -1498,7 +1497,7 @@ ext4_ext_put_gap_in_cache(struct inode *inode, struct 
ext4_ext_path *path,
BUG();
}
 
-   ext_debug( - %lu:%lu\n, (unsigned long) lblock, len);
+   ext_debug( - %u:%lu\n, lblock, len);
ext4_ext_put_in_cache(inode, lblock, len, 0, EXT4_EXT_CACHE_GAP);
 }
 
@@ -1520,11 +1519,9 @@ ext4_ext_in_cache(struct inode *inode, ext4_lblk_t block,
ex-ee_block = cpu_to_le32(cex-ec_block);
ext4_ext_store_pblock(ex, cex-ec_start);
ex-ee_len = cpu_to_le16(cex-ec_len);
-   ext_debug(%lu cached by %lu:%lu:%llu\n,
-   (unsigned long) block,
-   (unsigned long) 

ext4: Avoid rec_len overflow with 64KB block size

2008-01-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=a72d7f834e1afa08421938d7eb06bd8e56b0e58c
Commit: a72d7f834e1afa08421938d7eb06bd8e56b0e58c
Parent: afc7cbca5bfd556c3e12d3acefbee5ab0cbd4670
Author: Jan Kara [EMAIL PROTECTED]
AuthorDate: Mon Jan 28 23:58:27 2008 -0500
Committer:  Theodore Ts'o [EMAIL PROTECTED]
CommitDate: Mon Jan 28 23:58:27 2008 -0500

ext4: Avoid rec_len overflow with 64KB block size

With 64KB blocksize, a directory entry can have size 64KB which does not fit
into 16 bits we have for entry lenght. So we store 0x instead and 
convert
value when read from / written to disk. The patch also converts some places
to use ext4_next_entry() when we are changing them anyway.

Signed-off-by: Jan Kara [EMAIL PROTECTED]
Signed-off-by: Mingming Cao [EMAIL PROTECTED]
---
 fs/ext4/dir.c   |   12 
 fs/ext4/namei.c |   77 ++
 include/linux/ext4_fs.h |   20 
 3 files changed, 63 insertions(+), 46 deletions(-)

diff --git a/fs/ext4/dir.c b/fs/ext4/dir.c
index f612bef..145a9c0 100644
--- a/fs/ext4/dir.c
+++ b/fs/ext4/dir.c
@@ -67,7 +67,7 @@ int ext4_check_dir_entry (const char * function, struct inode 
* dir,
  unsigned long offset)
 {
const char * error_msg = NULL;
-   const int rlen = le16_to_cpu(de-rec_len);
+   const int rlen = ext4_rec_len_from_disk(de-rec_len);
 
if (rlen  EXT4_DIR_REC_LEN(1))
error_msg = rec_len is smaller than minimal;
@@ -172,10 +172,10 @@ revalidate:
 * least that it is non-zero.  A
 * failure will be detected in the
 * dirent test below. */
-   if (le16_to_cpu(de-rec_len) 
-   EXT4_DIR_REC_LEN(1))
+   if (ext4_rec_len_from_disk(de-rec_len)
+EXT4_DIR_REC_LEN(1))
break;
-   i += le16_to_cpu(de-rec_len);
+   i += ext4_rec_len_from_disk(de-rec_len);
}
offset = i;
filp-f_pos = (filp-f_pos  ~(sb-s_blocksize - 1))
@@ -197,7 +197,7 @@ revalidate:
ret = stored;
goto out;
}
-   offset += le16_to_cpu(de-rec_len);
+   offset += ext4_rec_len_from_disk(de-rec_len);
if (le32_to_cpu(de-inode)) {
/* We might block in the next section
 * if the data destination is
@@ -219,7 +219,7 @@ revalidate:
goto revalidate;
stored ++;
}
-   filp-f_pos += le16_to_cpu(de-rec_len);
+   filp-f_pos += ext4_rec_len_from_disk(de-rec_len);
}
offset = 0;
brelse (bh);
diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c
index 94ee6f3..d9a3a2f 100644
--- a/fs/ext4/namei.c
+++ b/fs/ext4/namei.c
@@ -280,7 +280,7 @@ static struct stats dx_show_leaf(struct dx_hash_info 
*hinfo, struct ext4_dir_ent
space += EXT4_DIR_REC_LEN(de-name_len);
names++;
}
-   de = (struct ext4_dir_entry_2 *) ((char *) de + 
le16_to_cpu(de-rec_len));
+   de = ext4_next_entry(de);
}
printk((%i)\n, names);
return (struct stats) { names, space, 1 };
@@ -551,7 +551,8 @@ static int ext4_htree_next_block(struct inode *dir, __u32 
hash,
  */
 static inline struct ext4_dir_entry_2 *ext4_next_entry(struct ext4_dir_entry_2 
*p)
 {
-   return (struct ext4_dir_entry_2 *)((char*)p + le16_to_cpu(p-rec_len));
+   return (struct ext4_dir_entry_2 *)((char *)p +
+   ext4_rec_len_from_disk(p-rec_len));
 }
 
 /*
@@ -720,7 +721,7 @@ static int dx_make_map (struct ext4_dir_entry_2 *de, int 
size,
cond_resched();
}
/* XXX: do we need to check rec_len == 0 case? -Chris */
-   de = (struct ext4_dir_entry_2 *) ((char *) de + 
le16_to_cpu(de-rec_len));
+   de = ext4_next_entry(de);
}
return count;
 }
@@ -820,7 +821,7 @@ static inline int search_dirblock(struct buffer_head * bh,
return 1;
}
/* prevent looping on a bad block */
-   de_len = le16_to_cpu(de-rec_len);
+   de_len = ext4_rec_len_from_disk(de-rec_len);
if (de_len = 0)
return -1;
offset += de_len;
@@ -1128,7 +1129,7 @@ 

ocfs2: Fix userspace ABI breakage in sysfs

2008-01-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=6b11d8179d1c6e560edc02c40a53b65fde83bf3f
Commit: 6b11d8179d1c6e560edc02c40a53b65fde83bf3f
Parent: 8561b089afbaed2651591e5a4574fdca451d82f2
Author: Joel Becker [EMAIL PROTECTED]
AuthorDate: Mon Jan 28 18:52:04 2008 -0800
Committer:  Mark Fasheh [EMAIL PROTECTED]
CommitDate: Mon Jan 28 19:10:23 2008 -0800

ocfs2: Fix userspace ABI breakage in sysfs

The userspace ABI of ocfs2's internal cluster stack (o2cb) was broken by
commit c60b71787982cefcf9fa09aa281fa8c4c685d557 kset: convert ocfs2 to
use kset_create.  Specifically, the '/sys/o2cb' kset was moved to
'/sys/fs/o2cb'.  This breaks all ocfs2 tools and renders the
filesystem unmountable.

This fix moves '/sys/o2cb' back where it belongs.

Signed-off-by: Joel Becker [EMAIL PROTECTED]
Signed-off-by: Mark Fasheh [EMAIL PROTECTED]
---
 fs/ocfs2/cluster/sys.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/ocfs2/cluster/sys.c b/fs/ocfs2/cluster/sys.c
index a4b0773..0c095ce 100644
--- a/fs/ocfs2/cluster/sys.c
+++ b/fs/ocfs2/cluster/sys.c
@@ -64,7 +64,7 @@ int o2cb_sys_init(void)
 {
int ret;
 
-   o2cb_kset = kset_create_and_add(o2cb, NULL, fs_kobj);
+   o2cb_kset = kset_create_and_add(o2cb, NULL, NULL);
if (!o2cb_kset)
return -ENOMEM;
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


libertas: endianness fixes

2008-01-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=c2df2efe96742b78454acdffe6d278ae334fc838
Commit: c2df2efe96742b78454acdffe6d278ae334fc838
Parent: 1723047d6742cc172d5c0f1a5245deaee67ff331
Author: Holger Schurig [EMAIL PROTECTED]
AuthorDate: Fri Dec 7 15:30:44 2007 +
Committer:  David S. Miller [EMAIL PROTECTED]
CommitDate: Mon Jan 28 15:06:13 2008 -0800

libertas: endianness fixes

Recently I found that that sparse by default doesn't endianness
checks. So I changed my compilation habit to be

make modules C=1 SUBDIRS=drivers/net/wireless/libertas
CHECKFLAGS=-D__CHECK_ENDIAN__

so that I get the little-endian checks from sparse as well. That
showed up a good bunch of problems.

Signed-off-by: Holger Schurig [EMAIL PROTECTED]
Signed-off-by: David Woodhouse [EMAIL PROTECTED]
Signed-off-by: John W. Linville [EMAIL PROTECTED]
---
 drivers/net/wireless/libertas/11d.c |2 +-
 drivers/net/wireless/libertas/cmd.c |   28 ++--
 drivers/net/wireless/libertas/cmdresp.c |2 +-
 drivers/net/wireless/libertas/hostcmd.h |8 
 drivers/net/wireless/libertas/if_sdio.c |2 +-
 drivers/net/wireless/libertas/if_usb.c  |4 ++--
 6 files changed, 23 insertions(+), 23 deletions(-)

diff --git a/drivers/net/wireless/libertas/11d.c 
b/drivers/net/wireless/libertas/11d.c
index 377dcb5..013965d 100644
--- a/drivers/net/wireless/libertas/11d.c
+++ b/drivers/net/wireless/libertas/11d.c
@@ -518,7 +518,7 @@ int lbs_cmd_802_11d_domain_info(struct lbs_private *priv,
cmd-size =
cpu_to_le16(sizeof(pdomaininfo-action) + S_DS_GEN);
lbs_deb_hex(LBS_DEB_11D, 802_11D_DOMAIN_INFO, (u8 *) cmd,
-   (int)(cmd-size));
+   le16_to_cpu(cmd-size));
goto done;
}
 
diff --git a/drivers/net/wireless/libertas/cmd.c 
b/drivers/net/wireless/libertas/cmd.c
index ebfcb7b..cf1ab8a 100644
--- a/drivers/net/wireless/libertas/cmd.c
+++ b/drivers/net/wireless/libertas/cmd.c
@@ -431,7 +431,7 @@ static int lbs_cmd_802_11_snmp_mib(struct lbs_private *priv,
u8 mode = (u8) (size_t) pdata_buf;
pSNMPMIB-querytype = cpu_to_le16(CMD_ACT_SET);
pSNMPMIB-oid = cpu_to_le16((u16) DESIRED_BSSTYPE_I);
-   pSNMPMIB-bufsize = sizeof(u8);
+   pSNMPMIB-bufsize = cpu_to_le16(sizeof(u8));
if (mode == IW_MODE_ADHOC) {
ucTemp = SNMP_MIB_VALUE_ADHOC;
} else {
@@ -451,8 +451,8 @@ static int lbs_cmd_802_11_snmp_mib(struct lbs_private *priv,
pSNMPMIB-oid = cpu_to_le16((u16) DOT11D_I);
 
if (cmd_action == CMD_ACT_SET) {
-   pSNMPMIB-querytype = CMD_ACT_SET;
-   pSNMPMIB-bufsize = sizeof(u16);
+   pSNMPMIB-querytype = cpu_to_le16(CMD_ACT_SET);
+   pSNMPMIB-bufsize = cpu_to_le16(sizeof(u16));
ulTemp = *(u32 *)pdata_buf;
*((__le16 *)(pSNMPMIB-value)) =
cpu_to_le16((u16) ulTemp);
@@ -484,7 +484,7 @@ static int lbs_cmd_802_11_snmp_mib(struct lbs_private *priv,
{
 
u32 ulTemp;
-   pSNMPMIB-oid = le16_to_cpu((u16) RTSTHRESH_I);
+   pSNMPMIB-oid = cpu_to_le16(RTSTHRESH_I);
 
if (cmd_action == CMD_ACT_GET) {
pSNMPMIB-querytype = cpu_to_le16(CMD_ACT_GET);
@@ -759,7 +759,7 @@ static int lbs_cmd_reg_access(struct lbs_private *priv,
 
offval = (struct lbs_offset_value *)pdata_buf;
 
-   switch (cmdptr-command) {
+   switch (le16_to_cpu(cmdptr-command)) {
case CMD_MAC_REG_ACCESS:
{
struct cmd_ds_mac_reg_access *macreg;
@@ -999,7 +999,7 @@ void lbs_queue_cmd(struct lbs_adapter *adapter,
}
 
/* Exit_PS command needs to be queued in the header always. */
-   if (cmdptr-command == CMD_802_11_PS_MODE) {
+   if (le16_to_cpu(cmdptr-command) == CMD_802_11_PS_MODE) {
struct cmd_ds_802_11_ps_mode *psm = cmdptr-params.psmode;
if (psm-action == cpu_to_le16(CMD_SUBCMD_EXIT_PS)) {
if (adapter-psstate != PS_STATE_FULL_POWER)
@@ -1062,15 +1062,14 @@ static int DownloadcommandToStation(struct lbs_private 
*priv,
adapter-cur_cmd_retcode = 0;
spin_unlock_irqrestore(adapter-driver_lock, flags);
 
-   cmdsize = cmdptr-size;
-   command = cpu_to_le16(cmdptr-command);
+   cmdsize = le16_to_cpu(cmdptr-size);
+   command = le16_to_cpu(cmdptr-command);
 
lbs_deb_host(DNLD_CMD: command 0x%04x, size %d, jiffies %lu\n,
-   command, 

[NETNS]: Pass correct namespace in fib_validate_source.

2008-01-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=5b707aaae4ca7b7204eb4a472721c84866d85f0f
Commit: 5b707aaae4ca7b7204eb4a472721c84866d85f0f
Parent: 7fee0ca23711ce1a6b13d3ab78915809a72a59ec
Author: Denis V. Lunev [EMAIL PROTECTED]
AuthorDate: Mon Jan 21 17:33:15 2008 -0800
Committer:  David S. Miller [EMAIL PROTECTED]
CommitDate: Mon Jan 28 15:10:21 2008 -0800

[NETNS]: Pass correct namespace in fib_validate_source.

Correct network namespace is available inside fib_validate_source. It
can be obtained from the device passed in. The device is not NULL as
in_device is obtained from it just above.

Signed-off-by: Denis V. Lunev [EMAIL PROTECTED]
Signed-off-by: David S. Miller [EMAIL PROTECTED]
---
 net/ipv4/fib_frontend.c |6 --
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c
index e056154..6761639 100644
--- a/net/ipv4/fib_frontend.c
+++ b/net/ipv4/fib_frontend.c
@@ -228,6 +228,7 @@ int fib_validate_source(__be32 src, __be32 dst, u8 tos, int 
oif,
struct fib_result res;
int no_addr, rpf;
int ret;
+   struct net *net;
 
no_addr = rpf = 0;
rcu_read_lock();
@@ -241,7 +242,8 @@ int fib_validate_source(__be32 src, __be32 dst, u8 tos, int 
oif,
if (in_dev == NULL)
goto e_inval;
 
-   if (fib_lookup(init_net, fl, res))
+   net = dev-nd_net;
+   if (fib_lookup(net, fl, res))
goto last_resort;
if (res.type != RTN_UNICAST)
goto e_inval_res;
@@ -265,7 +267,7 @@ int fib_validate_source(__be32 src, __be32 dst, u8 tos, int 
oif,
fl.oif = dev-ifindex;
 
ret = 0;
-   if (fib_lookup(init_net, fl, res) == 0) {
+   if (fib_lookup(net, fl, res) == 0) {
if (res.type == RTN_UNICAST) {
*spec_dst = FIB_RES_PREFSRC(res);
ret = FIB_RES_NH(res).nh_scope = RT_SCOPE_HOST;
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[IPV6] UDP,UDPLITE: Sparse: {__udp6_lib,udp,udplite}_err() are of void.

2008-01-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=77d0d350e96c9453be255d8eff8dc97555710b17
Commit: 77d0d350e96c9453be255d8eff8dc97555710b17
Parent: fc80be87dca8968fa087aae81544ba3f86afdd50
Author: YOSHIFUJI Hideaki [EMAIL PROTECTED]
AuthorDate: Tue Jan 22 17:09:55 2008 +0900
Committer:  David S. Miller [EMAIL PROTECTED]
CommitDate: Mon Jan 28 15:10:25 2008 -0800

[IPV6] UDP,UDPLITE: Sparse: {__udp6_lib,udp,udplite}_err() are of void.

Fix following sparse warnings:
| net/ipv6/udp.c:262:2: warning: returning void-valued expression
| net/ipv6/udplite.c:29:2: warning: returning void-valued expression

Signed-off-by: YOSHIFUJI Hideaki [EMAIL PROTECTED]
---
 net/ipv6/udp.c |2 +-
 net/ipv6/udplite.c |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c
index bf58aca..bd4b9df 100644
--- a/net/ipv6/udp.c
+++ b/net/ipv6/udp.c
@@ -259,7 +259,7 @@ static __inline__ void udpv6_err(struct sk_buff *skb,
 struct inet6_skb_parm *opt, int type,
 int code, int offset, __be32 info )
 {
-   return __udp6_lib_err(skb, opt, type, code, offset, info, udp_hash);
+   __udp6_lib_err(skb, opt, type, code, offset, info, udp_hash);
 }
 
 int udpv6_queue_rcv_skb(struct sock * sk, struct sk_buff *skb)
diff --git a/net/ipv6/udplite.c b/net/ipv6/udplite.c
index 39f0705..87d4202 100644
--- a/net/ipv6/udplite.c
+++ b/net/ipv6/udplite.c
@@ -26,7 +26,7 @@ static void udplitev6_err(struct sk_buff *skb,
  struct inet6_skb_parm *opt,
  int type, int code, int offset, __be32 info)
 {
-   return __udp6_lib_err(skb, opt, type, code, offset, info, udplite_hash);
+   __udp6_lib_err(skb, opt, type, code, offset, info, udplite_hash);
 }
 
 static struct inet6_protocol udplitev6_protocol = {
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[NET_SCHED]: sch_ingress: remove excessive debugging

2008-01-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=a47812211bb38c6754a5a6a952ab406e711cc6e0
Commit: a47812211bb38c6754a5a6a952ab406e711cc6e0
Parent: 58f4df423ee3e7ee33022d84bbd69561b03344a9
Author: Patrick McHardy [EMAIL PROTECTED]
AuthorDate: Mon Jan 21 00:11:21 2008 -0800
Committer:  David S. Miller [EMAIL PROTECTED]
CommitDate: Mon Jan 28 15:08:18 2008 -0800

[NET_SCHED]: sch_ingress: remove excessive debugging

Remove excessive debugging statements and some future use stuff.

Signed-off-by: Patrick McHardy [EMAIL PROTECTED]
Acked-by: Jamal Hadi Salim [EMAIL PROTECTED]
Signed-off-by: David S. Miller [EMAIL PROTECTED]
---
 net/sched/sch_ingress.c |   79 ++-
 1 files changed, 3 insertions(+), 76 deletions(-)

diff --git a/net/sched/sch_ingress.c b/net/sched/sch_ingress.c
index 4880d44..bdda28d 100644
--- a/net/sched/sch_ingress.c
+++ b/net/sched/sch_ingress.c
@@ -19,20 +19,6 @@
 #include net/pkt_sched.h
 
 
-#undef DEBUG_INGRESS
-
-#ifdef DEBUG_INGRESS  /* control */
-#define DPRINTK(format, args...) printk(KERN_DEBUG format,##args)
-#else
-#define DPRINTK(format, args...)
-#endif
-
-#if 0  /* data */
-#define D2PRINTK(format, args...) printk(KERN_DEBUG format,##args)
-#else
-#define D2PRINTK(format, args...)
-#endif
-
 #define PRIV(sch) qdisc_priv(sch)
 
 /* Thanks to Doron Oz for this hack */
@@ -52,13 +38,6 @@ struct ingress_qdisc_data {
 static int ingress_graft(struct Qdisc *sch, unsigned long arg,
 struct Qdisc *new, struct Qdisc **old)
 {
-#ifdef DEBUG_INGRESS
-   struct ingress_qdisc_data *p = PRIV(sch);
-#endif
-
-   DPRINTK(ingress_graft(sch %p,[qdisc %p],new %p,old %p)\n,
-   sch, p, new, old);
-   DPRINTK(\n ingress_graft: You cannot add qdiscs to classes);
return 1;
 }
 
@@ -69,11 +48,6 @@ static struct Qdisc *ingress_leaf(struct Qdisc *sch, 
unsigned long arg)
 
 static unsigned long ingress_get(struct Qdisc *sch, u32 classid)
 {
-#ifdef DEBUG_INGRESS
-   struct ingress_qdisc_data *p = PRIV(sch);
-#endif
-   DPRINTK(ingress_get(sch %p,[qdisc %p],classid %x)\n,
-   sch, p, classid);
return TC_H_MIN(classid) + 1;
 }
 
@@ -90,22 +64,12 @@ static void ingress_put(struct Qdisc *sch, unsigned long cl)
 static int ingress_change(struct Qdisc *sch, u32 classid, u32 parent,
  struct rtattr **tca, unsigned long *arg)
 {
-#ifdef DEBUG_INGRESS
-   struct ingress_qdisc_data *p = PRIV(sch);
-#endif
-   DPRINTK(ingress_change(sch %p,[qdisc %p],classid %x,parent %x),
-   arg 0x%lx\n, sch, p, classid, parent, *arg);
-   DPRINTK(No effect. sch_ingress doesn't maintain classes at the 
moment);
return 0;
 }
 
 static void ingress_walk(struct Qdisc *sch, struct qdisc_walker *walker)
 {
-#ifdef DEBUG_INGRESS
-   struct ingress_qdisc_data *p = PRIV(sch);
-#endif
-   DPRINTK(ingress_walk(sch %p,[qdisc %p],walker %p)\n, sch, p, walker);
-   DPRINTK(No effect. sch_ingress doesn't maintain classes at the 
moment);
+   return;
 }
 
 static struct tcf_proto **ingress_find_tcf(struct Qdisc *sch, unsigned long cl)
@@ -123,9 +87,8 @@ static int ingress_enqueue(struct sk_buff *skb, struct Qdisc 
*sch)
struct tcf_result res;
int result;
 
-   D2PRINTK(ingress_enqueue(skb %p,sch %p,[qdisc %p])\n, skb, sch, p);
result = tc_classify(skb, p-filter_list, res);
-   D2PRINTK(result %d class 0x%04x\n, result, res.classid);
+
/*
 * Unlike normal enqueue functions, ingress_enqueue returns a
 * firewall FW_* code.
@@ -150,7 +113,6 @@ static int ingress_enqueue(struct sk_buff *skb, struct 
Qdisc *sch)
break;
}
 #else
-   D2PRINTK(Overriding result to ACCEPT\n);
result = NF_ACCEPT;
sch-bstats.packets++;
sch-bstats.bytes += skb-len;
@@ -161,28 +123,16 @@ static int ingress_enqueue(struct sk_buff *skb, struct 
Qdisc *sch)
 
 static struct sk_buff *ingress_dequeue(struct Qdisc *sch)
 {
-/*
-   struct ingress_qdisc_data *p = PRIV(sch);
-   D2PRINTK(ingress_dequeue(sch %p,[qdisc %p])\n,sch,PRIV(p));
-*/
return NULL;
 }
 
 static int ingress_requeue(struct sk_buff *skb, struct Qdisc *sch)
 {
-/*
-   struct ingress_qdisc_data *p = PRIV(sch);
-   D2PRINTK(ingress_requeue(skb %p,sch %p,[qdisc %p])\n,skb,sch,PRIV(p));
-*/
return 0;
 }
 
 static unsigned int ingress_drop(struct Qdisc *sch)
 {
-#ifdef DEBUG_INGRESS
-   struct ingress_qdisc_data *p = PRIV(sch);
-#endif
-   DPRINTK(ingress_drop(sch %p,[qdisc %p])\n, sch, p);
return 0;
 }
 
@@ -198,11 +148,6 @@ static unsigned int ing_hook(unsigned int hook, struct 
sk_buff *skb,
struct net_device *dev = skb-dev;
int fwres = NF_ACCEPT;
 
-   DPRINTK(ing_hook: skb %s dev=%s len=%u\n,
-   skb-sk ? (owned) : (unowned),
-   skb-dev 

[VLAN]: Clean up vlan_hdr/vlan_ethhdr structs

2008-01-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=740c15d0dd281c0cbe1a9ab1abc4f332e0df29bc
Commit: 740c15d0dd281c0cbe1a9ab1abc4f332e0df29bc
Parent: 476bcea67f9a1ca6f2c0028e75fb2129272c8398
Author: Patrick McHardy [EMAIL PROTECTED]
AuthorDate: Mon Jan 21 00:18:53 2008 -0800
Committer:  David S. Miller [EMAIL PROTECTED]
CommitDate: Mon Jan 28 15:08:24 2008 -0800

[VLAN]: Clean up vlan_hdr/vlan_ethhdr structs

Fix 3 space indentation and some overly long lines by moving the
comments to a kdoc structure description.

Signed-off-by: Patrick McHardy [EMAIL PROTECTED]
Signed-off-by: David S. Miller [EMAIL PROTECTED]
---
 include/linux/if_vlan.h |   33 +++--
 1 files changed, 23 insertions(+), 10 deletions(-)

diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h
index a268051..a1b0066 100644
--- a/include/linux/if_vlan.h
+++ b/include/linux/if_vlan.h
@@ -34,12 +34,30 @@ struct hlist_node;
 #define VLAN_ETH_DATA_LEN  1500/* Max. octets in payload*/
 #define VLAN_ETH_FRAME_LEN 1518/* Max. octets in frame sans FCS */
 
+/*
+ * struct vlan_hdr - vlan header
+ * @h_vlan_TCI: priority and VLAN ID
+ * @h_vlan_encapsulated_proto: packet type ID or len
+ */
+struct vlan_hdr {
+   __be16  h_vlan_TCI;
+   __be16  h_vlan_encapsulated_proto;
+};
+
+/**
+ * struct vlan_ethhdr - vlan ethernet header (ethhdr + vlan_hdr)
+ * @h_dest: destination ethernet address
+ * @h_source: source ethernet address
+ * @h_vlan_proto: ethernet protocol (always 0x8100)
+ * @h_vlan_TCI: priority and VLAN ID
+ * @h_vlan_encapsulated_proto: packet type ID or len
+ */
 struct vlan_ethhdr {
-   unsigned char   h_dest[ETH_ALEN];  /* destination eth addr  
*/
-   unsigned char   h_source[ETH_ALEN];/* source ether addr */
-   __be16   h_vlan_proto;  /* Should always be 0x8100 
*/
-   __be16   h_vlan_TCI;/* Encapsulates priority 
and VLAN ID */
-   __be16  h_vlan_encapsulated_proto; /* packet type ID field (or 
len) */
+   unsigned char   h_dest[ETH_ALEN];
+   unsigned char   h_source[ETH_ALEN];
+   __be16  h_vlan_proto;
+   __be16  h_vlan_TCI;
+   __be16  h_vlan_encapsulated_proto;
 };
 
 #include linux/skbuff.h
@@ -49,11 +67,6 @@ static inline struct vlan_ethhdr *vlan_eth_hdr(const struct 
sk_buff *skb)
return (struct vlan_ethhdr *)skb_mac_header(skb);
 }
 
-struct vlan_hdr {
-   __be16   h_vlan_TCI;/* Encapsulates priority 
and VLAN ID */
-   __be16   h_vlan_encapsulated_proto; /* packet type ID field (or 
len) */
-};
-
 #define VLAN_VID_MASK  0xfff
 
 /* found in socket.c */
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[IPV4] fib_trie: style cleanup

2008-01-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=a07f5f508a4d9728c8e57d7f66294bf5b254ff7f
Commit: a07f5f508a4d9728c8e57d7f66294bf5b254ff7f
Parent: bc3c8c1e02ae89668239742fd592f21e1998fa46
Author: Stephen Hemminger [EMAIL PROTECTED]
AuthorDate: Tue Jan 22 21:53:36 2008 -0800
Committer:  David S. Miller [EMAIL PROTECTED]
CommitDate: Mon Jan 28 15:10:56 2008 -0800

[IPV4] fib_trie: style cleanup

Style cleanups:
  * make check_leaf return -1 or plen, rather than by reference
  * Get rid of #ifdef that is always set
  * split out embedded function calls in if statements.
  * checkpatch warnings

Signed-off-by: Stephen Hemminger [EMAIL PROTECTED]
Signed-off-by: David S. Miller [EMAIL PROTECTED]
---
 net/ipv4/fib_trie.c |  237 ++
 1 files changed, 142 insertions(+), 95 deletions(-)

diff --git a/net/ipv4/fib_trie.c b/net/ipv4/fib_trie.c
index 9291e7c..899210b 100644
--- a/net/ipv4/fib_trie.c
+++ b/net/ipv4/fib_trie.c
@@ -155,7 +155,8 @@ struct trie {
 };
 
 static void put_child(struct trie *t, struct tnode *tn, int i, struct node *n);
-static void tnode_put_child_reorg(struct tnode *tn, int i, struct node *n, int 
wasfull);
+static void tnode_put_child_reorg(struct tnode *tn, int i, struct node *n,
+ int wasfull);
 static struct node *resize(struct trie *t, struct tnode *tn);
 static struct tnode *inflate(struct trie *t, struct tnode *tn);
 static struct tnode *halve(struct trie *t, struct tnode *tn);
@@ -395,7 +396,7 @@ static struct leaf_info *leaf_info_new(int plen)
return li;
 }
 
-static struct tnode* tnode_new(t_key key, int pos, int bits)
+static struct tnode *tnode_new(t_key key, int pos, int bits)
 {
size_t sz = sizeof(struct tnode) + (sizeof(struct node *)  bits);
struct tnode *tn = tnode_alloc(sz);
@@ -427,7 +428,8 @@ static inline int tnode_full(const struct tnode *tn, const 
struct node *n)
return ((struct tnode *) n)-pos == tn-pos + tn-bits;
 }
 
-static inline void put_child(struct trie *t, struct tnode *tn, int i, struct 
node *n)
+static inline void put_child(struct trie *t, struct tnode *tn, int i,
+struct node *n)
 {
tnode_put_child_reorg(tn, i, n, -1);
 }
@@ -437,7 +439,8 @@ static inline void put_child(struct trie *t, struct tnode 
*tn, int i, struct nod
   * Update the value of full_children and empty_children.
   */
 
-static void tnode_put_child_reorg(struct tnode *tn, int i, struct node *n, int 
wasfull)
+static void tnode_put_child_reorg(struct tnode *tn, int i, struct node *n,
+ int wasfull)
 {
struct node *chi = tn-child[i];
int isfull;
@@ -577,11 +580,13 @@ static struct node *resize(struct trie *t, struct tnode 
*tn)
err = 0;
max_resize = 10;
while ((tn-full_children  0   max_resize-- 
-  50 * (tn-full_children + tnode_child_length(tn) - 
tn-empty_children) =
-   inflate_threshold_use * 
tnode_child_length(tn))) {
+   50 * (tn-full_children + tnode_child_length(tn)
+ - tn-empty_children)
+   = inflate_threshold_use * tnode_child_length(tn))) {
 
old_tn = tn;
tn = inflate(t, tn);
+
if (IS_ERR(tn)) {
tn = old_tn;
 #ifdef CONFIG_IP_FIB_TRIE_STATS
@@ -593,11 +598,13 @@ static struct node *resize(struct trie *t, struct tnode 
*tn)
 
if (max_resize  0) {
if (!tn-parent)
-   printk(KERN_WARNING Fix inflate_threshold_root. Now=%d 
size=%d bits\n,
-  inflate_threshold_root, tn-bits);
+   pr_warning(Fix inflate_threshold_root.
+   Now=%d size=%d bits\n,
+  inflate_threshold_root, tn-bits);
else
-   printk(KERN_WARNING Fix inflate_threshold. Now=%d 
size=%d bits\n,
-  inflate_threshold, tn-bits);
+   pr_warning(Fix inflate_threshold.
+   Now=%d size=%d bits\n,
+  inflate_threshold, tn-bits);
}
 
check_tnode(tn);
@@ -634,11 +641,13 @@ static struct node *resize(struct trie *t, struct tnode 
*tn)
 
if (max_resize  0) {
if (!tn-parent)
-   printk(KERN_WARNING Fix halve_threshold_root. Now=%d 
size=%d bits\n,
-  halve_threshold_root, tn-bits);
+   pr_warning(Fix halve_threshold_root.
+   Now=%d size=%d bits\n,
+  halve_threshold_root, tn-bits);
else
-   printk(KERN_WARNING Fix halve_threshold. Now=%d 
size=%d 

[IPV4] fib_trie: use hash list

2008-01-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=1328042e268c936189f15eba5bd9a5a4605a8581
Commit: 1328042e268c936189f15eba5bd9a5a4605a8581
Parent: 936722922f6d2366378de606a40c14f96915474d
Author: Stephen Hemminger [EMAIL PROTECTED]
AuthorDate: Tue Jan 22 21:54:37 2008 -0800
Committer:  David S. Miller [EMAIL PROTECTED]
CommitDate: Mon Jan 28 15:10:58 2008 -0800

[IPV4] fib_trie: use hash list

The code to dump can use the existing hash chain rather than doing
repeated lookup.

Signed-off-by: Stephen Hemminger [EMAIL PROTECTED]
Signed-off-by: David S. Miller [EMAIL PROTECTED]
---
 net/ipv4/fib_trie.c |   49 -
 1 files changed, 24 insertions(+), 25 deletions(-)

diff --git a/net/ipv4/fib_trie.c b/net/ipv4/fib_trie.c
index 1a9231f..c19d685 100644
--- a/net/ipv4/fib_trie.c
+++ b/net/ipv4/fib_trie.c
@@ -2399,31 +2399,30 @@ static int fib_trie_seq_show(struct seq_file *seq, void 
*v)
 
} else {
struct leaf *l = (struct leaf *) n;
-   int i;
+   struct leaf_info *li;
+   struct hlist_node *node;
+
__be32 val = htonl(l-key);
 
seq_indent(seq, iter-depth);
seq_printf(seq,   |-- %d.%d.%d.%d\n, NIPQUAD(val));
-   for (i = 32; i = 0; i--) {
-   struct leaf_info *li = find_leaf_info(l, i);
-
-   if (li) {
-   struct fib_alias *fa;
-
-   list_for_each_entry_rcu(fa, li-falh, fa_list) 
{
-   char buf1[32], buf2[32];
-
-   seq_indent(seq, iter-depth+1);
-   seq_printf(seq,   /%d %s %s, i,
-  rtn_scope(buf1, sizeof(buf1),
-fa-fa_scope),
-  rtn_type(buf2, sizeof(buf2),
-fa-fa_type));
-   if (fa-fa_tos)
-   seq_printf(seq, tos =%d\n,
-  fa-fa_tos);
-   seq_putc(seq, '\n');
-   }
+
+   hlist_for_each_entry_rcu(li, node, l-list, hlist) {
+   struct fib_alias *fa;
+
+   list_for_each_entry_rcu(fa, li-falh, fa_list) {
+   char buf1[32], buf2[32];
+
+   seq_indent(seq, iter-depth+1);
+   seq_printf(seq,   /%d %s %s, li-plen,
+  rtn_scope(buf1, sizeof(buf1),
+fa-fa_scope),
+  rtn_type(buf2, sizeof(buf2),
+   fa-fa_type));
+   if (fa-fa_tos)
+   seq_printf(seq, tos =%d\n,
+  fa-fa_tos);
+   seq_putc(seq, '\n');
}
}
}
@@ -2477,8 +2476,8 @@ static int fib_route_seq_show(struct seq_file *seq, void 
*v)
 {
const struct fib_trie_iter *iter = seq-private;
struct leaf *l = v;
-   int i;
-   char bf[128];
+   struct leaf_info *li;
+   struct hlist_node *node;
 
if (v == SEQ_START_TOKEN) {
seq_printf(seq, %-127s\n, Iface\tDestination\tGateway 
@@ -2493,8 +2492,7 @@ static int fib_route_seq_show(struct seq_file *seq, void 
*v)
if (IS_TNODE(l))
return 0;
 
-   for (i = 32; i = 0; i--) {
-   struct leaf_info *li = find_leaf_info(l, i);
+   hlist_for_each_entry_rcu(li, node, l-list, hlist) {
struct fib_alias *fa;
__be32 mask, prefix;
 
@@ -2507,6 +2505,7 @@ static int fib_route_seq_show(struct seq_file *seq, void 
*v)
list_for_each_entry_rcu(fa, li-falh, fa_list) {
const struct fib_info *fi = fa-fa_info;
unsigned flags = fib_flag_trans(fa-fa_type, mask, fi);
+   char bf[128];
 
if (fa-fa_type == RTN_BROADCAST
|| fa-fa_type == RTN_MULTICAST)
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


ipw2200 fix: struct ieee80211_radiotap_header is little-endian

2008-01-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=743b84d2fc87cc19ca1c1cd2a821225caba862b0
Commit: 743b84d2fc87cc19ca1c1cd2a821225caba862b0
Parent: 7698d6977a62bbc6ed3b9d0d0230f2213a3b2f9d
Author: Al Viro [EMAIL PROTECTED]
AuthorDate: Thu Dec 27 01:43:16 2007 -0500
Committer:  David S. Miller [EMAIL PROTECTED]
CommitDate: Mon Jan 28 15:08:56 2008 -0800

ipw2200 fix: struct ieee80211_radiotap_header is little-endian

some places in driver forget conversions

Signed-off-by: Al Viro [EMAIL PROTECTED]
Signed-off-by: John W. Linville [EMAIL PROTECTED]
---
 drivers/net/wireless/ipw2200.c |   18 +-
 1 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/net/wireless/ipw2200.c b/drivers/net/wireless/ipw2200.c
index 97a6ff5..5f4d39c 100644
--- a/drivers/net/wireless/ipw2200.c
+++ b/drivers/net/wireless/ipw2200.c
@@ -7759,11 +7759,11 @@ static void ipw_handle_data_packet_monitor(struct 
ipw_priv *priv,
 
ipw_rt-rt_hdr.it_version = PKTHDR_RADIOTAP_VERSION;
ipw_rt-rt_hdr.it_pad = 0;  /* always good to zero */
-   ipw_rt-rt_hdr.it_len = sizeof(struct ipw_rt_hdr);  /* total 
header+data */
+   ipw_rt-rt_hdr.it_len = cpu_to_le16(sizeof(struct ipw_rt_hdr)); /* 
total header+data */
 
/* Big bitfield of all the fields we provide in radiotap */
-   ipw_rt-rt_hdr.it_present =
-   ((1  IEEE80211_RADIOTAP_TSFT) |
+   ipw_rt-rt_hdr.it_present = cpu_to_le32(
+(1  IEEE80211_RADIOTAP_TSFT) |
 (1  IEEE80211_RADIOTAP_FLAGS) |
 (1  IEEE80211_RADIOTAP_RATE) |
 (1  IEEE80211_RADIOTAP_CHANNEL) |
@@ -7973,14 +7973,14 @@ static void ipw_handle_promiscuous_rx(struct ipw_priv 
*priv,
 
ipw_rt-rt_hdr.it_version = PKTHDR_RADIOTAP_VERSION;
ipw_rt-rt_hdr.it_pad = 0;  /* always good to zero */
-   ipw_rt-rt_hdr.it_len = sizeof(*ipw_rt);/* total header+data */
+   ipw_rt-rt_hdr.it_len = cpu_to_le16(sizeof(*ipw_rt));   /* total 
header+data */
 
/* Set the size of the skb to the size of the frame */
-   skb_put(skb, ipw_rt-rt_hdr.it_len + len);
+   skb_put(skb, sizeof(*ipw_rt) + len);
 
/* Big bitfield of all the fields we provide in radiotap */
-   ipw_rt-rt_hdr.it_present =
-   ((1  IEEE80211_RADIOTAP_TSFT) |
+   ipw_rt-rt_hdr.it_present = cpu_to_le32(
+(1  IEEE80211_RADIOTAP_TSFT) |
 (1  IEEE80211_RADIOTAP_FLAGS) |
 (1  IEEE80211_RADIOTAP_RATE) |
 (1  IEEE80211_RADIOTAP_CHANNEL) |
@@ -10436,7 +10436,7 @@ static void ipw_handle_promiscuous_tx(struct ipw_priv 
*priv,
rt_hdr-it_version = PKTHDR_RADIOTAP_VERSION;
rt_hdr-it_pad = 0;
rt_hdr-it_present = 0; /* after all, it's just an idea */
-   rt_hdr-it_present |=  (1  IEEE80211_RADIOTAP_CHANNEL);
+   rt_hdr-it_present |=  cpu_to_le32(1  
IEEE80211_RADIOTAP_CHANNEL);
 
*(u16*)skb_put(dst, sizeof(u16)) = cpu_to_le16(
ieee80211chan2mhz(priv-channel));
@@ -10453,7 +10453,7 @@ static void ipw_handle_promiscuous_tx(struct ipw_priv 
*priv,
cpu_to_le16(IEEE80211_CHAN_OFDM |
 IEEE80211_CHAN_2GHZ);
 
-   rt_hdr-it_len = dst-len;
+   rt_hdr-it_len = cpu_to_le16(dst-len);
 
skb_copy_from_linear_data(src, skb_put(dst, len), len);
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[NETNS]: Add namespace for ICMP replying code.

2008-01-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=dde1bc0e6f86183bc095d0774cd109f4edf66ea2
Commit: dde1bc0e6f86183bc095d0774cd109f4edf66ea2
Parent: b5921910a1de4ba82add59154976c3dc7352c8c2
Author: Denis V. Lunev [EMAIL PROTECTED]
AuthorDate: Tue Jan 22 23:50:57 2008 -0800
Committer:  David S. Miller [EMAIL PROTECTED]
CommitDate: Mon Jan 28 15:11:13 2008 -0800

[NETNS]: Add namespace for ICMP replying code.

All needed API is done, the namespace is available when required from
the device on the DST entry from the incoming packet. So, just replace
init_net with proper namespace.

Other protocols will follow.

Signed-off-by: Denis V. Lunev [EMAIL PROTECTED]
Signed-off-by: David S. Miller [EMAIL PROTECTED]
---
 net/ipv4/icmp.c  |   21 +
 net/ipv4/ip_output.c |2 +-
 2 files changed, 14 insertions(+), 9 deletions(-)

diff --git a/net/ipv4/icmp.c b/net/ipv4/icmp.c
index 63ffc7d..a7321a8 100644
--- a/net/ipv4/icmp.c
+++ b/net/ipv4/icmp.c
@@ -405,7 +405,7 @@ static void icmp_reply(struct icmp_bxm *icmp_param, struct 
sk_buff *skb)
.tos = RT_TOS(ip_hdr(skb)-tos) 
} },
.proto = IPPROTO_ICMP };
security_skb_classify_flow(skb, fl);
-   if (ip_route_output_key(init_net, rt, fl))
+   if (ip_route_output_key(rt-u.dst.dev-nd_net, rt, fl))
goto out_unlock;
}
if (icmpv4_xrlim_allow(rt, icmp_param-data.icmph.type,
@@ -437,9 +437,11 @@ void icmp_send(struct sk_buff *skb_in, int type, int code, 
__be32 info)
struct ipcm_cookie ipc;
__be32 saddr;
u8  tos;
+   struct net *net;
 
if (!rt)
goto out;
+   net = rt-u.dst.dev-nd_net;
 
/*
 *  Find the original header. It is expected to be valid, of course.
@@ -515,7 +517,7 @@ void icmp_send(struct sk_buff *skb_in, int type, int code, 
__be32 info)
struct net_device *dev = NULL;
 
if (rt-fl.iif  sysctl_icmp_errors_use_inbound_ifaddr)
-   dev = dev_get_by_index(init_net, rt-fl.iif);
+   dev = dev_get_by_index(net, rt-fl.iif);
 
if (dev) {
saddr = inet_select_addr(dev, 0, RT_SCOPE_LINK);
@@ -569,7 +571,7 @@ void icmp_send(struct sk_buff *skb_in, int type, int code, 
__be32 info)
struct rtable *rt2;
 
security_skb_classify_flow(skb_in, fl);
-   if (__ip_route_output_key(init_net, rt, fl))
+   if (__ip_route_output_key(net, rt, fl))
goto out_unlock;
 
/* No need to clone since we're just using its address. */
@@ -591,14 +593,14 @@ void icmp_send(struct sk_buff *skb_in, int type, int 
code, __be32 info)
if (xfrm_decode_session_reverse(skb_in, fl, AF_INET))
goto out_unlock;
 
-   if (inet_addr_type(init_net, fl.fl4_src) == RTN_LOCAL)
-   err = __ip_route_output_key(init_net, rt2, fl);
+   if (inet_addr_type(net, fl.fl4_src) == RTN_LOCAL)
+   err = __ip_route_output_key(net, rt2, fl);
else {
struct flowi fl2 = {};
struct dst_entry *odst;
 
fl2.fl4_dst = fl.fl4_src;
-   if (ip_route_output_key(init_net, rt2, fl2))
+   if (ip_route_output_key(net, rt2, fl2))
goto out_unlock;
 
/* Ugh! */
@@ -666,6 +668,9 @@ static void icmp_unreach(struct sk_buff *skb)
int hash, protocol;
struct net_protocol *ipprot;
u32 info = 0;
+   struct net *net;
+
+   net = skb-dst-dev-nd_net;
 
/*
 *  Incomplete header ?
@@ -696,7 +701,7 @@ static void icmp_unreach(struct sk_buff *skb)
 and DF set.\n,
   NIPQUAD(iph-daddr));
} else {
-   info = ip_rt_frag_needed(init_net, iph,
+   info = ip_rt_frag_needed(net, iph,
 ntohs(icmph-un.frag.mtu));
if (!info)
goto out;
@@ -734,7 +739,7 @@ static void icmp_unreach(struct sk_buff *skb)
 */
 
if (!sysctl_icmp_ignore_bogus_error_responses 
-   inet_addr_type(init_net, iph-daddr) == RTN_BROADCAST) {
+   inet_addr_type(net, iph-daddr) == RTN_BROADCAST) {
if (net_ratelimit())
printk(KERN_WARNING %u.%u.%u.%u sent an invalid ICMP 
type %u, code %u 
diff --git 

ath5k: use 3 instead of 0x00000003

2008-01-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=1008e0f7b9dd211f918e93090f615e8064aca900
Commit: 1008e0f7b9dd211f918e93090f615e8064aca900
Parent: 1f7d87b0ecacefe4541c75901cbcf29efba42ca6
Author: Bruno Randolf [EMAIL PROTECTED]
AuthorDate: Fri Jan 18 21:51:19 2008 +0900
Committer:  David S. Miller [EMAIL PROTECTED]
CommitDate: Mon Jan 28 15:10:50 2008 -0800

ath5k: use 3 instead of 0x0003

reviewed beacon timer initialization with register traces from madwifi: 
what we
are doing is correct :). one minor fix: use 3 instead of 0x0003 - it's 
more
readable.

drivers/net/wireless/ath5k/hw.c:Changes-licensed-under: ISC

Signed-off-by: Bruno Randolf [EMAIL PROTECTED]
Signed-off-by: John W. Linville [EMAIL PROTECTED]
---
 drivers/net/wireless/ath5k/hw.c |6 ++
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wireless/ath5k/hw.c b/drivers/net/wireless/ath5k/hw.c
index eb00818..3a4bf40 100644
--- a/drivers/net/wireless/ath5k/hw.c
+++ b/drivers/net/wireless/ath5k/hw.c
@@ -2605,10 +2605,8 @@ void ath5k_hw_init_beacon(struct ath5k_hw *ah, u32 
next_beacon, u32 interval)
break;
 
default:
-   timer1 = (next_beacon - AR5K_TUNE_DMA_BEACON_RESP) 
-   0x0003;
-   timer2 = (next_beacon - AR5K_TUNE_SW_BEACON_RESP) 
-   0x0003;
+   timer1 = (next_beacon - AR5K_TUNE_DMA_BEACON_RESP)  3;
+   timer2 = (next_beacon - AR5K_TUNE_SW_BEACON_RESP)  3;
}
 
timer3 = next_beacon + (ah-ah_atim_window ? ah-ah_atim_window : 1);
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[NET_SCHED]: sch_api: introduce constant for rate table size

2008-01-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=5feb5e1aaa887f6427b8290bce48bfb6b7010fc6
Commit: 5feb5e1aaa887f6427b8290bce48bfb6b7010fc6
Parent: 1587bac49f8491b5006a78f8d726111b71757941
Author: Patrick McHardy [EMAIL PROTECTED]
AuthorDate: Wed Jan 23 20:35:19 2008 -0800
Committer:  David S. Miller [EMAIL PROTECTED]
CommitDate: Mon Jan 28 15:11:21 2008 -0800

[NET_SCHED]: sch_api: introduce constant for rate table size

Signed-off-by: Patrick McHardy [EMAIL PROTECTED]
Signed-off-by: David S. Miller [EMAIL PROTECTED]
---
 include/linux/pkt_sched.h |2 ++
 net/sched/sch_api.c   |3 ++-
 2 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/include/linux/pkt_sched.h b/include/linux/pkt_sched.h
index 919af93..3276135 100644
--- a/include/linux/pkt_sched.h
+++ b/include/linux/pkt_sched.h
@@ -83,6 +83,8 @@ struct tc_ratespec
__u32   rate;
 };
 
+#define TC_RTAB_SIZE   1024
+
 /* FIFO section */
 
 struct tc_fifo_qopt
diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c
index 8db554d..7e3c048 100644
--- a/net/sched/sch_api.c
+++ b/net/sched/sch_api.c
@@ -244,7 +244,8 @@ struct qdisc_rate_table *qdisc_get_rtab(struct tc_ratespec 
*r, struct nlattr *ta
}
}
 
-   if (tab == NULL || r-rate == 0 || r-cell_log == 0 || nla_len(tab) != 
1024)
+   if (tab == NULL || r-rate == 0 || r-cell_log == 0 ||
+   nla_len(tab) != TC_RTAB_SIZE)
return NULL;
 
rtab = kmalloc(sizeof(*rtab), GFP_KERNEL);
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[NET_SCHED]: Use NLA_PUT_STRING for string dumping

2008-01-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=57e1c487a4f5754cb77abeb00adb21faa88c484f
Commit: 57e1c487a4f5754cb77abeb00adb21faa88c484f
Parent: 4b3550ef530cfc153fa91f0b37cbda448bad11c6
Author: Patrick McHardy [EMAIL PROTECTED]
AuthorDate: Wed Jan 23 20:34:28 2008 -0800
Committer:  David S. Miller [EMAIL PROTECTED]
CommitDate: Mon Jan 28 15:11:19 2008 -0800

[NET_SCHED]: Use NLA_PUT_STRING for string dumping

Signed-off-by: Patrick McHardy [EMAIL PROTECTED]
Signed-off-by: David S. Miller [EMAIL PROTECTED]
---
 net/sched/act_api.c |4 ++--
 net/sched/act_ipt.c |2 +-
 net/sched/cls_api.c |2 +-
 net/sched/cls_fw.c  |2 +-
 net/sched/cls_u32.c |2 +-
 net/sched/sch_api.c |4 ++--
 6 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/net/sched/act_api.c b/net/sched/act_api.c
index 3602260..e33e43a 100644
--- a/net/sched/act_api.c
+++ b/net/sched/act_api.c
@@ -121,7 +121,7 @@ static int tcf_del_walker(struct sk_buff *skb, struct 
tc_action *a,
nest = nla_nest_start(skb, a-order);
if (nest == NULL)
goto nla_put_failure;
-   NLA_PUT(skb, TCA_KIND, IFNAMSIZ, a-ops-kind);
+   NLA_PUT_STRING(skb, TCA_KIND, a-ops-kind);
for (i = 0; i  (hinfo-hmask + 1); i++) {
p = hinfo-htab[tcf_hash(i, hinfo-hmask)];
 
@@ -423,7 +423,7 @@ tcf_action_dump_1(struct sk_buff *skb, struct tc_action *a, 
int bind, int ref)
if (a-ops == NULL || a-ops-dump == NULL)
return err;
 
-   NLA_PUT(skb, TCA_KIND, IFNAMSIZ, a-ops-kind);
+   NLA_PUT_STRING(skb, TCA_KIND, a-ops-kind);
if (tcf_action_copy_stats(skb, a, 0))
goto nla_put_failure;
nest = nla_nest_start(skb, TCA_OPTIONS);
diff --git a/net/sched/act_ipt.c b/net/sched/act_ipt.c
index 1269334..ecda51d 100644
--- a/net/sched/act_ipt.c
+++ b/net/sched/act_ipt.c
@@ -257,7 +257,7 @@ static int tcf_ipt_dump(struct sk_buff *skb, struct 
tc_action *a, int bind, int
NLA_PUT(skb, TCA_IPT_INDEX, 4, ipt-tcf_index);
NLA_PUT(skb, TCA_IPT_HOOK, 4, ipt-tcfi_hook);
NLA_PUT(skb, TCA_IPT_CNT, sizeof(struct tc_cnt), c);
-   NLA_PUT(skb, TCA_IPT_TABLE, IFNAMSIZ, ipt-tcfi_tname);
+   NLA_PUT_STRING(skb, TCA_IPT_TABLE, ipt-tcfi_tname);
tm.install = jiffies_to_clock_t(jiffies - ipt-tcf_tm.install);
tm.lastuse = jiffies_to_clock_t(jiffies - ipt-tcf_tm.lastuse);
tm.expires = jiffies_to_clock_t(ipt-tcf_tm.expires);
diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c
index 5584e7c..3377ca0 100644
--- a/net/sched/cls_api.c
+++ b/net/sched/cls_api.c
@@ -337,7 +337,7 @@ static int tcf_fill_node(struct sk_buff *skb, struct 
tcf_proto *tp,
tcm-tcm_ifindex = tp-q-dev-ifindex;
tcm-tcm_parent = tp-classid;
tcm-tcm_info = TC_H_MAKE(tp-prio, tp-protocol);
-   NLA_PUT(skb, TCA_KIND, IFNAMSIZ, tp-ops-kind);
+   NLA_PUT_STRING(skb, TCA_KIND, tp-ops-kind);
tcm-tcm_handle = fh;
if (RTM_DELTFILTER != event) {
tcm-tcm_handle = 0;
diff --git a/net/sched/cls_fw.c b/net/sched/cls_fw.c
index e3dfbb3..3107473 100644
--- a/net/sched/cls_fw.c
+++ b/net/sched/cls_fw.c
@@ -352,7 +352,7 @@ static int fw_dump(struct tcf_proto *tp, unsigned long fh,
NLA_PUT(skb, TCA_FW_CLASSID, 4, f-res.classid);
 #ifdef CONFIG_NET_CLS_IND
if (strlen(f-indev))
-   NLA_PUT(skb, TCA_FW_INDEV, IFNAMSIZ, f-indev);
+   NLA_PUT_STRING(skb, TCA_FW_INDEV, f-indev);
 #endif /* CONFIG_NET_CLS_IND */
if (head-mask != 0x)
NLA_PUT(skb, TCA_FW_MASK, 4, head-mask);
diff --git a/net/sched/cls_u32.c b/net/sched/cls_u32.c
index b51c2c3..7a15025 100644
--- a/net/sched/cls_u32.c
+++ b/net/sched/cls_u32.c
@@ -732,7 +732,7 @@ static int u32_dump(struct tcf_proto *tp, unsigned long fh,
 
 #ifdef CONFIG_NET_CLS_IND
if(strlen(n-indev))
-   NLA_PUT(skb, TCA_U32_INDEV, IFNAMSIZ, n-indev);
+   NLA_PUT_STRING(skb, TCA_U32_INDEV, n-indev);
 #endif
 #ifdef CONFIG_CLS_U32_PERF
NLA_PUT(skb, TCA_U32_PCNT,
diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c
index 7abb028..8db554d 100644
--- a/net/sched/sch_api.c
+++ b/net/sched/sch_api.c
@@ -834,7 +834,7 @@ static int tc_fill_qdisc(struct sk_buff *skb, struct Qdisc 
*q, u32 clid,
tcm-tcm_parent = clid;
tcm-tcm_handle = q-handle;
tcm-tcm_info = atomic_read(q-refcnt);
-   NLA_PUT(skb, TCA_KIND, IFNAMSIZ, q-ops-id);
+   NLA_PUT_STRING(skb, TCA_KIND, q-ops-id);
if (q-ops-dump  q-ops-dump(q, skb)  0)
goto nla_put_failure;
q-qstats.qlen = q-q.qlen;
@@ -1080,7 +1080,7 @@ static int tc_fill_tclass(struct sk_buff *skb, struct 
Qdisc *q,
tcm-tcm_parent = q-handle;
tcm-tcm_handle = q-handle;
tcm-tcm_info = 0;
-   NLA_PUT(skb, TCA_KIND, IFNAMSIZ, q-ops-id);
+   

[NET_SCHED]: Convert classifiers from rtnetlink to new netlink API

2008-01-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=add93b610a4e66d36d0cf0b2596c3d3bcfdaee39
Commit: add93b610a4e66d36d0cf0b2596c3d3bcfdaee39
Parent: 1e90474c377e92db7262a8968a45c1dd980ca9e5
Author: Patrick McHardy [EMAIL PROTECTED]
AuthorDate: Tue Jan 22 22:11:33 2008 -0800
Committer:  David S. Miller [EMAIL PROTECTED]
CommitDate: Mon Jan 28 15:11:11 2008 -0800

[NET_SCHED]: Convert classifiers from rtnetlink to new netlink API

Signed-off-by: Patrick McHardy [EMAIL PROTECTED]
Signed-off-by: David S. Miller [EMAIL PROTECTED]
---
 include/net/pkt_cls.h |   10 +++---
 include/net/sch_generic.h |2 +-
 net/sched/cls_api.c   |   65 -
 net/sched/cls_basic.c |   40 +++---
 net/sched/cls_fw.c|   54 +++---
 net/sched/cls_route.c |   70 
 net/sched/cls_rsvp.h  |   48 ++--
 net/sched/cls_tcindex.c   |   66 +++---
 net/sched/cls_u32.c   |   78 ++--
 net/sched/em_meta.c   |   56 
 net/sched/em_text.c   |9 +++--
 net/sched/ematch.c|   74 +-
 12 files changed, 290 insertions(+), 282 deletions(-)

diff --git a/include/net/pkt_cls.h b/include/net/pkt_cls.h
index 2eaf204..8716eb7 100644
--- a/include/net/pkt_cls.h
+++ b/include/net/pkt_cls.h
@@ -129,8 +129,8 @@ tcf_exts_exec(struct sk_buff *skb, struct tcf_exts *exts,
return 0;
 }
 
-extern int tcf_exts_validate(struct tcf_proto *tp, struct rtattr **tb,
-struct rtattr *rate_tlv, struct tcf_exts *exts,
+extern int tcf_exts_validate(struct tcf_proto *tp, struct nlattr **tb,
+struct nlattr *rate_tlv, struct tcf_exts *exts,
 struct tcf_ext_map *map);
 extern void tcf_exts_destroy(struct tcf_proto *tp, struct tcf_exts *exts);
 extern void tcf_exts_change(struct tcf_proto *tp, struct tcf_exts *dst,
@@ -247,7 +247,7 @@ struct tcf_ematch_ops
 
 extern int tcf_em_register(struct tcf_ematch_ops *);
 extern int tcf_em_unregister(struct tcf_ematch_ops *);
-extern int tcf_em_tree_validate(struct tcf_proto *, struct rtattr *,
+extern int tcf_em_tree_validate(struct tcf_proto *, struct nlattr *,
struct tcf_ematch_tree *);
 extern void tcf_em_tree_destroy(struct tcf_proto *, struct tcf_ematch_tree *);
 extern int tcf_em_tree_dump(struct sk_buff *, struct tcf_ematch_tree *, int);
@@ -338,9 +338,9 @@ static inline int tcf_valid_offset(const struct sk_buff 
*skb,
 #include net/net_namespace.h
 
 static inline int
-tcf_change_indev(struct tcf_proto *tp, char *indev, struct rtattr *indev_tlv)
+tcf_change_indev(struct tcf_proto *tp, char *indev, struct nlattr *indev_tlv)
 {
-   if (rtattr_strlcpy(indev, indev_tlv, IFNAMSIZ) = IFNAMSIZ)
+   if (nla_strlcpy(indev, indev_tlv, IFNAMSIZ) = IFNAMSIZ)
return -EINVAL;
return 0;
 }
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h
index 8cacdff..ab502ec 100644
--- a/include/net/sch_generic.h
+++ b/include/net/sch_generic.h
@@ -126,7 +126,7 @@ struct tcf_proto_ops
unsigned long   (*get)(struct tcf_proto*, u32 handle);
void(*put)(struct tcf_proto*, unsigned long);
int (*change)(struct tcf_proto*, unsigned long,
-   u32 handle, struct rtattr **,
+   u32 handle, struct nlattr **,
unsigned long *);
int (*delete)(struct tcf_proto*, unsigned long);
void(*walk)(struct tcf_proto*, struct tcf_walker 
*arg);
diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c
index 9eeb3c6..87be2b2 100644
--- a/net/sched/cls_api.c
+++ b/net/sched/cls_api.c
@@ -38,14 +38,14 @@ static DEFINE_RWLOCK(cls_mod_lock);
 
 /* Find classifier type by string name */
 
-static struct tcf_proto_ops *tcf_proto_lookup_ops(struct rtattr *kind)
+static struct tcf_proto_ops *tcf_proto_lookup_ops(struct nlattr *kind)
 {
struct tcf_proto_ops *t = NULL;
 
if (kind) {
read_lock(cls_mod_lock);
for (t = tcf_proto_base; t; t = t-next) {
-   if (rtattr_strcmp(kind, t-kind) == 0) {
+   if (nla_strcmp(kind, t-kind) == 0) {
if (!try_module_get(t-owner))
t = NULL;
break;
@@ -118,7 +118,7 @@ static inline u32 tcf_auto_prio(struct tcf_proto *tp)
 static int tc_ctl_tfilter(struct sk_buff *skb, struct nlmsghdr *n, void *arg)
 {
struct net *net = skb-sk-sk_net;
-   struct rtattr **tca;
+   struct 

[NETNS]: Add namespace parameter to ip_route_output_key.

2008-01-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=f206351a50ea86250fabea96b9af8d8f8fc02603
Commit: f206351a50ea86250fabea96b9af8d8f8fc02603
Parent: f1b050bf7a88910f9f00c9c8989c1bf5a67dd140
Author: Denis V. Lunev [EMAIL PROTECTED]
AuthorDate: Tue Jan 22 22:07:34 2008 -0800
Committer:  David S. Miller [EMAIL PROTECTED]
CommitDate: Mon Jan 28 15:11:07 2008 -0800

[NETNS]: Add namespace parameter to ip_route_output_key.

Needed to propagate it down to the ip_route_output_flow.

Signed-off-by: Denis V. Lunev [EMAIL PROTECTED]
Signed-off-by: David S. Miller [EMAIL PROTECTED]
---
 drivers/infiniband/core/addr.c   |4 ++--
 drivers/net/bonding/bond_main.c  |2 +-
 include/net/route.h  |2 +-
 net/atm/clip.c   |2 +-
 net/bridge/br_netfilter.c|2 +-
 net/ipv4/arp.c   |6 +++---
 net/ipv4/icmp.c  |4 ++--
 net/ipv4/igmp.c  |6 +++---
 net/ipv4/ip_gre.c|   10 +-
 net/ipv4/ip_output.c |2 +-
 net/ipv4/ipip.c  |8 
 net/ipv4/ipmr.c  |4 ++--
 net/ipv4/ipvs/ip_vs_xmit.c   |6 +++---
 net/ipv4/netfilter.c |6 +++---
 net/ipv4/netfilter/nf_nat_rule.c |2 +-
 net/ipv4/route.c |6 +++---
 net/ipv4/syncookies.c|2 +-
 net/ipv6/ip6_tunnel.c|4 ++--
 net/ipv6/sit.c   |4 ++--
 net/rxrpc/ar-peer.c  |2 +-
 net/sctp/protocol.c  |4 ++--
 21 files changed, 44 insertions(+), 44 deletions(-)

diff --git a/drivers/infiniband/core/addr.c b/drivers/infiniband/core/addr.c
index 963177e..a58ad8a 100644
--- a/drivers/infiniband/core/addr.c
+++ b/drivers/infiniband/core/addr.c
@@ -158,7 +158,7 @@ static void addr_send_arp(struct sockaddr_in *dst_in)
 
memset(fl, 0, sizeof fl);
fl.nl_u.ip4_u.daddr = dst_ip;
-   if (ip_route_output_key(rt, fl))
+   if (ip_route_output_key(init_net, rt, fl))
return;
 
neigh_event_send(rt-u.dst.neighbour, NULL);
@@ -179,7 +179,7 @@ static int addr_resolve_remote(struct sockaddr_in *src_in,
memset(fl, 0, sizeof fl);
fl.nl_u.ip4_u.daddr = dst_ip;
fl.nl_u.ip4_u.saddr = src_ip;
-   ret = ip_route_output_key(rt, fl);
+   ret = ip_route_output_key(init_net, rt, fl);
if (ret)
goto out;
 
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 49a1982..2039f78 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -2517,7 +2517,7 @@ static void bond_arp_send_all(struct bonding *bond, 
struct slave *slave)
fl.fl4_dst = targets[i];
fl.fl4_tos = RTO_ONLINK;
 
-   rv = ip_route_output_key(rt, fl);
+   rv = ip_route_output_key(init_net, rt, fl);
if (rv) {
if (net_ratelimit()) {
printk(KERN_WARNING DRV_NAME
diff --git a/include/net/route.h b/include/net/route.h
index 6b970d7..d9b876a 100644
--- a/include/net/route.h
+++ b/include/net/route.h
@@ -111,7 +111,7 @@ extern void ip_rt_redirect(__be32 old_gw, __be32 
dst, __be32 new_gw,
   __be32 src, struct net_device *dev);
 extern voidrt_cache_flush(int how);
 extern int __ip_route_output_key(struct net *, struct rtable **, 
const struct flowi *flp);
-extern int ip_route_output_key(struct rtable **, struct flowi 
*flp);
+extern int ip_route_output_key(struct net *, struct rtable **, 
struct flowi *flp);
 extern int ip_route_output_flow(struct net *, struct rtable **rp, 
struct flowi *flp, struct sock *sk, int flags);
 extern int ip_route_input(struct sk_buff*, __be32 dst, __be32 src, 
u8 tos, struct net_device *devin);
 extern unsigned short  ip_rt_frag_needed(struct iphdr *iph, unsigned short 
new_mtu);
diff --git a/net/atm/clip.c b/net/atm/clip.c
index 45e0862..86b885e 100644
--- a/net/atm/clip.c
+++ b/net/atm/clip.c
@@ -534,7 +534,7 @@ static int clip_setentry(struct atm_vcc *vcc, __be32 ip)
unlink_clip_vcc(clip_vcc);
return 0;
}
-   error = ip_route_output_key(rt, fl);
+   error = ip_route_output_key(init_net, rt, fl);
if (error)
return error;
neigh = __neigh_lookup(clip_tbl, ip, rt-u.dst.dev, 1);
diff --git a/net/bridge/br_netfilter.c b/net/bridge/br_netfilter.c
index 141f069..80014ba 100644
--- a/net/bridge/br_netfilter.c
+++ b/net/bridge/br_netfilter.c
@@ -353,7 +353,7 @@ static int br_nf_pre_routing_finish(struct sk_buff *skb)
if (err != -EHOSTUNREACH || !in_dev || 
IN_DEV_FORWARD(in_dev))
goto free_skb;
 
-   if 

[IPV4] fib_trie: avoid extra search on delete

2008-01-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=9195bef7fb0ba0a91d5ffa566bcf8e007e3c7172
Commit: 9195bef7fb0ba0a91d5ffa566bcf8e007e3c7172
Parent: a88ee229253b31e3a844b30525ff77fbfe3111d3
Author: Stephen Hemminger [EMAIL PROTECTED]
AuthorDate: Tue Jan 22 21:56:34 2008 -0800
Committer:  David S. Miller [EMAIL PROTECTED]
CommitDate: Mon Jan 28 15:11:00 2008 -0800

[IPV4] fib_trie: avoid extra search on delete

Get rid of extra search that made route deletion O(n).

Signed-off-by: Stephen Hemminger [EMAIL PROTECTED]
Signed-off-by: David S. Miller [EMAIL PROTECTED]
---
 net/ipv4/fib_trie.c |   50 --
 1 files changed, 12 insertions(+), 38 deletions(-)

diff --git a/net/ipv4/fib_trie.c b/net/ipv4/fib_trie.c
index 2ea94eb..441c4ea 100644
--- a/net/ipv4/fib_trie.c
+++ b/net/ipv4/fib_trie.c
@@ -1545,49 +1545,23 @@ found:
return ret;
 }
 
-/* only called from updater side */
-static int trie_leaf_remove(struct trie *t, t_key key)
+/*
+ * Remove the leaf and return parent.
+ */
+static void trie_leaf_remove(struct trie *t, struct leaf *l)
 {
-   t_key cindex;
-   struct tnode *tp = NULL;
-   struct node *n = t-trie;
-   struct leaf *l;
-
-   pr_debug(entering trie_leaf_remove(%p)\n, n);
+   struct tnode *tp = node_parent((struct node *) l);
 
-   /* Note that in the case skipped bits, those bits are *not* checked!
-* When we finish this, we will have NULL or a T_LEAF, and the
-* T_LEAF may or may not match our key.
-*/
-
-   while (n != NULL  IS_TNODE(n)) {
-   struct tnode *tn = (struct tnode *) n;
-   check_tnode(tn);
-   n = tnode_get_child(tn, tkey_extract_bits(key,
- tn-pos, tn-bits));
-
-   BUG_ON(n  node_parent(n) != tn);
-   }
-   l = (struct leaf *) n;
-
-   if (!n || !tkey_equals(l-key, key))
-   return 0;
-
-   /*
-* Key found.
-* Remove the leaf and rebalance the tree
-*/
-   tp = node_parent(n);
-   tnode_free((struct tnode *) n);
+   pr_debug(entering trie_leaf_remove(%p)\n, l);
 
if (tp) {
-   cindex = tkey_extract_bits(key, tp-pos, tp-bits);
+   t_key cindex = tkey_extract_bits(l-key, tp-pos, tp-bits);
put_child(t, (struct tnode *)tp, cindex, NULL);
rcu_assign_pointer(t-trie, trie_rebalance(t, tp));
} else
rcu_assign_pointer(t-trie, NULL);
 
-   return 1;
+   tnode_free((struct tnode *) l);
 }
 
 /*
@@ -1665,7 +1639,7 @@ static int fn_trie_delete(struct fib_table *tb, struct 
fib_config *cfg)
}
 
if (hlist_empty(l-list))
-   trie_leaf_remove(t, key);
+   trie_leaf_remove(t, l);
 
if (fa-fa_state  FA_S_ACCESSED)
rt_cache_flush(-1);
@@ -1778,19 +1752,19 @@ static struct leaf *trie_nextleaf(struct leaf *l)
 static int fn_trie_flush(struct fib_table *tb)
 {
struct trie *t = (struct trie *) tb-tb_data;
-   struct leaf *ll = NULL, *l = NULL;
+   struct leaf *l, *ll = NULL;
int found = 0;
 
for (l = trie_firstleaf(t); l; l = trie_nextleaf(l)) {
found += trie_flush_leaf(t, l);
 
if (ll  hlist_empty(ll-list))
-   trie_leaf_remove(t, ll-key);
+   trie_leaf_remove(t, ll);
ll = l;
}
 
if (ll  hlist_empty(ll-list))
-   trie_leaf_remove(t, ll-key);
+   trie_leaf_remove(t, ll);
 
pr_debug(trie_flush found=%d\n, found);
return found;
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


ath5k: beacon interval is in TU

2008-01-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=e535c1ac7e431f85e9c8ead6dbc977a1e1906736
Commit: e535c1ac7e431f85e9c8ead6dbc977a1e1906736
Parent: 1008e0f7b9dd211f918e93090f615e8064aca900
Author: Bruno Randolf [EMAIL PROTECTED]
AuthorDate: Fri Jan 18 21:51:40 2008 +0900
Committer:  David S. Miller [EMAIL PROTECTED]
CommitDate: Mon Jan 28 15:10:50 2008 -0800

ath5k: beacon interval is in TU

the beacon interval is passed by mac80211 in TU already, so we can directly 
use
it without conversion. also update the comments about TU (1 TU is defined by
802.11 as 1024usec).

drivers/net/wireless/ath5k/ath5k.h: Changes-licensed-under: ISC
drivers/net/wireless/ath5k/base.c:  Changes-licensed-under: 3-Clause-BSD
drivers/net/wireless/ath5k/base.h:  Changes-licensed-under: 3-Clause-BSD

Signed-off-by: Bruno Randolf [EMAIL PROTECTED]
Signed-off-by: John W. Linville [EMAIL PROTECTED]
---
 drivers/net/wireless/ath5k/ath5k.h |4 ++--
 drivers/net/wireless/ath5k/base.c  |4 ++--
 drivers/net/wireless/ath5k/base.h  |2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/net/wireless/ath5k/ath5k.h 
b/drivers/net/wireless/ath5k/ath5k.h
index 878609f..c79066b 100644
--- a/drivers/net/wireless/ath5k/ath5k.h
+++ b/drivers/net/wireless/ath5k/ath5k.h
@@ -486,8 +486,8 @@ struct ath5k_beacon_state {
  * TSF to TU conversion:
  *
  * TSF is a 64bit value in usec (microseconds).
- * TU is a 32bit value in roughly msec (milliseconds): usec / 1024
- * (1000ms equals 976 TU)
+ * TU is a 32bit value and defined by IEEE802.11 (page 6) as A measurement of
+ * time equal to 1024 usec, so it's roughly milliseconds (usec / 1024).
  */
 #define TSF_TO_TU(_tsf) (u32)((_tsf)  10)
 
diff --git a/drivers/net/wireless/ath5k/base.c 
b/drivers/net/wireless/ath5k/base.c
index 5ff115d..de59016 100644
--- a/drivers/net/wireless/ath5k/base.c
+++ b/drivers/net/wireless/ath5k/base.c
@@ -2554,7 +2554,7 @@ ath5k_config(struct ieee80211_hw *hw,
 {
struct ath5k_softc *sc = hw-priv;
 
-   sc-bintval = conf-beacon_int * 1000 / 1024;
+   sc-bintval = conf-beacon_int;
ath5k_setcurmode(sc, conf-phymode);
 
return ath5k_chan_set(sc, conf-chan);
@@ -2570,7 +2570,7 @@ ath5k_config_interface(struct ieee80211_hw *hw, struct 
ieee80211_vif *vif,
 
/* Set to a reasonable value. Note that this will
 * be set to mac80211's value at ath5k_config(). */
-   sc-bintval = 1000 * 1000 / 1024;
+   sc-bintval = 1000;
mutex_lock(sc-lock);
if (sc-vif != vif) {
ret = -EIO;
diff --git a/drivers/net/wireless/ath5k/base.h 
b/drivers/net/wireless/ath5k/base.h
index 7ba2223..20c9469 100644
--- a/drivers/net/wireless/ath5k/base.h
+++ b/drivers/net/wireless/ath5k/base.h
@@ -164,7 +164,7 @@ struct ath5k_softc {
struct ath5k_buf*bbuf;  /* beacon buffer */
unsigned intbhalq,  /* SW q for outgoing beacons */
bmisscount, /* missed beacon transmits */
-   bintval,/* beacon interval */
+   bintval,/* beacon interval in TU */
bsent;
 
struct timer_list   calib_tim;  /* calibration timer */
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


mac80211: fix rx flow sparse errors, make functions static

2008-01-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=71ebb4aac87e4a1504a155084d658d0a92ac63fb
Commit: 71ebb4aac87e4a1504a155084d658d0a92ac63fb
Parent: a8b47ea3c583645977a916ab3e2d323c7504aa7b
Author: Ron Rindjunsky [EMAIL PROTECTED]
AuthorDate: Mon Jan 21 12:39:12 2008 +0200
Committer:  David S. Miller [EMAIL PROTECTED]
CommitDate: Mon Jan 28 15:10:46 2008 -0800

mac80211: fix rx flow sparse errors, make functions static

This patch adds static declarations to functions in the Rx flow in order to
eliminate sparse errors

Signed-off-by: Ron Rindjunsky [EMAIL PROTECTED]
Signed-off-by: Tomas Winkler [EMAIL PROTECTED]
Signed-off-by: John W. Linville [EMAIL PROTECTED]
---
 net/mac80211/ieee80211_sta.c |4 ++--
 net/mac80211/rx.c|   12 +++-
 2 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/net/mac80211/ieee80211_sta.c b/net/mac80211/ieee80211_sta.c
index e7da1cd..2019b4f 100644
--- a/net/mac80211/ieee80211_sta.c
+++ b/net/mac80211/ieee80211_sta.c
@@ -1154,8 +1154,8 @@ end_no_lock:
sta_info_put(sta);
 }
 
-void ieee80211_send_delba(struct net_device *dev, const u8 *da, u16 tid,
-   u16 initiator, u16 reason_code)
+static void ieee80211_send_delba(struct net_device *dev, const u8 *da, u16 tid,
+u16 initiator, u16 reason_code)
 {
struct ieee80211_local *local = wdev_priv(dev-ieee80211_ptr);
struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index 96b0faf..89e1e30 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -295,7 +295,7 @@ ieee80211_rx_h_parse_qos(struct ieee80211_txrx_data *rx)
 }
 
 
-u32 ieee80211_rx_load_stats(struct ieee80211_local *local,
+static u32 ieee80211_rx_load_stats(struct ieee80211_local *local,
  struct sk_buff *skb,
  struct ieee80211_rx_status *status)
 {
@@ -1664,8 +1664,10 @@ static int prepare_for_handlers(struct 
ieee80211_sub_if_data *sdata,
  * This is the actual Rx frames handler. as it blongs to Rx path it must
  * be called with rcu_read_lock protection.
  */
-void __ieee80211_rx_handle_packet(struct ieee80211_hw *hw, struct sk_buff *skb,
-   struct ieee80211_rx_status *status, u32 load)
+static void __ieee80211_rx_handle_packet(struct ieee80211_hw *hw,
+struct sk_buff *skb,
+struct ieee80211_rx_status *status,
+u32 load)
 {
struct ieee80211_local *local = hw_to_local(hw);
struct ieee80211_sub_if_data *sdata;
@@ -1919,8 +1921,8 @@ u8 ieee80211_sta_manage_reorder_buf(struct ieee80211_hw 
*hw,
return 1;
 }
 
-u8 ieee80211_rx_reorder_ampdu(struct ieee80211_local *local,
- struct sk_buff *skb)
+static u8 ieee80211_rx_reorder_ampdu(struct ieee80211_local *local,
+struct sk_buff *skb)
 {
struct ieee80211_hw *hw = local-hw;
struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb-data;
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[DST]: shrinks sizeof(struct rtable) by 64 bytes on x86_64

2008-01-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=69a73829dbb10e7c8554e66a80cb4fde57347fff
Commit: 69a73829dbb10e7c8554e66a80cb4fde57347fff
Parent: 81566e8322c3f6c6f9a2277fe0e440fee8d917bd
Author: Eric Dumazet [EMAIL PROTECTED]
AuthorDate: Tue Jan 22 06:18:34 2008 -0800
Committer:  David S. Miller [EMAIL PROTECTED]
CommitDate: Mon Jan 28 15:10:41 2008 -0800

[DST]: shrinks sizeof(struct rtable) by 64 bytes on x86_64

On x86_64, sizeof(struct rtable) is 0x148, which is rounded up to
0x180 bytes by SLAB allocator.

We can reduce this to exactly 0x140 bytes, without alignment overhead,
and store 12 struct rtable per PAGE instead of 10.

rate_tokens is currently defined as an unsigned long, while its
content should not exceed 6*HZ. It can safely be converted to an
unsigned int.

Moving tclassid right after rate_tokens to fill the 4 bytes hole
permits to save 8 bytes on 'struct dst_entry', which finally permits
to save 8 bytes on 'struct rtable'

Signed-off-by: Eric Dumazet [EMAIL PROTECTED]
Signed-off-by: David S. Miller [EMAIL PROTECTED]
---
 include/net/dst.h |   10 +-
 net/ipv4/icmp.c   |   13 +++--
 2 files changed, 12 insertions(+), 11 deletions(-)

diff --git a/include/net/dst.h b/include/net/dst.h
index c45dcc3..e3ac7d0 100644
--- a/include/net/dst.h
+++ b/include/net/dst.h
@@ -56,7 +56,11 @@ struct dst_entry
struct dst_entry*path;
 
unsigned long   rate_last;  /* rate limiting for ICMP */
-   unsigned long   rate_tokens;
+   unsigned intrate_tokens;
+
+#ifdef CONFIG_NET_CLS_ROUTE
+   __u32   tclassid;
+#endif
 
struct neighbour*neighbour;
struct hh_cache *hh;
@@ -65,10 +69,6 @@ struct dst_entry
int (*input)(struct sk_buff*);
int (*output)(struct sk_buff*);
 
-#ifdef CONFIG_NET_CLS_ROUTE
-   __u32   tclassid;
-#endif
-
struct  dst_ops *ops;

unsigned long   lastuse;
diff --git a/net/ipv4/icmp.c b/net/ipv4/icmp.c
index e57f167..37cdea0 100644
--- a/net/ipv4/icmp.c
+++ b/net/ipv4/icmp.c
@@ -275,18 +275,19 @@ static inline void icmp_xmit_unlock(void)
 #define XRLIM_BURST_FACTOR 6
 int xrlim_allow(struct dst_entry *dst, int timeout)
 {
-   unsigned long now;
+   unsigned long now, token = dst-rate_tokens;
int rc = 0;
 
now = jiffies;
-   dst-rate_tokens += now - dst-rate_last;
+   token += now - dst-rate_last;
dst-rate_last = now;
-   if (dst-rate_tokens  XRLIM_BURST_FACTOR * timeout)
-   dst-rate_tokens = XRLIM_BURST_FACTOR * timeout;
-   if (dst-rate_tokens = timeout) {
-   dst-rate_tokens -= timeout;
+   if (token  XRLIM_BURST_FACTOR * timeout)
+   token = XRLIM_BURST_FACTOR * timeout;
+   if (token = timeout) {
+   token -= timeout;
rc = 1;
}
+   dst-rate_tokens = token;
return rc;
 }
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


mac80211: Fix rate reporting regression

2008-01-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=2bc454b0b30b3645d114689b64321cb49be99923
Commit: 2bc454b0b30b3645d114689b64321cb49be99923
Parent: 9ab461732a3cd8e7a7cf13cc46ed4c1ac7907824
Author: Michael Wu [EMAIL PROTECTED]
AuthorDate: Tue Dec 25 19:33:16 2007 -0500
Committer:  David S. Miller [EMAIL PROTECTED]
CommitDate: Mon Jan 28 15:09:42 2008 -0800

mac80211: Fix rate reporting regression

Mattias Nissler's clean up rate selection patch incorrectly changes
the behavior of txrate setting in sta_info. This patch backs out parts
of the rate selection consolidation in order to fix this issue for now.

Signed-off-by: Michael Wu [EMAIL PROTECTED]
Signed-off-by: John W. Linville [EMAIL PROTECTED]
---
 drivers/net/wireless/iwlwifi/iwl-3945-rs.c |   10 --
 drivers/net/wireless/iwlwifi/iwl-4965-rs.c |7 ++-
 net/mac80211/ieee80211_rate.c  |   18 +-
 net/mac80211/rc80211_pid_algo.c|   20 +---
 net/mac80211/rc80211_simple.c  |   19 +--
 5 files changed, 49 insertions(+), 25 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl-3945-rs.c 
b/drivers/net/wireless/iwlwifi/iwl-3945-rs.c
index 3e81274..d79f18c 100644
--- a/drivers/net/wireless/iwlwifi/iwl-3945-rs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-3945-rs.c
@@ -657,14 +657,20 @@ static void rs_get_rate(void *priv_rate, struct 
net_device *dev,
struct ieee80211_local *local = wdev_priv(dev-ieee80211_ptr);
struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb-data;
struct sta_info *sta;
-   u16 rate_mask;
+   u16 fc, rate_mask;
struct iwl3945_priv *priv = (struct iwl3945_priv *)priv_rate;
DECLARE_MAC_BUF(mac);
 
IWL_DEBUG_RATE(enter\n);
 
sta = sta_info_get(local, hdr-addr1);
-   if (!sta || !sta-rate_ctrl_priv) {
+
+   /* Send management frames and broadcast/multicast data using lowest
+* rate. */
+   fc = le16_to_cpu(hdr-frame_control);
+   if ((fc  IEEE80211_FCTL_FTYPE) != IEEE80211_FTYPE_DATA ||
+   is_multicast_ether_addr(hdr-addr1) ||
+   !sta || !sta-rate_ctrl_priv) {
IWL_DEBUG_RATE(leave: No STA priv data to update!\n);
sel-rate = rate_lowest(local, local-oper_hw_mode, sta);
if (sta)
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965-rs.c 
b/drivers/net/wireless/iwlwifi/iwl-4965-rs.c
index 229b341..5081e28 100644
--- a/drivers/net/wireless/iwlwifi/iwl-4965-rs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-4965-rs.c
@@ -2017,6 +2017,7 @@ static void rs_get_rate(void *priv_rate, struct 
net_device *dev,
struct ieee80211_conf *conf = local-hw.conf;
struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb-data;
struct sta_info *sta;
+   u16 fc;
struct iwl4965_priv *priv = (struct iwl4965_priv *)priv_rate;
struct iwl4965_rate_scale_priv *lq;
 
@@ -2024,7 +2025,11 @@ static void rs_get_rate(void *priv_rate, struct 
net_device *dev,
 
sta = sta_info_get(local, hdr-addr1);
 
-   if (!sta || !sta-rate_ctrl_priv) {
+   /* Send management frames and broadcast/multicast data using lowest
+* rate. */
+   fc = le16_to_cpu(hdr-frame_control);
+   if (!ieee80211_is_data(fc) || is_multicast_ether_addr(hdr-addr1) ||
+   !sta || !sta-rate_ctrl_priv) {
sel-rate = rate_lowest(local, local-oper_hw_mode, sta);
if (sta)
sta_info_put(sta);
diff --git a/net/mac80211/ieee80211_rate.c b/net/mac80211/ieee80211_rate.c
index 5676a26..b957e67 100644
--- a/net/mac80211/ieee80211_rate.c
+++ b/net/mac80211/ieee80211_rate.c
@@ -168,29 +168,13 @@ void rate_control_get_rate(struct net_device *dev,
 {
struct ieee80211_local *local = wdev_priv(dev-ieee80211_ptr);
struct rate_control_ref *ref = local-rate_ctrl;
-   struct ieee80211_sub_if_data *sdata;
struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb-data;
struct sta_info *sta = sta_info_get(local, hdr-addr1);
int i;
-   u16 fc;
 
memset(sel, 0, sizeof(struct rate_selection));
 
-   /* Send management frames and broadcast/multicast data using lowest
-* rate. */
-   fc = le16_to_cpu(hdr-frame_control);
-   if ((fc  IEEE80211_FCTL_FTYPE) != IEEE80211_FTYPE_DATA ||
-   is_multicast_ether_addr(hdr-addr1))
-   sel-rate = rate_lowest(local, mode, sta);
-
-   /* If a forced rate is in effect, select it. */
-   sdata = IEEE80211_DEV_TO_SUB_IF(dev);
-   if (sdata-bss  sdata-bss-force_unicast_rateidx  -1)
-   sel-rate = mode-rates[sdata-bss-force_unicast_rateidx];
-
-   /* If we haven't found the rate yet, ask the rate control algo. */
-   if (!sel-rate)
-   ref-ops-get_rate(ref-priv, dev, mode, skb, sel);
+   ref-ops-get_rate(ref-priv, 

[NETNS][FRAGS]: Make the LRU list per namespace.

2008-01-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=3140c25c82106645a6b1fc469dab7006a1d09fd0
Commit: 3140c25c82106645a6b1fc469dab7006a1d09fd0
Parent: 3b4bc4a2bfe80d01ebd4f2b6dcc58986c970ed16
Author: Pavel Emelyanov [EMAIL PROTECTED]
AuthorDate: Tue Jan 22 06:11:48 2008 -0800
Committer:  David S. Miller [EMAIL PROTECTED]
CommitDate: Mon Jan 28 15:10:39 2008 -0800

[NETNS][FRAGS]: Make the LRU list per namespace.

The inet_frags.lru_list is used for evicting only, so we have
to make it per-namespace, to evict only those fragments, who's
namespace exceeded its high threshold, but not the whole hash.
Besides, this helps to avoid long loops  in evictor.

The spinlock is not per-namespace because it protects the
hash table as well, which is global.

Signed-off-by: Pavel Emelyanov [EMAIL PROTECTED]
Signed-off-by: David S. Miller [EMAIL PROTECTED]
---
 include/net/inet_frag.h |2 +-
 net/ipv4/inet_fragment.c|8 
 net/ipv4/ip_fragment.c  |2 +-
 net/ipv6/netfilter/nf_conntrack_reasm.c |2 +-
 net/ipv6/reassembly.c   |2 +-
 5 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/include/net/inet_frag.h b/include/net/inet_frag.h
index 1917fbe..3695ff4 100644
--- a/include/net/inet_frag.h
+++ b/include/net/inet_frag.h
@@ -4,6 +4,7 @@
 struct netns_frags {
int nqueues;
atomic_tmem;
+   struct list_headlru_list;
 
/* sysctls */
int timeout;
@@ -32,7 +33,6 @@ struct inet_frag_queue {
 #define INETFRAGS_HASHSZ   64
 
 struct inet_frags {
-   struct list_headlru_list;
struct hlist_head   hash[INETFRAGS_HASHSZ];
rwlock_tlock;
u32 rnd;
diff --git a/net/ipv4/inet_fragment.c b/net/ipv4/inet_fragment.c
index fcf5252..f1b95e1 100644
--- a/net/ipv4/inet_fragment.c
+++ b/net/ipv4/inet_fragment.c
@@ -57,7 +57,6 @@ void inet_frags_init(struct inet_frags *f)
for (i = 0; i  INETFRAGS_HASHSZ; i++)
INIT_HLIST_HEAD(f-hash[i]);
 
-   INIT_LIST_HEAD(f-lru_list);
rwlock_init(f-lock);
 
f-rnd = (u32) ((num_physpages ^ (num_physpages7)) ^
@@ -74,6 +73,7 @@ void inet_frags_init_net(struct netns_frags *nf)
 {
nf-nqueues = 0;
atomic_set(nf-mem, 0);
+   INIT_LIST_HEAD(nf-lru_list);
 }
 EXPORT_SYMBOL(inet_frags_init_net);
 
@@ -156,12 +156,12 @@ int inet_frag_evictor(struct netns_frags *nf, struct 
inet_frags *f)
work = atomic_read(nf-mem) - nf-low_thresh;
while (work  0) {
read_lock(f-lock);
-   if (list_empty(f-lru_list)) {
+   if (list_empty(nf-lru_list)) {
read_unlock(f-lock);
break;
}
 
-   q = list_first_entry(f-lru_list,
+   q = list_first_entry(nf-lru_list,
struct inet_frag_queue, lru_list);
atomic_inc(q-refcnt);
read_unlock(f-lock);
@@ -211,7 +211,7 @@ static struct inet_frag_queue *inet_frag_intern(struct 
netns_frags *nf,
 
atomic_inc(qp-refcnt);
hlist_add_head(qp-list, f-hash[hash]);
-   list_add_tail(qp-lru_list, f-lru_list);
+   list_add_tail(qp-lru_list, nf-lru_list);
nf-nqueues++;
write_unlock(f-lock);
return qp;
diff --git a/net/ipv4/ip_fragment.c b/net/ipv4/ip_fragment.c
index 00646ed..29b4b09 100644
--- a/net/ipv4/ip_fragment.c
+++ b/net/ipv4/ip_fragment.c
@@ -441,7 +441,7 @@ static int ip_frag_queue(struct ipq *qp, struct sk_buff 
*skb)
return ip_frag_reasm(qp, prev, dev);
 
write_lock(ip4_frags.lock);
-   list_move_tail(qp-q.lru_list, ip4_frags.lru_list);
+   list_move_tail(qp-q.lru_list, qp-q.net-lru_list);
write_unlock(ip4_frags.lock);
return -EINPROGRESS;
 
diff --git a/net/ipv6/netfilter/nf_conntrack_reasm.c 
b/net/ipv6/netfilter/nf_conntrack_reasm.c
index 6eed991..022da6c 100644
--- a/net/ipv6/netfilter/nf_conntrack_reasm.c
+++ b/net/ipv6/netfilter/nf_conntrack_reasm.c
@@ -385,7 +385,7 @@ static int nf_ct_frag6_queue(struct nf_ct_frag6_queue *fq, 
struct sk_buff *skb,
fq-q.last_in |= FIRST_IN;
}
write_lock(nf_frags.lock);
-   list_move_tail(fq-q.lru_list, nf_frags.lru_list);
+   list_move_tail(fq-q.lru_list, nf_init_frags.lru_list);
write_unlock(nf_frags.lock);
return 0;
 
diff --git a/net/ipv6/reassembly.c b/net/ipv6/reassembly.c
index 8520700..0c4bc46 100644
--- a/net/ipv6/reassembly.c
+++ b/net/ipv6/reassembly.c
@@ -424,7 +424,7 @@ static int ip6_frag_queue(struct frag_queue *fq, struct 
sk_buff *skb,
return ip6_frag_reasm(fq, prev, dev);
 
write_lock(ip6_frags.lock);
-   

[NETNS][FRAGS]: Make the net.ipv4.ipfrag_timeout work in namespaces.

2008-01-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b2fd5321dd160ef309dfb6cfc78ed8de4a830659
Commit: b2fd5321dd160ef309dfb6cfc78ed8de4a830659
Parent: e4a2d5c2bccd5bd29de5ae4f14ff4448fac9cfc8
Author: Pavel Emelyanov [EMAIL PROTECTED]
AuthorDate: Tue Jan 22 06:09:37 2008 -0800
Committer:  David S. Miller [EMAIL PROTECTED]
CommitDate: Mon Jan 28 15:10:37 2008 -0800

[NETNS][FRAGS]: Make the net.ipv4.ipfrag_timeout work in namespaces.

Move it to the netns_frags, adjust the usage and
make the appropriate ctl table writable.

Now fragment, that live in different namespaces can
live for different times.

Signed-off-by: Pavel Emelyanov [EMAIL PROTECTED]
Signed-off-by: David S. Miller [EMAIL PROTECTED]
---
 include/net/inet_frag.h |4 +++-
 net/ipv4/inet_fragment.c|2 +-
 net/ipv4/ip_fragment.c  |   20 ++--
 net/ipv6/netfilter/nf_conntrack_reasm.c |4 ++--
 net/ipv6/reassembly.c   |6 +++---
 5 files changed, 19 insertions(+), 17 deletions(-)

diff --git a/include/net/inet_frag.h b/include/net/inet_frag.h
index 6edce7b..f56e296 100644
--- a/include/net/inet_frag.h
+++ b/include/net/inet_frag.h
@@ -4,6 +4,9 @@
 struct netns_frags {
int nqueues;
atomic_tmem;
+
+   /* sysctls */
+   int timeout;
 };
 
 struct inet_frag_queue {
@@ -29,7 +32,6 @@ struct inet_frag_queue {
 struct inet_frags_ctl {
int high_thresh;
int low_thresh;
-   int timeout;
int secret_interval;
 };
 
diff --git a/net/ipv4/inet_fragment.c b/net/ipv4/inet_fragment.c
index ad79ae0..9da9679 100644
--- a/net/ipv4/inet_fragment.c
+++ b/net/ipv4/inet_fragment.c
@@ -206,7 +206,7 @@ static struct inet_frag_queue *inet_frag_intern(struct 
netns_frags *nf,
}
 #endif
qp = qp_in;
-   if (!mod_timer(qp-timer, jiffies + f-ctl-timeout))
+   if (!mod_timer(qp-timer, jiffies + nf-timeout))
atomic_inc(qp-refcnt);
 
atomic_inc(qp-refcnt);
diff --git a/net/ipv4/ip_fragment.c b/net/ipv4/ip_fragment.c
index c51e1a1..70d241c 100644
--- a/net/ipv4/ip_fragment.c
+++ b/net/ipv4/ip_fragment.c
@@ -83,13 +83,6 @@ static struct inet_frags_ctl ip4_frags_ctl __read_mostly = {
 */
.high_thresh = 256 * 1024,
.low_thresh  = 192 * 1024,
-
-   /*
-* Important NOTE! Fragment queue must be destroyed before MSL expires.
-* RFC791 is wrong proposing to prolongate timer each fragment arrival
-* by TTL.
-*/
-   .timeout = IP_FRAG_TIME,
.secret_interval = 10 * 60 * HZ,
 };
 
@@ -287,7 +280,7 @@ static int ip_frag_reinit(struct ipq *qp)
 {
struct sk_buff *fp;
 
-   if (!mod_timer(qp-q.timer, jiffies + ip4_frags_ctl.timeout)) {
+   if (!mod_timer(qp-q.timer, jiffies + qp-q.net-timeout)) {
atomic_inc(qp-q.refcnt);
return -ETIMEDOUT;
}
@@ -633,7 +626,7 @@ static struct ctl_table ip4_frags_ctl_table[] = {
{
.ctl_name   = NET_IPV4_IPFRAG_TIME,
.procname   = ipfrag_time,
-   .data   = ip4_frags_ctl.timeout,
+   .data   = init_net.ipv4.frags.timeout,
.maxlen = sizeof(int),
.mode   = 0644,
.proc_handler   = proc_dointvec_jiffies,
@@ -672,7 +665,7 @@ static int ip4_frags_ctl_register(struct net *net)
 
table[0].mode = ~0222;
table[1].mode = ~0222;
-   table[2].mode = ~0222;
+   table[2].data = net-ipv4.frags.timeout;
table[3].mode = ~0222;
table[4].mode = ~0222;
}
@@ -712,6 +705,13 @@ static inline void ip4_frags_ctl_unregister(struct net 
*net)
 
 static int ipv4_frags_init_net(struct net *net)
 {
+   /*
+* Important NOTE! Fragment queue must be destroyed before MSL expires.
+* RFC791 is wrong proposing to prolongate timer each fragment arrival
+* by TTL.
+*/
+   net-ipv4.frags.timeout = IP_FRAG_TIME;
+
inet_frags_init_net(net-ipv4.frags);
 
return ip4_frags_ctl_register(net);
diff --git a/net/ipv6/netfilter/nf_conntrack_reasm.c 
b/net/ipv6/netfilter/nf_conntrack_reasm.c
index cb826be..92a311f 100644
--- a/net/ipv6/netfilter/nf_conntrack_reasm.c
+++ b/net/ipv6/netfilter/nf_conntrack_reasm.c
@@ -73,7 +73,6 @@ struct nf_ct_frag6_queue
 static struct inet_frags_ctl nf_frags_ctl __read_mostly = {
.high_thresh = 256 * 1024,
.low_thresh  = 192 * 1024,
-   .timeout = IPV6_FRAG_TIMEOUT,
.secret_interval = 10 * 60 * HZ,
 };
 
@@ -84,7 +83,7 @@ static struct netns_frags nf_init_frags;
 struct ctl_table nf_ct_ipv6_sysctl_table[] = {
{
.procname   = 

[IPV6] NDISC: Sparse: Use different variable name for local use.

2008-01-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=61cf46ad581ba43073d3bcb0be549eb60fbbf9f8
Commit: 61cf46ad581ba43073d3bcb0be549eb60fbbf9f8
Parent: 5d5619b40c2474de01c64bdf6bb9f1211d3e967a
Author: YOSHIFUJI Hideaki [EMAIL PROTECTED]
AuthorDate: Tue Jan 22 17:32:53 2008 +0900
Committer:  David S. Miller [EMAIL PROTECTED]
CommitDate: Mon Jan 28 15:10:28 2008 -0800

[IPV6] NDISC: Sparse: Use different variable name for local use.

Fix the following sparse warnings:
| net/ipv6/ndisc.c:1300:21: warning: symbol 'opt' shadows an earlier one
| net/ipv6/ndisc.c:1078:7: originally declared here

Signed-off-by: YOSHIFUJI Hideaki [EMAIL PROTECTED]
---
 net/ipv6/ndisc.c |   10 +-
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c
index bdfc4ea..0d33a7d 100644
--- a/net/ipv6/ndisc.c
+++ b/net/ipv6/ndisc.c
@@ -1297,11 +1297,11 @@ skip_defrtr:
}
 
if (ndopts.nd_useropts) {
-   struct nd_opt_hdr *opt;
-   for (opt = ndopts.nd_useropts;
-opt;
-opt = ndisc_next_useropt(opt, ndopts.nd_useropts_end)) {
-   ndisc_ra_useropt(skb, opt);
+   struct nd_opt_hdr *p;
+   for (p = ndopts.nd_useropts;
+p;
+p = ndisc_next_useropt(p, ndopts.nd_useropts_end)) {
+   ndisc_ra_useropt(skb, p);
}
}
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[NETNS]: Add netns parameter to fib_lookup.

2008-01-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=da0e28cb68a7e22b47c6ae1a5b12cb538c13c69f
Commit: da0e28cb68a7e22b47c6ae1a5b12cb538c13c69f
Parent: ba93ef746560df597b19bbcee04ce7ed70ebc700
Author: Denis V. Lunev [EMAIL PROTECTED]
AuthorDate: Mon Jan 21 17:31:55 2008 -0800
Committer:  David S. Miller [EMAIL PROTECTED]
CommitDate: Mon Jan 28 15:10:19 2008 -0800

[NETNS]: Add netns parameter to fib_lookup.

Signed-off-by: Denis V. Lunev [EMAIL PROTECTED]
Signed-off-by: David S. Miller [EMAIL PROTECTED]
---
 include/net/ip_fib.h |9 +
 net/ipv4/fib_frontend.c  |4 ++--
 net/ipv4/fib_rules.c |4 ++--
 net/ipv4/fib_semantics.c |2 +-
 net/ipv4/route.c |6 +++---
 5 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/include/net/ip_fib.h b/include/net/ip_fib.h
index f580542..a859124 100644
--- a/include/net/ip_fib.h
+++ b/include/net/ip_fib.h
@@ -178,15 +178,16 @@ static inline struct fib_table *fib_new_table(struct net 
*net, u32 id)
return fib_get_table(net, id);
 }
 
-static inline int fib_lookup(const struct flowi *flp, struct fib_result *res)
+static inline int fib_lookup(struct net *net, const struct flowi *flp,
+struct fib_result *res)
 {
struct fib_table *table;
 
-   table = fib_get_table(init_net, RT_TABLE_LOCAL);
+   table = fib_get_table(net, RT_TABLE_LOCAL);
if (!table-tb_lookup(table, flp, res))
return 0;
 
-   table = fib_get_table(init_net, RT_TABLE_MAIN);
+   table = fib_get_table(net, RT_TABLE_MAIN);
if (!table-tb_lookup(table, flp, res))
return 0;
return -ENETUNREACH;
@@ -208,7 +209,7 @@ extern void __net_exit fib4_rules_exit(struct net *net);
 extern u32 fib_rules_tclass(struct fib_result *res);
 #endif
 
-extern int fib_lookup(struct flowi *flp, struct fib_result *res);
+extern int fib_lookup(struct net *n, struct flowi *flp, struct fib_result 
*res);
 
 extern struct fib_table *fib_new_table(struct net *net, u32 id);
 extern struct fib_table *fib_get_table(struct net *net, u32 id);
diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c
index 8987046..e056154 100644
--- a/net/ipv4/fib_frontend.c
+++ b/net/ipv4/fib_frontend.c
@@ -241,7 +241,7 @@ int fib_validate_source(__be32 src, __be32 dst, u8 tos, int 
oif,
if (in_dev == NULL)
goto e_inval;
 
-   if (fib_lookup(fl, res))
+   if (fib_lookup(init_net, fl, res))
goto last_resort;
if (res.type != RTN_UNICAST)
goto e_inval_res;
@@ -265,7 +265,7 @@ int fib_validate_source(__be32 src, __be32 dst, u8 tos, int 
oif,
fl.oif = dev-ifindex;
 
ret = 0;
-   if (fib_lookup(fl, res) == 0) {
+   if (fib_lookup(init_net, fl, res) == 0) {
if (res.type == RTN_UNICAST) {
*spec_dst = FIB_RES_PREFSRC(res);
ret = FIB_RES_NH(res).nh_scope = RT_SCOPE_HOST;
diff --git a/net/ipv4/fib_rules.c b/net/ipv4/fib_rules.c
index d2001f1..1effb4a 100644
--- a/net/ipv4/fib_rules.c
+++ b/net/ipv4/fib_rules.c
@@ -54,14 +54,14 @@ u32 fib_rules_tclass(struct fib_result *res)
 }
 #endif
 
-int fib_lookup(struct flowi *flp, struct fib_result *res)
+int fib_lookup(struct net *net, struct flowi *flp, struct fib_result *res)
 {
struct fib_lookup_arg arg = {
.result = res,
};
int err;
 
-   err = fib_rules_lookup(init_net.ipv4.rules_ops, flp, 0, arg);
+   err = fib_rules_lookup(net-ipv4.rules_ops, flp, 0, arg);
res-r = arg.rule;
 
return err;
diff --git a/net/ipv4/fib_semantics.c b/net/ipv4/fib_semantics.c
index 0e08df4..ecd91c6 100644
--- a/net/ipv4/fib_semantics.c
+++ b/net/ipv4/fib_semantics.c
@@ -559,7 +559,7 @@ static int fib_check_nh(struct fib_config *cfg, struct 
fib_info *fi,
/* It is not necessary, but requires a bit of thinking 
*/
if (fl.fl4_scope  RT_SCOPE_LINK)
fl.fl4_scope = RT_SCOPE_LINK;
-   if ((err = fib_lookup(fl, res)) != 0)
+   if ((err = fib_lookup(init_net, fl, res)) != 0)
return err;
}
err = -EINVAL;
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index f80c761..a7651c6 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -1559,7 +1559,7 @@ void ip_rt_get_source(u8 *addr, struct rtable *rt)
 
if (rt-fl.iif == 0)
src = rt-rt_src;
-   else if (fib_lookup(rt-fl, res) == 0) {
+   else if (fib_lookup(init_net, rt-fl, res) == 0) {
src = FIB_RES_PREFSRC(res);
fib_res_put(res);
} else
@@ -1911,7 +1911,7 @@ static int ip_route_input_slow(struct sk_buff *skb, 
__be32 daddr, __be32 saddr,
/*
 *  Now we are ready to route packet.
 

[BNX2]: Disable jumbo rx paging on 5709 Ax.

2008-01-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=2dd201d7b735f252df1a915a3f2e6a71910a3d87
Commit: 2dd201d7b735f252df1a915a3f2e6a71910a3d87
Parent: 819d772b0ceddebb5b4907d5aa5505c99aec985b
Author: Michael Chan [EMAIL PROTECTED]
AuthorDate: Mon Jan 21 17:06:09 2008 -0800
Committer:  David S. Miller [EMAIL PROTECTED]
CommitDate: Mon Jan 28 15:10:13 2008 -0800

[BNX2]: Disable jumbo rx paging on 5709 Ax.

The chip has problem running in this mode and needs to be disabled.

Signed-off-by: Michael Chan [EMAIL PROTECTED]
Signed-off-by: David S. Miller [EMAIL PROTECTED]
---
 drivers/net/bnx2.c |4 +++-
 drivers/net/bnx2.h |1 +
 2 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c
index 3bb69d5..4473461 100644
--- a/drivers/net/bnx2.c
+++ b/drivers/net/bnx2.c
@@ -4669,7 +4669,7 @@ bnx2_set_rx_ring_size(struct bnx2 *bp, u32 size)
bp-rx_pg_ring_size = 0;
bp-rx_max_pg_ring = 0;
bp-rx_max_pg_ring_idx = 0;
-   if (rx_space  PAGE_SIZE) {
+   if ((rx_space  PAGE_SIZE)  !(bp-flags  JUMBO_BROKEN_FLAG)) {
int pages = PAGE_ALIGN(bp-dev-mtu - 40)  PAGE_SHIFT;
 
jumbo_size = size * pages;
@@ -7031,6 +7031,8 @@ bnx2_init_board(struct pci_dev *pdev, struct net_device 
*dev)
goto err_out_unmap;
}
bp-flags |= PCIE_FLAG;
+   if (CHIP_REV(bp) == CHIP_REV_Ax)
+   bp-flags |= JUMBO_BROKEN_FLAG;
} else {
bp-pcix_cap = pci_find_capability(pdev, PCI_CAP_ID_PCIX);
if (bp-pcix_cap == 0) {
diff --git a/drivers/net/bnx2.h b/drivers/net/bnx2.h
index 09bd665..c1ab30b 100644
--- a/drivers/net/bnx2.h
+++ b/drivers/net/bnx2.h
@@ -6582,6 +6582,7 @@ struct bnx2 {
 #define PCIE_FLAG  0x0200
 #define USING_MSIX_FLAG0x0400
 #define USING_MSI_OR_MSIX_FLAG (USING_MSI_FLAG | USING_MSIX_FLAG)
+#define JUMBO_BROKEN_FLAG  0x0800
 
/* Put tx producer and consumer fields in separate cache lines. */
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


b43/nphy.c: include headers to avoid build breakage on some platforms

2008-01-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=819d772b0ceddebb5b4907d5aa5505c99aec985b
Commit: 819d772b0ceddebb5b4907d5aa5505c99aec985b
Parent: 73738001ac8fb1d006157e9ce89458a135c7571f
Author: John W. Linville [EMAIL PROTECTED]
AuthorDate: Thu Jan 17 16:57:10 2008 -0500
Committer:  David S. Miller [EMAIL PROTECTED]
CommitDate: Mon Jan 28 15:10:13 2008 -0800

b43/nphy.c: include headers to avoid build breakage on some platforms

Signed-off-by: John W. Linville [EMAIL PROTECTED]
---
 drivers/net/wireless/b43/nphy.c |3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/drivers/net/wireless/b43/nphy.c b/drivers/net/wireless/b43/nphy.c
index 96a052e..0b421b1 100644
--- a/drivers/net/wireless/b43/nphy.c
+++ b/drivers/net/wireless/b43/nphy.c
@@ -22,6 +22,9 @@
 
 */
 
+#include linux/delay.h
+#include linux/types.h
+
 #include b43.h
 #include nphy.h
 #include tables_nphy.h
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


libertas: don't blindly try mesh

2008-01-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=c9d1be36197bf638be68cec6685c68e462273b65
Commit: c9d1be36197bf638be68cec6685c68e462273b65
Parent: dac10a9f286c75cffa75c7ec8b05d566a6ece95e
Author: Holger Schurig [EMAIL PROTECTED]
AuthorDate: Wed Jan 16 15:57:44 2008 +0100
Committer:  David S. Miller [EMAIL PROTECTED]
CommitDate: Mon Jan 28 15:10:06 2008 -0800

libertas: don't blindly try mesh

The CF card only has a very old firmware (5.0.16p0). This firmware doesn't
know anything about mesh config. However, current code blindly calls
mesh_config when the card is inserted. So check the firmware version before
issuing this command.

Signed-off-by: Holger Schurig [EMAIL PROTECTED]
Signed-off-by: John W. Linville [EMAIL PROTECTED]
---
 drivers/net/wireless/libertas/main.c |   50 ++---
 1 files changed, 27 insertions(+), 23 deletions(-)

diff --git a/drivers/net/wireless/libertas/main.c 
b/drivers/net/wireless/libertas/main.c
index 91b2f23..8f3e661 100644
--- a/drivers/net/wireless/libertas/main.c
+++ b/drivers/net/wireless/libertas/main.c
@@ -1192,31 +1192,35 @@ int lbs_start_card(struct lbs_private *priv)
if (device_create_file(dev-dev, dev_attr_lbs_rtap))
lbs_pr_err(cannot register lbs_rtap attribute\n);
 
-   /* Enable mesh, if supported, and work out which TLV it uses.
-  0x100 + 291 is an unofficial value used in 5.110.20.pXX
-  0x100 + 37 is the official value used in 5.110.21.pXX
-  but we check them in that order because 20.pXX doesn't
-  give an error -- it just silently fails. */
-
-   /* 5.110.20.pXX firmware will fail the command if the channel
-  doesn't match the existing channel. But only if the TLV
-  is correct. If the channel is wrong, _BOTH_ versions will
-  give an error to 0x100+291, and allow 0x100+37 to succeed.
-  It's just that 5.110.20.pXX will not have done anything
-  useful */
-
lbs_update_channel(priv);
-   priv-mesh_tlv = 0x100 + 291;
-   if (lbs_mesh_config(priv, 1, priv-curbssparams.channel)) {
-   priv-mesh_tlv = 0x100 + 37;
-   if (lbs_mesh_config(priv, 1, priv-curbssparams.channel))
-   priv-mesh_tlv = 0;
-   }
-   if (priv-mesh_tlv) {
-   lbs_add_mesh(priv);
 
-   if (device_create_file(dev-dev, dev_attr_lbs_mesh))
-   lbs_pr_err(cannot register lbs_mesh attribute\n);
+   /* 5.0.16p0 is known to NOT support any mesh */
+   if (priv-fwrelease  0x05001000) {
+   /* Enable mesh, if supported, and work out which TLV it uses.
+  0x100 + 291 is an unofficial value used in 5.110.20.pXX
+  0x100 + 37 is the official value used in 5.110.21.pXX
+  but we check them in that order because 20.pXX doesn't
+  give an error -- it just silently fails. */
+
+   /* 5.110.20.pXX firmware will fail the command if the channel
+  doesn't match the existing channel. But only if the TLV
+  is correct. If the channel is wrong, _BOTH_ versions will
+  give an error to 0x100+291, and allow 0x100+37 to succeed.
+  It's just that 5.110.20.pXX will not have done anything
+  useful */
+
+   priv-mesh_tlv = 0x100 + 291;
+   if (lbs_mesh_config(priv, 1, priv-curbssparams.channel)) {
+   priv-mesh_tlv = 0x100 + 37;
+   if (lbs_mesh_config(priv, 1, 
priv-curbssparams.channel))
+   priv-mesh_tlv = 0;
+   }
+   if (priv-mesh_tlv) {
+   lbs_add_mesh(priv);
+
+   if (device_create_file(dev-dev, dev_attr_lbs_mesh))
+   lbs_pr_err(cannot register lbs_mesh 
attribute\n);
+   }
}
 
lbs_debugfs_init_one(priv, dev);
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


iwlwifi: delay firmware loading from pci_probe to network interface open

2008-01-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=5a66926aa9230810704fd5a127966215fd58881e
Commit: 5a66926aa9230810704fd5a127966215fd58881e
Parent: 3058f02137359efb412975cf94a9fa7c25413387
Author: Zhu Yi [EMAIL PROTECTED]
AuthorDate: Mon Jan 14 17:46:18 2008 -0800
Committer:  David S. Miller [EMAIL PROTECTED]
CommitDate: Mon Jan 28 15:09:57 2008 -0800

iwlwifi: delay firmware loading from pci_probe to network interface open

This patch moves the firmware loading (read firmware from disk and load
it into the device SRAM) from pci_probe time to the first network
interface open time. There are two reasons for doing this:

1. To support kernel buildin iwlwifi drivers. Because kernel initializes
   network devices subsystem before hard disk and SATA subsystem, it is
   impossible to get the firmware image from hard disk in the PCI probe
   handler. Thus delaying the firmware loading into the network
   interface open time is the way to go. Note, we only read the firmware
   image from hard disk the first time the interface is open. After this
   is succeeded, we cache the firmware image into the host memory. This
   is a performance gain when user open and close the interface multiple
   times and is necessary for device suspend and resume.

2. For better power saving. When the iwlwifi modules are loaded (or
   buildin the kernel) but the wireless network interface is not being
   used, it is a good practice the wireless device consumes as less
   power as possible. Unloading the firmware from the wireless device
   and unregister the driver's interrupt handler in the network
   interface close handler provides users a way to achieve this. User
   space network configuration tools (i.e NetworkManager) can also
   contribute here when it detects a wired cable is connected and
   close the wireless interface automatically.

This patch also includes the pci_save/restore_state() fixed by Ian Schram
upon the first version.

Signed-off-by: Zhu Yi [EMAIL PROTECTED]
Signed-off-by: Ian Schram [EMAIL PROTECTED]
Signed-off-by: John W. Linville [EMAIL PROTECTED]
---
 drivers/net/wireless/iwlwifi/iwl-3945.c |8 -
 drivers/net/wireless/iwlwifi/iwl-4965.c |5 -
 drivers/net/wireless/iwlwifi/iwl3945-base.c |  183 +++---
 drivers/net/wireless/iwlwifi/iwl4965-base.c |  187 ---
 4 files changed, 217 insertions(+), 166 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl-3945.c 
b/drivers/net/wireless/iwlwifi/iwl-3945.c
index 77e7202..0779a23 100644
--- a/drivers/net/wireless/iwlwifi/iwl-3945.c
+++ b/drivers/net/wireless/iwlwifi/iwl-3945.c
@@ -1004,14 +1004,6 @@ int iwl3945_hw_nic_init(struct iwl3945_priv *priv)
CSR_HW_IF_CONFIG_REG_BIT_ALMAGOR_MM);
}
 
-   spin_unlock_irqrestore(priv-lock, flags);
-
-   /* Initialize the EEPROM */
-   rc = iwl3945_eeprom_init(priv);
-   if (rc)
-   return rc;
-
-   spin_lock_irqsave(priv-lock, flags);
if (EEPROM_SKU_CAP_OP_MODE_MRC == priv-eeprom.sku_cap) {
IWL_DEBUG_INFO(SKU OP mode is mrc\n);
iwl3945_set_bit(priv, CSR_HW_IF_CONFIG_REG,
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.c 
b/drivers/net/wireless/iwlwifi/iwl-4965.c
index e6a0397..5fcc2a6 100644
--- a/drivers/net/wireless/iwlwifi/iwl-4965.c
+++ b/drivers/net/wireless/iwlwifi/iwl-4965.c
@@ -506,11 +506,6 @@ int iwl4965_hw_nic_init(struct iwl4965_priv *priv)
 
spin_unlock_irqrestore(priv-lock, flags);
 
-   /* Read the EEPROM */
-   rc = iwl4965_eeprom_init(priv);
-   if (rc)
-   return rc;
-
if (priv-eeprom.calib_version  EEPROM_TX_POWER_VERSION_NEW) {
IWL_ERROR(Older EEPROM detected!  Aborting.\n);
return -EINVAL;
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c 
b/drivers/net/wireless/iwlwifi/iwl3945-base.c
index 1830e13..e0e9bbd 100644
--- a/drivers/net/wireless/iwlwifi/iwl3945-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c
@@ -6179,31 +6179,12 @@ static void iwl3945_alive_start(struct iwl3945_priv 
*priv)
}
 
iwl3945_init_geos(priv);
+   iwl3945_reset_channel_flag(priv);
 
if (iwl3945_is_rfkill(priv))
return;
 
-   if (!priv-mac80211_registered) {
-   /* Unlock so any user space entry points can call back into
-* the driver without a deadlock... */
-   mutex_unlock(priv-mutex);
-   iwl3945_rate_control_register(priv-hw);
-   rc = ieee80211_register_hw(priv-hw);
-   priv-hw-conf.beacon_int = 100;
-   mutex_lock(priv-mutex);
-
-   if (rc) {
-   iwl3945_rate_control_unregister(priv-hw);
-   IWL_ERROR(Failed 

ath5k: Fix frame duration oops

2008-01-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=132127e5057be70112bb974b8a3aaa0f7b14847f
Commit: 132127e5057be70112bb974b8a3aaa0f7b14847f
Parent: 4fd6931ebe24640bec72b91ba612325843a5e3cc
Author: Luis R. Rodriguez [EMAIL PROTECTED]
AuthorDate: Fri Jan 4 02:21:05 2008 -0500
Committer:  David S. Miller [EMAIL PROTECTED]
CommitDate: Mon Jan 28 15:09:40 2008 -0800

ath5k: Fix frame duration oops

This patch fixes an oops which was introduced as a regression by
commit fd640775bd16e1df50c867cc547af0, on the patch titled,
mac80211: dont use interface indices in drivers.

ieee80211_generic_frame_duration() now relies on sdata-flags which
itself gets set upon bringing the interface up. We check for the
virtual interface now before setting the rate duration registers.

After the mode changes are introduced onto mac80211 we should revisit
these changes.

This patch was tested on the following cards:

1) BG card:

Atheros AR5213A chip found (MAC: 0x59, PHY: 0x43)
RF2112A 2GHz radio found (0x46)

2) ABG card:

Atheros AR5213A chip found (MAC: 0x59,PHY: 0x43)
RF5112A multiband radio found (0x36)

Signed-off-by: Luis R. Rodriguez [EMAIL PROTECTED]
Signed-off-by: John W. Linville [EMAIL PROTECTED]
---
 drivers/net/wireless/ath5k/hw.c |8 ++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/ath5k/hw.c b/drivers/net/wireless/ath5k/hw.c
index 3b93363..eb00818 100644
--- a/drivers/net/wireless/ath5k/hw.c
+++ b/drivers/net/wireless/ath5k/hw.c
@@ -734,8 +734,12 @@ int ath5k_hw_reset(struct ath5k_hw *ah, enum 
ieee80211_if_types op_mode,
if (ret)
return ret;
 
-   /* Write rate duration table */
-   if (ah-ah_version == AR5K_AR5212)
+   /* Write rate duration table only on AR5212 and if
+* virtual interface has already been brought up
+* XXX: rethink this after new mode changes to
+* mac80211 are integrated */
+   if (ah-ah_version == AR5K_AR5212 
+   ah-ah_sc-vif != NULL)
ath5k_hw_write_rate_duration(ah, driver_mode);
 
/*
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


prism54 trivial annotations

2008-01-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=0569056e0d355f5b9a45c5b16a9b0b65718d077e
Commit: 0569056e0d355f5b9a45c5b16a9b0b65718d077e
Parent: cecefb8e97695eef420aab43938c26141ab25344
Author: Al Viro [EMAIL PROTECTED]
AuthorDate: Sat Dec 22 14:29:07 2007 -0500
Committer:  David S. Miller [EMAIL PROTECTED]
CommitDate: Mon Jan 28 15:09:08 2008 -0800

prism54 trivial annotations

Signed-off-by: Al Viro [EMAIL PROTECTED]
Signed-off-by: John W. Linville [EMAIL PROTECTED]
---
 drivers/net/wireless/prism54/isl_38xx.h   |   10 
 drivers/net/wireless/prism54/islpci_eth.c |2 +-
 drivers/net/wireless/prism54/islpci_eth.h |   38 ++--
 drivers/net/wireless/prism54/islpci_mgt.h |2 +-
 4 files changed, 26 insertions(+), 26 deletions(-)

diff --git a/drivers/net/wireless/prism54/isl_38xx.h 
b/drivers/net/wireless/prism54/isl_38xx.h
index 3fadcb6..19c33d3 100644
--- a/drivers/net/wireless/prism54/isl_38xx.h
+++ b/drivers/net/wireless/prism54/isl_38xx.h
@@ -138,14 +138,14 @@ isl38xx_w32_flush(void __iomem *base, u32 val, unsigned 
long offset)
 #define MAX_FRAGMENT_SIZE_RX   1600
 
 typedef struct {
-   u32 address;/* physical address on host */
-   u16 size;   /* packet size */
-   u16 flags;  /* set of bit-wise flags */
+   __le32 address; /* physical address on host */
+   __le16 size;/* packet size */
+   __le16 flags;   /* set of bit-wise flags */
 } isl38xx_fragment;
 
 struct isl38xx_cb {
-   u32 driver_curr_frag[ISL38XX_CB_QCOUNT];
-   u32 device_curr_frag[ISL38XX_CB_QCOUNT];
+   __le32 driver_curr_frag[ISL38XX_CB_QCOUNT];
+   __le32 device_curr_frag[ISL38XX_CB_QCOUNT];
isl38xx_fragment rx_data_low[ISL38XX_CB_RX_QSIZE];
isl38xx_fragment tx_data_low[ISL38XX_CB_TX_QSIZE];
isl38xx_fragment rx_data_high[ISL38XX_CB_RX_QSIZE];
diff --git a/drivers/net/wireless/prism54/islpci_eth.c 
b/drivers/net/wireless/prism54/islpci_eth.c
index f49eb06..762e85b 100644
--- a/drivers/net/wireless/prism54/islpci_eth.c
+++ b/drivers/net/wireless/prism54/islpci_eth.c
@@ -471,7 +471,7 @@ islpci_eth_receive(islpci_private *priv)
wmb();
 
/* increment the driver read pointer */
-   add_le32p((u32 *) control_block-
+   add_le32p(control_block-
  driver_curr_frag[ISL38XX_CB_RX_DATA_LQ], 1);
}
 
diff --git a/drivers/net/wireless/prism54/islpci_eth.h 
b/drivers/net/wireless/prism54/islpci_eth.h
index 5bf820d..61454d3 100644
--- a/drivers/net/wireless/prism54/islpci_eth.h
+++ b/drivers/net/wireless/prism54/islpci_eth.h
@@ -23,15 +23,15 @@
 #include islpci_dev.h
 
 struct rfmon_header {
-   u16 unk0;   /* = 0x */
-   u16 length; /* = 0x1400 */
-   u32 clock;  /* 1MHz clock */
+   __le16 unk0;/* = 0x */
+   __le16 length;  /* = 0x1400 */
+   __le32 clock;   /* 1MHz clock */
u8 flags;
u8 unk1;
u8 rate;
u8 unk2;
-   u16 freq;
-   u16 unk3;
+   __le16 freq;
+   __le16 unk3;
u8 rssi;
u8 padding[3];
 } __attribute__ ((packed));
@@ -47,20 +47,20 @@ struct rx_annex_header {
 #define P80211CAPTURE_VERSION 0x80211001
 
 struct avs_80211_1_header {
-   uint32_t version;
-   uint32_t length;
-   uint64_t mactime;
-   uint64_t hosttime;
-   uint32_t phytype;
-   uint32_t channel;
-   uint32_t datarate;
-   uint32_t antenna;
-   uint32_t priority;
-   uint32_t ssi_type;
-   int32_t ssi_signal;
-   int32_t ssi_noise;
-   uint32_t preamble;
-   uint32_t encoding;
+   __be32 version;
+   __be32 length;
+   __be64 mactime;
+   __be64 hosttime;
+   __be32 phytype;
+   __be32 channel;
+   __be32 datarate;
+   __be32 antenna;
+   __be32 priority;
+   __be32 ssi_type;
+   __be32 ssi_signal;
+   __be32 ssi_noise;
+   __be32 preamble;
+   __be32 encoding;
 };
 
 void islpci_eth_cleanup_transmit(islpci_private *, isl38xx_control_block *);
diff --git a/drivers/net/wireless/prism54/islpci_mgt.h 
b/drivers/net/wireless/prism54/islpci_mgt.h
index fc53b58..f91a88f 100644
--- a/drivers/net/wireless/prism54/islpci_mgt.h
+++ b/drivers/net/wireless/prism54/islpci_mgt.h
@@ -86,7 +86,7 @@ extern int pc_debug;
 #define PIMFOR_FLAG_LITTLE_ENDIAN   0x02
 
 static inline void
-add_le32p(u32 * le_number, u32 add)
+add_le32p(__le32 * le_number, u32 add)
 {
*le_number = cpu_to_le32(le32_to_cpup(le_number) + add);
 }
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[NET_SCHED]: sch_ingress: remove useless printk

2008-01-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=891687649a5c44a1d53668b4f7728bf97c8db8d5
Commit: 891687649a5c44a1d53668b4f7728bf97c8db8d5
Parent: 13893567358a8426d03ac3c613befc55431f23ce
Author: Patrick McHardy [EMAIL PROTECTED]
AuthorDate: Mon Jan 21 00:14:05 2008 -0800
Committer:  David S. Miller [EMAIL PROTECTED]
CommitDate: Mon Jan 28 15:08:22 2008 -0800

[NET_SCHED]: sch_ingress: remove useless printk

The printk about ingress qdisc registration error can't be triggered
under normal circumstances. Since register_qdisc only fails for two
identical registrations, the only way to trigger it is by loading the
sch_ingress modules multiple times under different names, in which
case we already return -EEXIST to userspace.

Signed-off-by: Patrick McHardy [EMAIL PROTECTED]
Acked-by: Jamal Hadi Salim [EMAIL PROTECTED]
Signed-off-by: David S. Miller [EMAIL PROTECTED]
---
 net/sched/sch_ingress.c |9 +
 1 files changed, 1 insertions(+), 8 deletions(-)

diff --git a/net/sched/sch_ingress.c b/net/sched/sch_ingress.c
index 4c7f7e7..7252571 100644
--- a/net/sched/sch_ingress.c
+++ b/net/sched/sch_ingress.c
@@ -221,14 +221,7 @@ static struct Qdisc_ops ingress_qdisc_ops __read_mostly = {
 
 static int __init ingress_module_init(void)
 {
-   int ret = 0;
-
-   if ((ret = register_qdisc(ingress_qdisc_ops))  0) {
-   printk(Unable to register Ingress qdisc\n);
-   return ret;
-   }
-
-   return ret;
+   return register_qdisc(ingress_qdisc_ops);
 }
 
 static void __exit ingress_module_exit(void)
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[NET_SCHED]: sch_ingress: formatting fixes

2008-01-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=58f4df423ee3e7ee33022d84bbd69561b03344a9
Commit: 58f4df423ee3e7ee33022d84bbd69561b03344a9
Parent: 6f9e98f7a96fdf4d621b8241d5a8a55c692de373
Author: Patrick McHardy [EMAIL PROTECTED]
AuthorDate: Mon Jan 21 00:11:01 2008 -0800
Committer:  David S. Miller [EMAIL PROTECTED]
CommitDate: Mon Jan 28 15:08:17 2008 -0800

[NET_SCHED]: sch_ingress: formatting fixes

Signed-off-by: Patrick McHardy [EMAIL PROTECTED]
Acked-by: Jamal Hadi Salim [EMAIL PROTECTED]
Signed-off-by: David S. Miller [EMAIL PROTECTED]
---
 net/sched/sch_ingress.c |  103 ++-
 1 files changed, 39 insertions(+), 64 deletions(-)

diff --git a/net/sched/sch_ingress.c b/net/sched/sch_ingress.c
index 89c32a9..4880d44 100644
--- a/net/sched/sch_ingress.c
+++ b/net/sched/sch_ingress.c
@@ -22,23 +22,20 @@
 #undef DEBUG_INGRESS
 
 #ifdef DEBUG_INGRESS  /* control */
-#define DPRINTK(format,args...) printk(KERN_DEBUG format,##args)
+#define DPRINTK(format, args...) printk(KERN_DEBUG format,##args)
 #else
-#define DPRINTK(format,args...)
+#define DPRINTK(format, args...)
 #endif
 
 #if 0  /* data */
-#define D2PRINTK(format,args...) printk(KERN_DEBUG format,##args)
+#define D2PRINTK(format, args...) printk(KERN_DEBUG format,##args)
 #else
-#define D2PRINTK(format,args...)
+#define D2PRINTK(format, args...)
 #endif
 
-
 #define PRIV(sch) qdisc_priv(sch)
 
-
-/* Thanks to Doron Oz for this hack
-*/
+/* Thanks to Doron Oz for this hack */
 #ifndef CONFIG_NET_CLS_ACT
 #ifdef CONFIG_NETFILTER
 static int nf_registered;
@@ -50,12 +47,10 @@ struct ingress_qdisc_data {
struct tcf_proto*filter_list;
 };
 
-
 /* - Class/flow operations - */
 
-
-static int ingress_graft(struct Qdisc *sch,unsigned long arg,
-struct Qdisc *new,struct Qdisc **old)
+static int ingress_graft(struct Qdisc *sch, unsigned long arg,
+struct Qdisc *new, struct Qdisc **old)
 {
 #ifdef DEBUG_INGRESS
struct ingress_qdisc_data *p = PRIV(sch);
@@ -67,37 +62,33 @@ static int ingress_graft(struct Qdisc *sch,unsigned long 
arg,
return 1;
 }
 
-
 static struct Qdisc *ingress_leaf(struct Qdisc *sch, unsigned long arg)
 {
return NULL;
 }
 
-
-static unsigned long ingress_get(struct Qdisc *sch,u32 classid)
+static unsigned long ingress_get(struct Qdisc *sch, u32 classid)
 {
 #ifdef DEBUG_INGRESS
struct ingress_qdisc_data *p = PRIV(sch);
 #endif
-   DPRINTK(ingress_get(sch %p,[qdisc %p],classid %x)\n, sch, p, classid);
+   DPRINTK(ingress_get(sch %p,[qdisc %p],classid %x)\n,
+   sch, p, classid);
return TC_H_MIN(classid) + 1;
 }
 
-
 static unsigned long ingress_bind_filter(struct Qdisc *sch,
-unsigned long parent, u32 classid)
+unsigned long parent, u32 classid)
 {
return ingress_get(sch, classid);
 }
 
-
 static void ingress_put(struct Qdisc *sch, unsigned long cl)
 {
 }
 
-
 static int ingress_change(struct Qdisc *sch, u32 classid, u32 parent,
-struct rtattr **tca, unsigned long *arg)
+ struct rtattr **tca, unsigned long *arg)
 {
 #ifdef DEBUG_INGRESS
struct ingress_qdisc_data *p = PRIV(sch);
@@ -108,9 +99,7 @@ static int ingress_change(struct Qdisc *sch, u32 classid, 
u32 parent,
return 0;
 }
 
-
-
-static void ingress_walk(struct Qdisc *sch,struct qdisc_walker *walker)
+static void ingress_walk(struct Qdisc *sch, struct qdisc_walker *walker)
 {
 #ifdef DEBUG_INGRESS
struct ingress_qdisc_data *p = PRIV(sch);
@@ -119,19 +108,16 @@ static void ingress_walk(struct Qdisc *sch,struct 
qdisc_walker *walker)
DPRINTK(No effect. sch_ingress doesn't maintain classes at the 
moment);
 }
 
-
-static struct tcf_proto **ingress_find_tcf(struct Qdisc *sch,unsigned long cl)
+static struct tcf_proto **ingress_find_tcf(struct Qdisc *sch, unsigned long cl)
 {
struct ingress_qdisc_data *p = PRIV(sch);
 
return p-filter_list;
 }
 
-
 /* --- Qdisc operations  */
 
-
-static int ingress_enqueue(struct sk_buff *skb,struct Qdisc *sch)
+static int ingress_enqueue(struct sk_buff *skb, struct Qdisc *sch)
 {
struct ingress_qdisc_data *p = PRIV(sch);
struct tcf_result res;
@@ -148,20 +134,20 @@ static int ingress_enqueue(struct sk_buff *skb,struct 
Qdisc *sch)
sch-bstats.packets++;
sch-bstats.bytes += skb-len;
switch (result) {
-   case TC_ACT_SHOT:
-   result = TC_ACT_SHOT;
-   sch-qstats.drops++;
-   break;
-   case TC_ACT_STOLEN:
-   case TC_ACT_QUEUED:
-   result = TC_ACT_STOLEN;
-   break;
-   case TC_ACT_RECLASSIFY:
-   case TC_ACT_OK:
-  

b43: Add NPHY channel switch code

2008-01-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=d15913140645d9c23e8b0a9a0bb307ca889688d3
Commit: d15913140645d9c23e8b0a9a0bb307ca889688d3
Parent: 53a6e2342d73d509318836e320f70cd286acd69c
Author: Michael Buesch [EMAIL PROTECTED]
AuthorDate: Mon Jan 14 00:05:57 2008 +0100
Committer:  David S. Miller [EMAIL PROTECTED]
CommitDate: Mon Jan 28 15:09:53 2008 -0800

b43: Add NPHY channel switch code

This adds code and table data for channel switching on NPHYs.

Signed-off-by: Michael Buesch [EMAIL PROTECTED]
Signed-off-by: John W. Linville [EMAIL PROTECTED]
---
 drivers/net/wireless/b43/nphy.c|   70 ++-
 drivers/net/wireless/b43/nphy.h|3 +-
 drivers/net/wireless/b43/phy.c |   28 +-
 drivers/net/wireless/b43/tables_nphy.c | 1048 +++-
 drivers/net/wireless/b43/tables_nphy.h |   46 ++
 5 files changed, 1182 insertions(+), 13 deletions(-)

diff --git a/drivers/net/wireless/b43/nphy.c b/drivers/net/wireless/b43/nphy.c
index b427aee..96a052e 100644
--- a/drivers/net/wireless/b43/nphy.c
+++ b/drivers/net/wireless/b43/nphy.c
@@ -35,12 +35,78 @@ void b43_nphy_xmitpower(struct b43_wldev *dev)
 {//TODO
 }
 
+static void b43_chantab_radio_upload(struct b43_wldev *dev,
+const struct b43_nphy_channeltab_entry *e)
+{
+   b43_radio_write16(dev, B2055_PLL_REF, e-radio_pll_ref);
+   b43_radio_write16(dev, B2055_RF_PLLMOD0, e-radio_rf_pllmod0);
+   b43_radio_write16(dev, B2055_RF_PLLMOD1, e-radio_rf_pllmod1);
+   b43_radio_write16(dev, B2055_VCO_CAPTAIL, e-radio_vco_captail);
+   b43_radio_write16(dev, B2055_VCO_CAL1, e-radio_vco_cal1);
+   b43_radio_write16(dev, B2055_VCO_CAL2, e-radio_vco_cal2);
+   b43_radio_write16(dev, B2055_PLL_LFC1, e-radio_pll_lfc1);
+   b43_radio_write16(dev, B2055_PLL_LFR1, e-radio_pll_lfr1);
+   b43_radio_write16(dev, B2055_PLL_LFC2, e-radio_pll_lfc2);
+   b43_radio_write16(dev, B2055_LGBUF_CENBUF, e-radio_lgbuf_cenbuf);
+   b43_radio_write16(dev, B2055_LGEN_TUNE1, e-radio_lgen_tune1);
+   b43_radio_write16(dev, B2055_LGEN_TUNE2, e-radio_lgen_tune2);
+   b43_radio_write16(dev, B2055_C1_LGBUF_ATUNE, e-radio_c1_lgbuf_atune);
+   b43_radio_write16(dev, B2055_C1_LGBUF_GTUNE, e-radio_c1_lgbuf_gtune);
+   b43_radio_write16(dev, B2055_C1_RX_RFR1, e-radio_c1_rx_rfr1);
+   b43_radio_write16(dev, B2055_C1_TX_PGAPADTN, e-radio_c1_tx_pgapadtn);
+   b43_radio_write16(dev, B2055_C1_TX_MXBGTRIM, e-radio_c1_tx_mxbgtrim);
+   b43_radio_write16(dev, B2055_C2_LGBUF_ATUNE, e-radio_c2_lgbuf_atune);
+   b43_radio_write16(dev, B2055_C2_LGBUF_GTUNE, e-radio_c2_lgbuf_gtune);
+   b43_radio_write16(dev, B2055_C2_RX_RFR1, e-radio_c2_rx_rfr1);
+   b43_radio_write16(dev, B2055_C2_TX_PGAPADTN, e-radio_c2_tx_pgapadtn);
+   b43_radio_write16(dev, B2055_C2_TX_MXBGTRIM, e-radio_c2_tx_mxbgtrim);
+}
+
+static void b43_chantab_phy_upload(struct b43_wldev *dev,
+  const struct b43_nphy_channeltab_entry *e)
+{
+   b43_phy_write(dev, B43_NPHY_BW1A, e-phy_bw1a);
+   b43_phy_write(dev, B43_NPHY_BW2, e-phy_bw2);
+   b43_phy_write(dev, B43_NPHY_BW3, e-phy_bw3);
+   b43_phy_write(dev, B43_NPHY_BW4, e-phy_bw4);
+   b43_phy_write(dev, B43_NPHY_BW5, e-phy_bw5);
+   b43_phy_write(dev, B43_NPHY_BW6, e-phy_bw6);
+}
+
+static void b43_nphy_tx_power_fix(struct b43_wldev *dev)
+{
+   //TODO
+}
+
 /* Tune the hardware to a new channel. Don't call this directly.
  * Use b43_radio_selectchannel() */
-void b43_nphy_selectchannel(struct b43_wldev *dev, u8 channel)
+int b43_nphy_selectchannel(struct b43_wldev *dev, u8 channel)
 {
+   const struct b43_nphy_channeltab_entry *tabent;
 
-//TODO
+   tabent = b43_nphy_get_chantabent(dev, channel);
+   if (!tabent)
+   return -ESRCH;
+
+   //FIXME enable/disable band select upper20 in RXCTL
+   if (0 /*FIXME 5Ghz*/)
+   b43_radio_maskset(dev, B2055_MASTER1, 0xFF8F, 0x20);
+   else
+   b43_radio_maskset(dev, B2055_MASTER1, 0xFF8F, 0x50);
+   b43_chantab_radio_upload(dev, tabent);
+   udelay(50);
+   b43_radio_write16(dev, B2055_VCO_CAL10, 5);
+   b43_radio_write16(dev, B2055_VCO_CAL10, 45);
+   b43_radio_write16(dev, B2055_VCO_CAL10, 65);
+   udelay(300);
+   if (0 /*FIXME 5Ghz*/)
+   b43_phy_set(dev, B43_NPHY_BANDCTL, B43_NPHY_BANDCTL_5GHZ);
+   else
+   b43_phy_mask(dev, B43_NPHY_BANDCTL, ~B43_NPHY_BANDCTL_5GHZ);
+   b43_chantab_phy_upload(dev, tabent);
+   b43_nphy_tx_power_fix(dev);
+
+   return 0;
 }
 
 static void b43_radio_init2055_pre(struct b43_wldev *dev)
diff --git a/drivers/net/wireless/b43/nphy.h b/drivers/net/wireless/b43/nphy.h
index 812761d..896b468 100644
--- a/drivers/net/wireless/b43/nphy.h
+++ b/drivers/net/wireless/b43/nphy.h
@@ -12,6 +12,7 @@
 #define 

b44: power down PHY when interface down

2008-01-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=fedb0eefe286a6409aa2c6c6f2353c595e68d33d
Commit: fedb0eefe286a6409aa2c6c6f2353c595e68d33d
Parent: 961d57c883198831503c7be5c088a26101dfb16c
Author: Miguel Botón [EMAIL PROTECTED]
AuthorDate: Tue Jan 1 01:17:54 2008 +0100
Committer:  David S. Miller [EMAIL PROTECTED]
CommitDate: Mon Jan 28 15:09:19 2008 -0800

b44: power down PHY when interface down

This is just this patch (http://lkml.org/lkml/2007/7/1/51) but adapted
to the 'b44' ssb driver.

Signed-off-by: Miguel Botón [EMAIL PROTECTED]
Signed-off-by: John W. Linville [EMAIL PROTECTED]
---
 drivers/net/b44.c |   28 +++-
 1 files changed, 23 insertions(+), 5 deletions(-)

diff --git a/drivers/net/b44.c b/drivers/net/b44.c
index 49e9172..ea2a2b5 100644
--- a/drivers/net/b44.c
+++ b/drivers/net/b44.c
@@ -128,6 +128,8 @@ static void b44_init_rings(struct b44 *);
 #define B44_FULL_RESET 1
 #define B44_FULL_RESET_SKIP_PHY2
 #define B44_PARTIAL_RESET  3
+#define B44_CHIP_RESET_FULL4
+#define B44_CHIP_RESET_PARTIAL 5
 
 static void b44_init_hw(struct b44 *, int);
 
@@ -1259,7 +1261,7 @@ static void b44_clear_stats(struct b44 *bp)
 }
 
 /* bp-lock is held. */
-static void b44_chip_reset(struct b44 *bp)
+static void b44_chip_reset(struct b44 *bp, int reset_kind)
 {
struct ssb_device *sdev = bp-sdev;
 
@@ -1281,6 +1283,13 @@ static void b44_chip_reset(struct b44 *bp)
ssb_device_enable(bp-sdev, 0);
b44_clear_stats(bp);
 
+   /*
+* Don't enable PHY if we are doing a partial reset
+* we are probably going to power down
+*/
+   if (reset_kind == B44_CHIP_RESET_PARTIAL)
+   return;
+
switch (sdev-bus-bustype) {
case SSB_BUSTYPE_SSB:
bw32(bp, B44_MDIO_CTRL, (MDIO_CTRL_PREAMBLE |
@@ -1316,7 +1325,14 @@ static void b44_chip_reset(struct b44 *bp)
 static void b44_halt(struct b44 *bp)
 {
b44_disable_ints(bp);
-   b44_chip_reset(bp);
+   /* reset PHY */
+   b44_phy_reset(bp);
+   /* power down PHY */
+   printk(KERN_INFO PFX %s: powering down PHY\n, bp-dev-name);
+   bw32(bp, B44_MAC_CTRL, MAC_CTRL_PHY_PDOWN);
+   /* now reset the chip, but without enabling the MACPHY
+* part of it. This has to be done _after_ we shut down the PHY */
+   b44_chip_reset(bp, B44_CHIP_RESET_PARTIAL);
 }
 
 /* bp-lock is held. */
@@ -1365,7 +1381,7 @@ static void b44_init_hw(struct b44 *bp, int reset_kind)
 {
u32 val;
 
-   b44_chip_reset(bp);
+   b44_chip_reset(bp, B44_CHIP_RESET_FULL);
if (reset_kind == B44_FULL_RESET) {
b44_phy_reset(bp);
b44_setup_phy(bp);
@@ -1422,7 +1438,7 @@ static int b44_open(struct net_device *dev)
err = request_irq(dev-irq, b44_interrupt, IRQF_SHARED, dev-name, dev);
if (unlikely(err  0)) {
napi_disable(bp-napi);
-   b44_chip_reset(bp);
+   b44_chip_reset(bp, B44_CHIP_RESET_PARTIAL);
b44_free_rings(bp);
b44_free_consistent(bp);
goto out;
@@ -2188,7 +2204,7 @@ static int __devinit b44_init_one(struct ssb_device *sdev,
/* Chip reset provides power to the b44 MAC  PCI cores, which
 * is necessary for MAC register access.
 */
-   b44_chip_reset(bp);
+   b44_chip_reset(bp, B44_CHIP_RESET_FULL);
 
printk(KERN_INFO %s: Broadcom 44xx/47xx 10/100BaseT Ethernet %s\n,
   dev-name, print_mac(mac, dev-dev_addr));
@@ -2212,6 +2228,7 @@ static void __devexit b44_remove_one(struct ssb_device 
*sdev)
unregister_netdev(dev);
ssb_bus_may_powerdown(sdev-bus);
free_netdev(dev);
+   ssb_pcihost_set_power_state(sdev, PCI_D3hot);
ssb_set_drvdata(sdev, NULL);
 }
 
@@ -2240,6 +2257,7 @@ static int b44_suspend(struct ssb_device *sdev, 
pm_message_t state)
b44_setup_wol(bp);
}
 
+   ssb_pcihost_set_power_state(sdev, PCI_D3hot);
return 0;
 }
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


mac80211: move interface type to vif structure

2008-01-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=51fb61e76d952e6bc2fbdd9f0d38425fbab1cf31
Commit: 51fb61e76d952e6bc2fbdd9f0d38425fbab1cf31
Parent: 32bfd35d4b63bd63de4bb0d791ef049c3c868726
Author: Johannes Berg [EMAIL PROTECTED]
AuthorDate: Wed Dec 19 01:31:27 2007 +0100
Committer:  David S. Miller [EMAIL PROTECTED]
CommitDate: Mon Jan 28 15:09:37 2008 -0800

mac80211: move interface type to vif structure

Drivers that support mixed AP/STA operation may well need to
know the type of a virtual interface when iterating over them.
The easiest way to support that is to move the interface type
variable into the vif structure.

Signed-off-by: Johannes Berg [EMAIL PROTECTED]
Signed-off-by: John W. Linville [EMAIL PROTECTED]
---
 include/net/mac80211.h |2 +
 net/mac80211/cfg.c |2 +-
 net/mac80211/debugfs_netdev.c  |4 +-
 net/mac80211/ieee80211.c   |   36 +++---
 net/mac80211/ieee80211_i.h |1 -
 net/mac80211/ieee80211_iface.c |   10 +++---
 net/mac80211/ieee80211_ioctl.c |   65 +++
 net/mac80211/ieee80211_sta.c   |   48 +++---
 net/mac80211/key.c |6 ++--
 net/mac80211/rx.c  |   38 +++---
 net/mac80211/sta_info.c|4 +-
 net/mac80211/tx.c  |   17 +-
 net/mac80211/util.c|2 +-
 13 files changed, 118 insertions(+), 117 deletions(-)

diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 24a8ad3..8a49c06 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -535,10 +535,12 @@ enum ieee80211_if_types {
  * Data in this structure is continually present for driver
  * use during the life of a virtual interface.
  *
+ * @type: type of this virtual interface
  * @drv_priv: data area for driver use, will always be aligned to
  * sizeof(void *).
  */
 struct ieee80211_vif {
+   enum ieee80211_if_types type;
/* must be last */
u8 drv_priv[0] __attribute__((__aligned__(sizeof(void *;
 };
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 11156b3..d02d9ef 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -91,7 +91,7 @@ static int ieee80211_change_iface(struct wiphy *wiphy, int 
ifindex,
 
sdata = IEEE80211_DEV_TO_SUB_IF(dev);
 
-if (sdata-type == IEEE80211_IF_TYPE_VLAN)
+   if (sdata-vif.type == IEEE80211_IF_TYPE_VLAN)
return -EOPNOTSUPP;
 
ieee80211_if_reinit(dev);
diff --git a/net/mac80211/debugfs_netdev.c b/net/mac80211/debugfs_netdev.c
index bf715d2..d2d3c07 100644
--- a/net/mac80211/debugfs_netdev.c
+++ b/net/mac80211/debugfs_netdev.c
@@ -226,7 +226,7 @@ static void add_files(struct ieee80211_sub_if_data *sdata)
if (!sdata-debugfsdir)
return;
 
-   switch (sdata-type) {
+   switch (sdata-vif.type) {
case IEEE80211_IF_TYPE_STA:
case IEEE80211_IF_TYPE_IBSS:
add_sta_files(sdata);
@@ -353,7 +353,7 @@ void ieee80211_debugfs_add_netdev(struct 
ieee80211_sub_if_data *sdata)
 
 void ieee80211_debugfs_remove_netdev(struct ieee80211_sub_if_data *sdata)
 {
-   del_files(sdata, sdata-type);
+   del_files(sdata, sdata-vif.type);
debugfs_remove(sdata-debugfsdir);
sdata-debugfsdir = NULL;
 }
diff --git a/net/mac80211/ieee80211.c b/net/mac80211/ieee80211.c
index 42c2708..c998170 100644
--- a/net/mac80211/ieee80211.c
+++ b/net/mac80211/ieee80211.c
@@ -177,21 +177,21 @@ static int ieee80211_open(struct net_device *dev)
/*
 * check whether it may have the same address
 */
-   if (!identical_mac_addr_allowed(sdata-type,
-   nsdata-type))
+   if (!identical_mac_addr_allowed(sdata-vif.type,
+   nsdata-vif.type))
return -ENOTUNIQ;
 
/*
 * can only add VLANs to enabled APs
 */
-   if (sdata-type == IEEE80211_IF_TYPE_VLAN 
-   nsdata-type == IEEE80211_IF_TYPE_AP 
+   if (sdata-vif.type == IEEE80211_IF_TYPE_VLAN 
+   nsdata-vif.type == IEEE80211_IF_TYPE_AP 
netif_running(nsdata-dev))
sdata-u.vlan.ap = nsdata;
}
}
 
-   switch (sdata-type) {
+   switch (sdata-vif.type) {
case IEEE80211_IF_TYPE_WDS:
if (is_zero_ether_addr(sdata-u.wds.remote_addr))
return -ENOLINK;
@@ -222,7 +222,7 @@ static int ieee80211_open(struct net_device *dev)
ieee80211_led_radio(local, local-hw.conf.radio_enabled);
}
 
-  

mac80211: implement cfg80211 station handling

2008-01-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=4fd6931ebe24640bec72b91ba612325843a5e3cc
Commit: 4fd6931ebe24640bec72b91ba612325843a5e3cc
Parent: 5dfdaf58d61f06a458529430c24b1191ea4d1a27
Author: Johannes Berg [EMAIL PROTECTED]
AuthorDate: Wed Dec 19 02:03:35 2007 +0100
Committer:  David S. Miller [EMAIL PROTECTED]
CommitDate: Mon Jan 28 15:09:39 2008 -0800

mac80211: implement cfg80211 station handling

This implements station handling from userspace via cfg80211
in mac80211.

Signed-off-by: Johannes Berg [EMAIL PROTECTED]
Signed-off-by: John W. Linville [EMAIL PROTECTED]
---
 net/mac80211/cfg.c |  192 
 1 files changed, 192 insertions(+), 0 deletions(-)

diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 5a4c6ed..22c9619 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -14,6 +14,7 @@
 #include net/cfg80211.h
 #include ieee80211_i.h
 #include cfg.h
+#include ieee80211_rate.h
 
 static enum ieee80211_if_types
 nl80211_type_to_mac80211_type(enum nl80211_iftype type)
@@ -447,6 +448,194 @@ static int ieee80211_del_beacon(struct wiphy *wiphy, 
struct net_device *dev)
return ieee80211_if_config_beacon(dev);
 }
 
+/* Layer 2 Update frame (802.2 Type 1 LLC XID Update response) */
+struct iapp_layer2_update {
+   u8 da[ETH_ALEN];/* broadcast */
+   u8 sa[ETH_ALEN];/* STA addr */
+   __be16 len; /* 6 */
+   u8 dsap;/* 0 */
+   u8 ssap;/* 0 */
+   u8 control;
+   u8 xid_info[3];
+} __attribute__ ((packed));
+
+static void ieee80211_send_layer2_update(struct sta_info *sta)
+{
+   struct iapp_layer2_update *msg;
+   struct sk_buff *skb;
+
+   /* Send Level 2 Update Frame to update forwarding tables in layer 2
+* bridge devices */
+
+   skb = dev_alloc_skb(sizeof(*msg));
+   if (!skb)
+   return;
+   msg = (struct iapp_layer2_update *)skb_put(skb, sizeof(*msg));
+
+   /* 802.2 Type 1 Logical Link Control (LLC) Exchange Identifier (XID)
+* Update response frame; IEEE Std 802.2-1998, 5.4.1.2.1 */
+
+   memset(msg-da, 0xff, ETH_ALEN);
+   memcpy(msg-sa, sta-addr, ETH_ALEN);
+   msg-len = htons(6);
+   msg-dsap = 0;
+   msg-ssap = 0x01;   /* NULL LSAP, CR Bit: Response */
+   msg-control = 0xaf;/* XID response lsb.F101.
+* F=0 (no poll command; unsolicited frame) */
+   msg-xid_info[0] = 0x81;/* XID format identifier */
+   msg-xid_info[1] = 1;   /* LLC types/classes: Type 1 LLC */
+   msg-xid_info[2] = 0;   /* XID sender's receive window size (RW) */
+
+   skb-dev = sta-dev;
+   skb-protocol = eth_type_trans(skb, sta-dev);
+   memset(skb-cb, 0, sizeof(skb-cb));
+   netif_rx(skb);
+}
+
+static void sta_apply_parameters(struct ieee80211_local *local,
+struct sta_info *sta,
+struct station_parameters *params)
+{
+   u32 rates;
+   int i, j;
+   struct ieee80211_hw_mode *mode;
+
+   if (params-station_flags  STATION_FLAG_CHANGED) {
+   sta-flags = ~WLAN_STA_AUTHORIZED;
+   if (params-station_flags  STATION_FLAG_AUTHORIZED)
+   sta-flags |= WLAN_STA_AUTHORIZED;
+
+   sta-flags = ~WLAN_STA_SHORT_PREAMBLE;
+   if (params-station_flags  STATION_FLAG_SHORT_PREAMBLE)
+   sta-flags |= WLAN_STA_SHORT_PREAMBLE;
+
+   sta-flags = ~WLAN_STA_WME;
+   if (params-station_flags  STATION_FLAG_WME)
+   sta-flags |= WLAN_STA_WME;
+   }
+
+   if (params-aid) {
+   sta-aid = params-aid;
+   if (sta-aid  IEEE80211_MAX_AID)
+   sta-aid = 0; /* XXX: should this be an error? */
+   }
+
+   if (params-listen_interval = 0)
+   sta-listen_interval = params-listen_interval;
+
+   if (params-supported_rates) {
+   rates = 0;
+   mode = local-oper_hw_mode;
+   for (i = 0; i  params-supported_rates_len; i++) {
+   int rate = (params-supported_rates[i]  0x7f) * 5;
+   for (j = 0; j  mode-num_rates; j++) {
+   if (mode-rates[j].rate == rate)
+   rates |= BIT(j);
+   }
+   }
+   sta-supp_rates = rates;
+   }
+}
+
+static int ieee80211_add_station(struct wiphy *wiphy, struct net_device *dev,
+u8 *mac, struct station_parameters *params)
+{
+   struct ieee80211_local *local = wdev_priv(dev-ieee80211_ptr);
+   struct sta_info *sta;
+   struct ieee80211_sub_if_data *sdata;
+
+   /* Prevent a race with changing the rate control algorithm */
+  

rt2x00: Move init_txring and init_rxring into rt2x00lib

2008-01-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=837e7f247a8ed3f5577462655f8099a81b360422
Commit: 837e7f247a8ed3f5577462655f8099a81b360422
Parent: 7e56d38d5d0bda89228821902af297a46b5fdb80
Author: Ivo van Doorn [EMAIL PROTECTED]
AuthorDate: Sun Jan 6 23:41:45 2008 +0100
Committer:  David S. Miller [EMAIL PROTECTED]
CommitDate: Mon Jan 28 15:09:27 2008 -0800

rt2x00: Move init_txring and init_rxring into rt2x00lib

Prior to enabling the radio rt2x00lib should go through all
rings and for each entry should call the callback function
init_txentry() and init_rxentry().

Signed-off-by: Ivo van Doorn [EMAIL PROTECTED]
Signed-off-by: John W. Linville [EMAIL PROTECTED]
---
 drivers/net/wireless/rt2x00/rt2400pci.c |   83 +---
 drivers/net/wireless/rt2x00/rt2500pci.c |   69 +++-
 drivers/net/wireless/rt2x00/rt2500usb.c |4 +-
 drivers/net/wireless/rt2x00/rt2x00.h|8 +++
 drivers/net/wireless/rt2x00/rt2x00dev.c |   46 
 drivers/net/wireless/rt2x00/rt2x00usb.c |   60 -
 drivers/net/wireless/rt2x00/rt2x00usb.h |5 ++-
 drivers/net/wireless/rt2x00/rt61pci.c   |   88 +++
 drivers/net/wireless/rt2x00/rt73usb.c   |4 +-
 9 files changed, 163 insertions(+), 204 deletions(-)

diff --git a/drivers/net/wireless/rt2x00/rt2400pci.c 
b/drivers/net/wireless/rt2x00/rt2400pci.c
index 95db2cc..f4d0c77 100644
--- a/drivers/net/wireless/rt2x00/rt2400pci.c
+++ b/drivers/net/wireless/rt2x00/rt2400pci.c
@@ -592,65 +592,43 @@ static void rt2400pci_link_tuner(struct rt2x00_dev 
*rt2x00dev)
 /*
  * Initialization functions.
  */
-static void rt2400pci_init_rxring(struct rt2x00_dev *rt2x00dev)
+static void rt2400pci_init_rxentry(struct rt2x00_dev *rt2x00dev,
+  struct data_entry *entry)
 {
-   struct data_ring *ring = rt2x00dev-rx;
-   __le32 *rxd;
-   unsigned int i;
+   __le32 *rxd = entry-priv;
u32 word;
 
-   memset(ring-data_addr, 0x00, rt2x00_get_ring_size(ring));
-
-   for (i = 0; i  ring-stats.limit; i++) {
-   rxd = ring-entry[i].priv;
+   rt2x00_desc_read(rxd, 2, word);
+   rt2x00_set_field32(word, RXD_W2_BUFFER_LENGTH, entry-ring-data_size);
+   rt2x00_desc_write(rxd, 2, word);
 
-   rt2x00_desc_read(rxd, 2, word);
-   rt2x00_set_field32(word, RXD_W2_BUFFER_LENGTH,
-  ring-data_size);
-   rt2x00_desc_write(rxd, 2, word);
-
-   rt2x00_desc_read(rxd, 1, word);
-   rt2x00_set_field32(word, RXD_W1_BUFFER_ADDRESS,
-  ring-entry[i].data_dma);
-   rt2x00_desc_write(rxd, 1, word);
-
-   rt2x00_desc_read(rxd, 0, word);
-   rt2x00_set_field32(word, RXD_W0_OWNER_NIC, 1);
-   rt2x00_desc_write(rxd, 0, word);
-   }
+   rt2x00_desc_read(rxd, 1, word);
+   rt2x00_set_field32(word, RXD_W1_BUFFER_ADDRESS, entry-data_dma);
+   rt2x00_desc_write(rxd, 1, word);
 
-   rt2x00_ring_index_clear(rt2x00dev-rx);
+   rt2x00_desc_read(rxd, 0, word);
+   rt2x00_set_field32(word, RXD_W0_OWNER_NIC, 1);
+   rt2x00_desc_write(rxd, 0, word);
 }
 
-static void rt2400pci_init_txring(struct rt2x00_dev *rt2x00dev, const int 
queue)
+static void rt2400pci_init_txentry(struct rt2x00_dev *rt2x00dev,
+  struct data_entry *entry)
 {
-   struct data_ring *ring = rt2x00lib_get_ring(rt2x00dev, queue);
-   __le32 *txd;
-   unsigned int i;
+   __le32 *txd = entry-priv;
u32 word;
 
-   memset(ring-data_addr, 0x00, rt2x00_get_ring_size(ring));
-
-   for (i = 0; i  ring-stats.limit; i++) {
-   txd = ring-entry[i].priv;
-
-   rt2x00_desc_read(txd, 1, word);
-   rt2x00_set_field32(word, TXD_W1_BUFFER_ADDRESS,
-  ring-entry[i].data_dma);
-   rt2x00_desc_write(txd, 1, word);
+   rt2x00_desc_read(txd, 1, word);
+   rt2x00_set_field32(word, TXD_W1_BUFFER_ADDRESS, entry-data_dma);
+   rt2x00_desc_write(txd, 1, word);
 
-   rt2x00_desc_read(txd, 2, word);
-   rt2x00_set_field32(word, TXD_W2_BUFFER_LENGTH,
-  ring-data_size);
-   rt2x00_desc_write(txd, 2, word);
-
-   rt2x00_desc_read(txd, 0, word);
-   rt2x00_set_field32(word, TXD_W0_VALID, 0);
-   rt2x00_set_field32(word, TXD_W0_OWNER_NIC, 0);
-   rt2x00_desc_write(txd, 0, word);
-   }
+   rt2x00_desc_read(txd, 2, word);
+   rt2x00_set_field32(word, TXD_W2_BUFFER_LENGTH, entry-ring-data_size);
+   rt2x00_desc_write(txd, 2, word);
 
-   rt2x00_ring_index_clear(ring);
+   rt2x00_desc_read(txd, 0, word);
+   rt2x00_set_field32(word, TXD_W0_VALID, 0);
+   

hostap_cs: don't match revisions in presense of the MAC chip name

2008-01-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=17f65f814fc6144e61b5d19f8e0627cd781486c2
Commit: 17f65f814fc6144e61b5d19f8e0627cd781486c2
Parent: f31800d8b79bc42e495070aa6e6425841b7bdcbf
Author: Pavel Roskin [EMAIL PROTECTED]
AuthorDate: Wed Jan 9 22:16:58 2008 -0500
Committer:  David S. Miller [EMAIL PROTECTED]
CommitDate: Mon Jan 28 15:09:33 2008 -0800

hostap_cs: don't match revisions in presense of the MAC chip name

If the third PCMCIA ID string specifies the MAC chip, the fourth ID
string doesn't need to be matched.  Even if it's different, it will be
compatible with the driver.

This ensures that other different revisions of the card will be
supported.

Signed-off-by: Pavel Roskin [EMAIL PROTECTED]
Signed-off-by: John W. Linville [EMAIL PROTECTED]
---
 drivers/net/wireless/hostap/hostap_cs.c |   15 ++-
 1 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/drivers/net/wireless/hostap/hostap_cs.c 
b/drivers/net/wireless/hostap/hostap_cs.c
index 877d3bd..0759380 100644
--- a/drivers/net/wireless/hostap/hostap_cs.c
+++ b/drivers/net/wireless/hostap/hostap_cs.c
@@ -845,15 +845,13 @@ static struct pcmcia_device_id hostap_cs_ids[] = {
 0x4b801a17),
PCMCIA_MFC_DEVICE_PROD_ID12(0, SanDisk, ConnectPlus,
0x7a954bd9, 0x74be00c6),
-   PCMCIA_DEVICE_PROD_ID1234(
+   PCMCIA_DEVICE_PROD_ID123(
Intersil, PRISM 2_5 PCMCIA ADAPTER, ISL37300P,
-   Eval-RevA,
-   0x4b801a17, 0x6345a0bf, 0xc9049a39, 0xc23adc0e),
+   0x4b801a17, 0x6345a0bf, 0xc9049a39),
/* D-Link DWL-650 Rev. P1; manfid 0x000b, 0x7110 */
-   PCMCIA_DEVICE_PROD_ID1234(
+   PCMCIA_DEVICE_PROD_ID123(
D-Link, DWL-650 Wireless PC Card RevP, ISL37101P-10,
-   A3,
-   0x1a424a1c, 0x6ea57632, 0xdd97a26b, 0x56b21f52),
+   0x1a424a1c, 0x6ea57632, 0xdd97a26b),
PCMCIA_DEVICE_PROD_ID123(
Addtron, AWP-100 Wireless PCMCIA, Version 01.02,
0xe6ec52ce, 0x08649af2, 0x4b74baa0),
@@ -890,10 +888,9 @@ static struct pcmcia_device_id hostap_cs_ids[] = {
PCMCIA_DEVICE_PROD_ID123(
corega, WL PCCL-11, ISL37300P,
0xa21501a, 0x59868926, 0xc9049a39),
-   PCMCIA_DEVICE_PROD_ID1234(
+   PCMCIA_DEVICE_PROD_ID123(
The Linksys Group, Inc., Wireless Network CF Card, 
ISL37300P,
-   RevA,
-   0xa5f472c2, 0x9c05598d, 0xc9049a39, 0x57a66194),
+   0xa5f472c2, 0x9c05598d, 0xc9049a39),
PCMCIA_DEVICE_NULL
 };
 MODULE_DEVICE_TABLE(pcmcia, hostap_cs_ids);
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


ssb: add 'ssb_pcihost_set_power_state' function

2008-01-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=961d57c883198831503c7be5c088a26101dfb16c
Commit: 961d57c883198831503c7be5c088a26101dfb16c
Parent: aa6c7ae21d079f25420e436092e5461001ec29d7
Author: Miguel Botón [EMAIL PROTECTED]
AuthorDate: Tue Jan 1 01:16:46 2008 +0100
Committer:  David S. Miller [EMAIL PROTECTED]
CommitDate: Mon Jan 28 15:09:18 2008 -0800

ssb: add 'ssb_pcihost_set_power_state' function

This patch adds the 'ssb_pcihost_set_power_state' function.

This function allows us to set the power state of a PCI device
(for example b44 ethernet device).

Signed-off-by: Miguel Botón [EMAIL PROTECTED]
Signed-off-by: John W. Linville [EMAIL PROTECTED]
---
 include/linux/ssb/ssb.h |7 +++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/include/linux/ssb/ssb.h b/include/linux/ssb/ssb.h
index cacbae5..1ab4688 100644
--- a/include/linux/ssb/ssb.h
+++ b/include/linux/ssb/ssb.h
@@ -365,6 +365,13 @@ static inline void ssb_pcihost_unregister(struct 
pci_driver *driver)
 {
pci_unregister_driver(driver);
 }
+
+static inline
+void ssb_pcihost_set_power_state(struct ssb_device *sdev, pci_power_t state)
+{
+   if (sdev-bus-bustype == SSB_BUSTYPE_PCI)
+   pci_set_power_state(sdev-bus-host_pci, state);
+}
 #endif /* CONFIG_SSB_PCIHOST */
 
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


ipw2200 trivial annotations

2008-01-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=e62e1ee02900bc315d7aeba55196a78f8f62f1c5
Commit: e62e1ee02900bc315d7aeba55196a78f8f62f1c5
Parent: 0569056e0d355f5b9a45c5b16a9b0b65718d077e
Author: Al Viro [EMAIL PROTECTED]
AuthorDate: Thu Dec 27 01:36:46 2007 -0500
Committer:  David S. Miller [EMAIL PROTECTED]
CommitDate: Mon Jan 28 15:09:09 2008 -0800

ipw2200 trivial annotations

Signed-off-by: Al Viro [EMAIL PROTECTED]
Signed-off-by: John W. Linville [EMAIL PROTECTED]
---
 drivers/net/wireless/ipw2200.c |   90 ++
 drivers/net/wireless/ipw2200.h |   94 
 2 files changed, 90 insertions(+), 94 deletions(-)

diff --git a/drivers/net/wireless/ipw2200.c b/drivers/net/wireless/ipw2200.c
index 7c45ba5..7ac57f1 100644
--- a/drivers/net/wireless/ipw2200.c
+++ b/drivers/net/wireless/ipw2200.c
@@ -2403,14 +2403,13 @@ static int ipw_set_random_seed(struct ipw_priv *priv)
 
 static int ipw_send_card_disable(struct ipw_priv *priv, u32 phy_off)
 {
+   __le32 v = cpu_to_le32(phy_off);
if (!priv) {
IPW_ERROR(Invalid args\n);
return -1;
}
 
-   phy_off = cpu_to_le32(phy_off);
-   return ipw_send_cmd_pdu(priv, IPW_CMD_CARD_DISABLE, sizeof(phy_off),
-   phy_off);
+   return ipw_send_cmd_pdu(priv, IPW_CMD_CARD_DISABLE, sizeof(v), v);
 }
 
 static int ipw_send_tx_power(struct ipw_priv *priv, struct ipw_tx_power *power)
@@ -2499,7 +2498,7 @@ static int ipw_send_frag_threshold(struct ipw_priv *priv, 
u16 frag)
 
 static int ipw_send_power_mode(struct ipw_priv *priv, u32 mode)
 {
-   u32 param;
+   __le32 param;
 
if (!priv) {
IPW_ERROR(Invalid args\n);
@@ -2510,17 +2509,16 @@ static int ipw_send_power_mode(struct ipw_priv *priv, 
u32 mode)
 * level */
switch (mode) {
case IPW_POWER_BATTERY:
-   param = IPW_POWER_INDEX_3;
+   param = cpu_to_le32(IPW_POWER_INDEX_3);
break;
case IPW_POWER_AC:
-   param = IPW_POWER_MODE_CAM;
+   param = cpu_to_le32(IPW_POWER_MODE_CAM);
break;
default:
-   param = mode;
+   param = cpu_to_le32(mode);
break;
}
 
-   param = cpu_to_le32(param);
return ipw_send_cmd_pdu(priv, IPW_CMD_POWER_MODE, sizeof(param),
param);
 }
@@ -2654,13 +2652,13 @@ static void eeprom_parse_mac(struct ipw_priv *priv, u8 
* mac)
 static void ipw_eeprom_init_sram(struct ipw_priv *priv)
 {
int i;
-   u16 *eeprom = (u16 *) priv-eeprom;
+   __le16 *eeprom = (__le16 *) priv-eeprom;
 
IPW_DEBUG_TRACE(\n);
 
/* read entire contents of eeprom into private buffer */
for (i = 0; i  128; i++)
-   eeprom[i] = le16_to_cpu(eeprom_read_u16(priv, (u8) i));
+   eeprom[i] = cpu_to_le16(eeprom_read_u16(priv, (u8) i));
 
/*
   If the data looks correct, then copy it to our private
@@ -3040,17 +3038,17 @@ static void ipw_arc_release(struct ipw_priv *priv)
 }
 
 struct fw_chunk {
-   u32 address;
-   u32 length;
+   __le32 address;
+   __le32 length;
 };
 
 static int ipw_load_ucode(struct ipw_priv *priv, u8 * data, size_t len)
 {
int rc = 0, i, addr;
u8 cr = 0;
-   u16 *image;
+   __le16 *image;
 
-   image = (u16 *) data;
+   image = (__le16 *) data;
 
IPW_DEBUG_TRACE( \n);
 
@@ -3097,7 +3095,7 @@ static int ipw_load_ucode(struct ipw_priv *priv, u8 * 
data, size_t len)
/* load new ipw uCode */
for (i = 0; i  len / 2; i++)
ipw_write_reg16(priv, IPW_BASEBAND_CONTROL_STORE,
-   cpu_to_le16(image[i]));
+   le16_to_cpu(image[i]));
 
/* enable DINO */
ipw_write_reg8(priv, IPW_BASEBAND_CONTROL_STATUS, 0);
@@ -3116,11 +3114,11 @@ static int ipw_load_ucode(struct ipw_priv *priv, u8 * 
data, size_t len)
 
if (cr  DINO_RXFIFO_DATA) {
/* alive_command_responce size is NOT multiple of 4 */
-   u32 response_buffer[(sizeof(priv-dino_alive) + 3) / 4];
+   __le32 response_buffer[(sizeof(priv-dino_alive) + 3) / 4];
 
for (i = 0; i  ARRAY_SIZE(response_buffer); i++)
response_buffer[i] =
-   le32_to_cpu(ipw_read_reg32(priv,
+   cpu_to_le32(ipw_read_reg32(priv,
   
IPW_BASEBAND_RX_FIFO_READ));
memcpy(priv-dino_alive, response_buffer,
   sizeof(priv-dino_alive));
@@ -4396,9 +4394,10 @@ static void ipw_rx_notification(struct ipw_priv *priv,
   struct ipw_rx_notification *notif)
 {

libertas: kill SendSinglePacket() function.

2008-01-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=6b4a7e0fbd772495572e038d296853a741e0454b
Commit: 6b4a7e0fbd772495572e038d296853a741e0454b
Parent: 2abdc0b7756ece70b1f0fd65a651bf8ce487a223
Author: David Woodhouse [EMAIL PROTECTED]
AuthorDate: Sun Dec 9 12:48:10 2007 -0500
Committer:  David S. Miller [EMAIL PROTECTED]
CommitDate: Mon Jan 28 15:06:23 2008 -0800

libertas: kill SendSinglePacket() function.

Make a start on reducing the number of pointless nested functions,
starting with the StudlyCaps. No semantic changes (yet) -- we can sort
out the now-obvious discrepancy in the failure paths in a separate
commit.

Signed-off-by: David Woodhouse [EMAIL PROTECTED]
Signed-off-by: John W. Linville [EMAIL PROTECTED]
---
 drivers/net/wireless/libertas/tx.c |   66 +---
 1 files changed, 24 insertions(+), 42 deletions(-)

diff --git a/drivers/net/wireless/libertas/tx.c 
b/drivers/net/wireless/libertas/tx.c
index 749535e..10596f3 100644
--- a/drivers/net/wireless/libertas/tx.c
+++ b/drivers/net/wireless/libertas/tx.c
@@ -49,16 +49,16 @@ static u32 convert_radiotap_rate_to_mv(u8 rate)
 }
 
 /**
- *  @brief This function processes a single packet and sends
- *  to IF layer
+ *  @brief This function checks the conditions and sends packet to IF
+ *  layer if everything is ok.
  *
  *  @param privA pointer to struct lbs_private structure
  *  @param skb A pointer to skb which includes TX packet
  *  @return   0 or -1
  */
-static int SendSinglePacket(struct lbs_private *priv, struct sk_buff *skb)
+int lbs_process_tx(struct lbs_private *priv, struct sk_buff *skb)
 {
-   int ret = 0;
+   int ret = -1;
struct txpd localtxpd;
struct txpd *plocaltxpd = localtxpd;
u8 *p802x_hdr;
@@ -68,16 +68,31 @@ static int SendSinglePacket(struct lbs_private *priv, 
struct sk_buff *skb)
 
lbs_deb_enter(LBS_DEB_TX);
 
+   lbs_deb_hex(LBS_DEB_TX, TX Data, skb-data, min_t(unsigned int, 
skb-len, 100));
+
+   if (priv-dnld_sent) {
+   lbs_pr_alert( TX error: dnld_sent = %d, not sending\n,
+  priv-dnld_sent);
+   goto done;
+   }
+
+   if ((priv-psstate == PS_STATE_SLEEP) ||
+   (priv-psstate == PS_STATE_PRE_SLEEP)) {
+   lbs_pr_alert(TX error: packet xmit in %ssleep mode\n,
+priv-psstate == PS_STATE_SLEEP?:pre-);
+   goto done;
+   }
+
if (priv-surpriseremoved)
return -1;
 
if (!skb-len || (skb-len  MRVDRV_ETH_TX_PACKET_BUFFER_SIZE)) {
lbs_deb_tx(tx err: skb length %d 0 or  %zd\n,
   skb-len, MRVDRV_ETH_TX_PACKET_BUFFER_SIZE);
-   ret = -1;
-   goto done;
+   goto done_tx;
}
 
+   ret = 0;
memset(plocaltxpd, 0, sizeof(struct txpd));
 
plocaltxpd-tx_packet_length = cpu_to_le16(skb-len);
@@ -130,12 +145,12 @@ static int SendSinglePacket(struct lbs_private *priv, 
struct sk_buff *skb)
 
if (ret) {
lbs_deb_tx(tx err: hw_host_to_card returned 0x%X\n, ret);
-   goto done;
+   goto done_tx;
}
 
-   lbs_deb_tx(SendSinglePacket succeeds\n);
+   lbs_deb_tx(%s succeeds\n, __func__);
 
-done:
+done_tx:
if (!ret) {
priv-stats.tx_packets++;
priv-stats.tx_bytes += skb-len;
@@ -159,39 +174,6 @@ done:
dev_kfree_skb_any(skb);
}
 
-   lbs_deb_leave_args(LBS_DEB_TX, ret %d, ret);
-   return ret;
-}
-
-
-/**
- *  @brief This function checks the conditions and sends packet to IF
- *  layer if everything is ok.
- *
- *  @param privA pointer to struct lbs_private structure
- *  @return   n/a
- */
-int lbs_process_tx(struct lbs_private *priv, struct sk_buff *skb)
-{
-   int ret = -1;
-
-   lbs_deb_enter(LBS_DEB_TX);
-   lbs_deb_hex(LBS_DEB_TX, TX Data, skb-data, min_t(unsigned int, 
skb-len, 100));
-
-   if (priv-dnld_sent) {
-   lbs_pr_alert( TX error: dnld_sent = %d, not sending\n,
-  priv-dnld_sent);
-   goto done;
-   }
-
-   if ((priv-psstate == PS_STATE_SLEEP) ||
-   (priv-psstate == PS_STATE_PRE_SLEEP)) {
-   lbs_pr_alert(TX error: packet xmit in %ssleep mode\n,
-priv-psstate == PS_STATE_SLEEP?:pre-);
-   goto done;
-   }
-
-   ret = SendSinglePacket(priv, skb);
 done:
lbs_deb_leave_args(LBS_DEB_TX, ret %d, ret);
return ret;
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


ipw2100 annotations and fixes

2008-01-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=1edd3a555304a266e76bbc6cbe04f446fdd7940b
Commit: 1edd3a555304a266e76bbc6cbe04f446fdd7940b
Parent: dc73c623dd0a653bf80ec41870dcf8b601fc6e9b
Author: Al Viro [EMAIL PROTECTED]
AuthorDate: Fri Dec 21 00:15:18 2007 -0500
Committer:  David S. Miller [EMAIL PROTECTED]
CommitDate: Mon Jan 28 15:08:54 2008 -0800

ipw2100 annotations and fixes

Signed-off-by: Al Viro [EMAIL PROTECTED]
Signed-off-by: John W. Linville [EMAIL PROTECTED]
---
 drivers/net/wireless/ipw2100.c |   10 +-
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/net/wireless/ipw2100.c b/drivers/net/wireless/ipw2100.c
index dc3813b..2ab107f 100644
--- a/drivers/net/wireless/ipw2100.c
+++ b/drivers/net/wireless/ipw2100.c
@@ -2509,9 +2509,9 @@ static void isr_rx_monitor(struct ipw2100_priv *priv, int 
i,
 
ipw_rt-rt_hdr.it_version = PKTHDR_RADIOTAP_VERSION;
ipw_rt-rt_hdr.it_pad = 0; /* always good to zero */
-   ipw_rt-rt_hdr.it_len = sizeof(struct ipw_rt_hdr); /* total hdr+data */
+   ipw_rt-rt_hdr.it_len = cpu_to_le16(sizeof(struct ipw_rt_hdr)); /* 
total hdr+data */
 
-   ipw_rt-rt_hdr.it_present = 1  IEEE80211_RADIOTAP_DBM_ANTSIGNAL;
+   ipw_rt-rt_hdr.it_present = cpu_to_le32(1  
IEEE80211_RADIOTAP_DBM_ANTSIGNAL);
 
ipw_rt-rt_dbmsignal = status-rssi + IPW2100_RSSI_TO_DBM;
 
@@ -2558,7 +2558,7 @@ static int ipw2100_corruption_check(struct ipw2100_priv 
*priv, int i)
 #ifdef CONFIG_IPW2100_MONITOR
return 0;
 #else
-   switch (WLAN_FC_GET_TYPE(u-rx_data.header.frame_ctl)) {
+   switch 
(WLAN_FC_GET_TYPE(le16_to_cpu(u-rx_data.header.frame_ctl))) {
case IEEE80211_FTYPE_MGMT:
case IEEE80211_FTYPE_CTL:
return 0;
@@ -2677,7 +2677,7 @@ static void __ipw2100_rx_process(struct ipw2100_priv 
*priv)
 #endif
if (stats.len  sizeof(struct ieee80211_hdr_3addr))
break;
-   switch (WLAN_FC_GET_TYPE(u-rx_data.header.frame_ctl)) {
+   switch 
(WLAN_FC_GET_TYPE(le16_to_cpu(u-rx_data.header.frame_ctl))) {
case IEEE80211_FTYPE_MGMT:
ieee80211_rx_mgt(priv-ieee,
 u-rx_data.header, stats);
@@ -7795,7 +7795,7 @@ static int ipw2100_wx_set_mlme(struct net_device *dev,
 {
struct ipw2100_priv *priv = ieee80211_priv(dev);
struct iw_mlme *mlme = (struct iw_mlme *)extra;
-   u16 reason;
+   __le16 reason;
 
reason = cpu_to_le16(mlme-reason_code);
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


airo: last of endianness annotations

2008-01-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=3eb9b41f2474c53fe469fbe383955d5aae9e76e4
Commit: 3eb9b41f2474c53fe469fbe383955d5aae9e76e4
Parent: 329e2c0067d5a2da88aa844bf57b2aaba9fceb2f
Author: Al Viro [EMAIL PROTECTED]
AuthorDate: Fri Dec 21 00:00:35 2007 -0500
Committer:  David S. Miller [EMAIL PROTECTED]
CommitDate: Mon Jan 28 15:09:05 2008 -0800

airo: last of endianness annotations

sanitize handling of ConfigRid

Signed-off-by: Al Viro [EMAIL PROTECTED]
Signed-off-by: John W. Linville [EMAIL PROTECTED]
---
 drivers/net/wireless/airo.c |  444 +--
 1 files changed, 218 insertions(+), 226 deletions(-)

diff --git a/drivers/net/wireless/airo.c b/drivers/net/wireless/airo.c
index f4a32a3..932d6b1 100644
--- a/drivers/net/wireless/airo.c
+++ b/drivers/net/wireless/airo.c
@@ -520,121 +520,124 @@ typedef struct {
 } SsidRid;
 
 typedef struct {
-u16 len;
-u16 modulation;
-#define MOD_DEFAULT 0
-#define MOD_CCK 1
-#define MOD_MOK 2
+__le16 len;
+__le16 modulation;
+#define MOD_DEFAULT cpu_to_le16(0)
+#define MOD_CCK cpu_to_le16(1)
+#define MOD_MOK cpu_to_le16(2)
 } ModulationRid;
 
 typedef struct {
-   u16 len; /* sizeof(ConfigRid) */
-   u16 opmode; /* operating mode */
-#define MODE_STA_IBSS 0
-#define MODE_STA_ESS 1
-#define MODE_AP 2
-#define MODE_AP_RPTR 3
-#define MODE_ETHERNET_HOST (08) /* rx payloads converted */
-#define MODE_LLC_HOST (18) /* rx payloads left as is */
-#define MODE_AIRONET_EXTEND (19) /* enable Aironet extenstions */
-#define MODE_AP_INTERFACE (110) /* enable ap interface extensions */
-#define MODE_ANTENNA_ALIGN (111) /* enable antenna alignment */
-#define MODE_ETHER_LLC (112) /* enable ethernet LLC */
-#define MODE_LEAF_NODE (113) /* enable leaf node bridge */
-#define MODE_CF_POLLABLE (114) /* enable CF pollable */
-#define MODE_MIC (115) /* enable MIC */
-   u16 rmode; /* receive mode */
-#define RXMODE_BC_MC_ADDR 0
-#define RXMODE_BC_ADDR 1 /* ignore multicasts */
-#define RXMODE_ADDR 2 /* ignore multicast and broadcast */
-#define RXMODE_RFMON 3 /* wireless monitor mode */
-#define RXMODE_RFMON_ANYBSS 4
-#define RXMODE_LANMON 5 /* lan style monitor -- data packets only */
-#define RXMODE_DISABLE_802_3_HEADER (18) /* disables 802.3 header on rx */
-#define RXMODE_NORMALIZED_RSSI (19) /* return normalized RSSI */
-   u16 fragThresh;
-   u16 rtsThres;
+   __le16 len; /* sizeof(ConfigRid) */
+   __le16 opmode; /* operating mode */
+#define MODE_STA_IBSS cpu_to_le16(0)
+#define MODE_STA_ESS cpu_to_le16(1)
+#define MODE_AP cpu_to_le16(2)
+#define MODE_AP_RPTR cpu_to_le16(3)
+#define MODE_CFG_MASK cpu_to_le16(0xff)
+#define MODE_ETHERNET_HOST cpu_to_le16(08) /* rx payloads converted */
+#define MODE_LLC_HOST cpu_to_le16(18) /* rx payloads left as is */
+#define MODE_AIRONET_EXTEND cpu_to_le16(19) /* enable Aironet extenstions */
+#define MODE_AP_INTERFACE cpu_to_le16(110) /* enable ap interface extensions 
*/
+#define MODE_ANTENNA_ALIGN cpu_to_le16(111) /* enable antenna alignment */
+#define MODE_ETHER_LLC cpu_to_le16(112) /* enable ethernet LLC */
+#define MODE_LEAF_NODE cpu_to_le16(113) /* enable leaf node bridge */
+#define MODE_CF_POLLABLE cpu_to_le16(114) /* enable CF pollable */
+#define MODE_MIC cpu_to_le16(115) /* enable MIC */
+   __le16 rmode; /* receive mode */
+#define RXMODE_BC_MC_ADDR cpu_to_le16(0)
+#define RXMODE_BC_ADDR cpu_to_le16(1) /* ignore multicasts */
+#define RXMODE_ADDR cpu_to_le16(2) /* ignore multicast and broadcast */
+#define RXMODE_RFMON cpu_to_le16(3) /* wireless monitor mode */
+#define RXMODE_RFMON_ANYBSS cpu_to_le16(4)
+#define RXMODE_LANMON cpu_to_le16(5) /* lan style monitor -- data packets only 
*/
+#define RXMODE_MASK cpu_to_le16(255)
+#define RXMODE_DISABLE_802_3_HEADER cpu_to_le16(18) /* disables 802.3 header 
on rx */
+#define RXMODE_FULL_MASK (RXMODE_MASK | RXMODE_DISABLE_802_3_HEADER)
+#define RXMODE_NORMALIZED_RSSI cpu_to_le16(19) /* return normalized RSSI */
+   __le16 fragThresh;
+   __le16 rtsThres;
u8 macAddr[ETH_ALEN];
u8 rates[8];
-   u16 shortRetryLimit;
-   u16 longRetryLimit;
-   u16 txLifetime; /* in kusec */
-   u16 rxLifetime; /* in kusec */
-   u16 stationary;
-   u16 ordering;
-   u16 u16deviceType; /* for overriding device type */
-   u16 cfpRate;
-   u16 cfpDuration;
-   u16 _reserved1[3];
+   __le16 shortRetryLimit;
+   __le16 longRetryLimit;
+   __le16 txLifetime; /* in kusec */
+   __le16 rxLifetime; /* in kusec */
+   __le16 stationary;
+   __le16 ordering;
+   __le16 u16deviceType; /* for overriding device type */
+   __le16 cfpRate;
+   __le16 cfpDuration;
+   __le16 _reserved1[3];
/*-- Scanning/Associating --*/
-   u16 scanMode;
-#define SCANMODE_ACTIVE 0
-#define SCANMODE_PASSIVE 1
-#define 

airo: sanitize BSSListRid handling

2008-01-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=17e70491404c73012a7991a068ba62ec59bebdb2
Commit: 17e70491404c73012a7991a068ba62ec59bebdb2
Parent: b8c06bc1f39a0311cb0f41099be03ee2b202aeae
Author: Al Viro [EMAIL PROTECTED]
AuthorDate: Wed Dec 19 18:56:37 2007 -0500
Committer:  David S. Miller [EMAIL PROTECTED]
CommitDate: Mon Jan 28 15:09:00 2008 -0800

airo: sanitize BSSListRid handling

Stop byteswap-in-place in readBSSListRid(), annotate the sucker.
BTW, that had immediately found a bug - another codepath fetching
the same struct from card did _not_ byteswap, but used -dBm the
same as everything else - host-endian.  Fix in the next patch...

Signed-off-by: Al Viro [EMAIL PROTECTED]
Signed-off-by: John W. Linville [EMAIL PROTECTED]
---
 drivers/net/wireless/airo.c |   69 ++
 1 files changed, 30 insertions(+), 39 deletions(-)

diff --git a/drivers/net/wireless/airo.c b/drivers/net/wireless/airo.c
index ad91996..a619af6 100644
--- a/drivers/net/wireless/airo.c
+++ b/drivers/net/wireless/airo.c
@@ -749,39 +749,39 @@ typedef struct {
 
 /* Only present on firmware = 5.30.17 */
 typedef struct {
-  u16 unknown[4];
+  __le16 unknown[4];
   u8 fixed[12]; /* WLAN management frame */
   u8 iep[624];
 } BSSListRidExtra;
 
 typedef struct {
-  u16 len;
-  u16 index; /* First is 0 and 0x means end of list */
+  __le16 len;
+  __le16 index; /* First is 0 and 0x means end of list */
 #define RADIO_FH 1 /* Frequency hopping radio type */
 #define RADIO_DS 2 /* Direct sequence radio type */
 #define RADIO_TMA 4 /* Proprietary radio used in old cards (2500) */
-  u16 radioType;
+  __le16 radioType;
   u8 bssid[ETH_ALEN]; /* Mac address of the BSS */
   u8 zero;
   u8 ssidLen;
   u8 ssid[32];
-  u16 dBm;
-#define CAP_ESS (10)
-#define CAP_IBSS (11)
-#define CAP_PRIVACY (14)
-#define CAP_SHORTHDR (15)
-  u16 cap;
-  u16 beaconInterval;
+  __le16 dBm;
+#define CAP_ESS cpu_to_le16(10)
+#define CAP_IBSS cpu_to_le16(11)
+#define CAP_PRIVACY cpu_to_le16(14)
+#define CAP_SHORTHDR cpu_to_le16(15)
+  __le16 cap;
+  __le16 beaconInterval;
   u8 rates[8]; /* Same as rates for config rid */
   struct { /* For frequency hopping only */
-u16 dwell;
+__le16 dwell;
 u8 hopSet;
 u8 hopPattern;
 u8 hopIndex;
 u8 fill;
   } fh;
-  u16 dsChannel;
-  u16 atimWindow;
+  __le16 dsChannel;
+  __le16 atimWindow;
 
   /* Only present on firmware = 5.30.17 */
   BSSListRidExtra extra;
@@ -1728,8 +1728,8 @@ static void emmh32_final(emmh32_context *context, u8 
digest[4])
 }
 
 static int readBSSListRid(struct airo_info *ai, int first,
- BSSListRid *list) {
-   int rc;
+ BSSListRid *list)
+{
Cmd cmd;
Resp rsp;
 
@@ -1746,19 +1746,8 @@ static int readBSSListRid(struct airo_info *ai, int 
first,
schedule_timeout_uninterruptible(3 * HZ);
ai-list_bss_task = NULL;
}
-   rc = PC4500_readrid(ai, first ? ai-bssListFirst : ai-bssListNext,
+   return PC4500_readrid(ai, first ? ai-bssListFirst : ai-bssListNext,
list, ai-bssListRidLen, 1);
-
-   list-len = le16_to_cpu(list-len);
-   list-index = le16_to_cpu(list-index);
-   list-radioType = le16_to_cpu(list-radioType);
-   list-cap = le16_to_cpu(list-cap);
-   list-beaconInterval = le16_to_cpu(list-beaconInterval);
-   list-fh.dwell = le16_to_cpu(list-fh.dwell);
-   list-dsChannel = le16_to_cpu(list-dsChannel);
-   list-atimWindow = le16_to_cpu(list-atimWindow);
-   list-dBm = le16_to_cpu(list-dBm);
-   return rc;
 }
 
 static int readWepKeyRid(struct airo_info*ai, WepKeyRid *wkr, int temp, int 
lock) {
@@ -3028,14 +3017,14 @@ static void airo_process_scan_results (struct airo_info 
*ai) {
 
/* Try to read the first entry of the scan result */
rc = PC4500_readrid(ai, ai-bssListFirst, bss, ai-bssListRidLen, 0);
-   if((rc) || (bss.index == 0x)) {
+   if((rc) || (bss.index == cpu_to_le16(0x))) {
/* No scan results */
goto out;
}
 
/* Read and parse all entries */
tmp_net = NULL;
-   while((!rc)  (bss.index != 0x)) {
+   while((!rc)  (bss.index != cpu_to_le16(0x))) {
/* Grab a network off the free list */
if (!list_empty(ai-network_free_list)) {
tmp_net = list_entry(ai-network_free_list.next,
@@ -5472,14 +5461,14 @@ static int proc_BSSList_open( struct inode *inode, 
struct file *file ) {
Since it is a rare condition, we'll just live with it, otherwise
we have to add a spin lock... */
rc = readBSSListRid(ai, doLoseSync, BSSList_rid);
-   while(rc == 0  BSSList_rid.index != 0x) {
+   while(rc == 0  BSSList_rid.index != cpu_to_le16(0x)) {
ptr += sprintf(ptr, %s 

airo: sanitize handling of StatsRid

2008-01-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=a23ace5f226aea6c8ba04794720502b1aad1dd92
Commit: a23ace5f226aea6c8ba04794720502b1aad1dd92
Parent: 4293ea33c8a85c3b4401df5df82fc3e070ec0c8e
Author: Al Viro [EMAIL PROTECTED]
AuthorDate: Wed Dec 19 22:24:16 2007 -0500
Committer:  David S. Miller [EMAIL PROTECTED]
CommitDate: Mon Jan 28 15:09:02 2008 -0800

airo: sanitize handling of StatsRid

Signed-off-by: Al Viro [EMAIL PROTECTED]
Signed-off-by: John W. Linville [EMAIL PROTECTED]
---
 drivers/net/wireless/airo.c |   78 +++
 1 files changed, 42 insertions(+), 36 deletions(-)

diff --git a/drivers/net/wireless/airo.c b/drivers/net/wireless/airo.c
index 8eac7fb..9b0714c 100644
--- a/drivers/net/wireless/airo.c
+++ b/drivers/net/wireless/airo.c
@@ -706,9 +706,9 @@ typedef struct {
 } StatusRid;
 
 typedef struct {
-   u16 len;
-   u16 spacer;
-   u32 vals[100];
+   __le16 len;
+   __le16 spacer;
+   __le32 vals[100];
 } StatsRid;
 
 
@@ -1889,13 +1889,10 @@ static int readCapabilityRid(struct airo_info*ai, 
CapabilityRid *capr, int lock)
*s = le16_to_cpu(*s);
return rc;
 }
-static int readStatsRid(struct airo_info*ai, StatsRid *sr, int rid, int lock) {
-   int rc = PC4500_readrid(ai, rid, sr, sizeof(*sr), lock);
-   u32 *i;
 
-   sr-len = le16_to_cpu(sr-len);
-   for(i = sr-vals[0]; i = sr-vals[99]; i++) *i = le32_to_cpu(*i);
-   return rc;
+static int readStatsRid(struct airo_info*ai, StatsRid *sr, int rid, int lock)
+{
+   return PC4500_readrid(ai, rid, sr, sizeof(*sr), lock);
 }
 
 static void try_auto_wep(struct airo_info *ai)
@@ -2260,9 +2257,10 @@ static int airo_start_xmit11(struct sk_buff *skb, struct 
net_device *dev) {
return 0;
 }
 
-static void airo_read_stats(struct airo_info *ai) {
+static void airo_read_stats(struct airo_info *ai)
+{
StatsRid stats_rid;
-   u32 *vals = stats_rid.vals;
+   __le32 *vals = stats_rid.vals;
 
clear_bit(JOB_STATS, ai-jobs);
if (ai-power.event) {
@@ -2272,20 +2270,23 @@ static void airo_read_stats(struct airo_info *ai) {
readStatsRid(ai, stats_rid, RID_STATS, 0);
up(ai-sem);
 
-   ai-stats.rx_packets = vals[43] + vals[44] + vals[45];
-   ai-stats.tx_packets = vals[39] + vals[40] + vals[41];
-   ai-stats.rx_bytes = vals[92];
-   ai-stats.tx_bytes = vals[91];
-   ai-stats.rx_errors = vals[0] + vals[2] + vals[3] + vals[4];
-   ai-stats.tx_errors = vals[42] + ai-stats.tx_fifo_errors;
-   ai-stats.multicast = vals[43];
-   ai-stats.collisions = vals[89];
+   ai-stats.rx_packets = le32_to_cpu(vals[43]) + le32_to_cpu(vals[44]) +
+  le32_to_cpu(vals[45]);
+   ai-stats.tx_packets = le32_to_cpu(vals[39]) + le32_to_cpu(vals[40]) +
+  le32_to_cpu(vals[41]);
+   ai-stats.rx_bytes = le32_to_cpu(vals[92]);
+   ai-stats.tx_bytes = le32_to_cpu(vals[91]);
+   ai-stats.rx_errors = le32_to_cpu(vals[0]) + le32_to_cpu(vals[2]) +
+ le32_to_cpu(vals[3]) + le32_to_cpu(vals[4]);
+   ai-stats.tx_errors = le32_to_cpu(vals[42]) + ai-stats.tx_fifo_errors;
+   ai-stats.multicast = le32_to_cpu(vals[43]);
+   ai-stats.collisions = le32_to_cpu(vals[89]);
 
/* detailed rx_errors: */
-   ai-stats.rx_length_errors = vals[3];
-   ai-stats.rx_crc_errors = vals[4];
-   ai-stats.rx_frame_errors = vals[2];
-   ai-stats.rx_fifo_errors = vals[0];
+   ai-stats.rx_length_errors = le32_to_cpu(vals[3]);
+   ai-stats.rx_crc_errors = le32_to_cpu(vals[4]);
+   ai-stats.rx_frame_errors = le32_to_cpu(vals[2]);
+   ai-stats.rx_fifo_errors = le32_to_cpu(vals[0]);
 }
 
 static struct net_device_stats *airo_get_stats(struct net_device *dev)
@@ -4741,14 +4742,16 @@ static int proc_stats_open( struct inode *inode, struct 
file *file ) {
 
 static int proc_stats_rid_open( struct inode *inode,
struct file *file,
-   u16 rid ) {
+   u16 rid )
+{
struct proc_data *data;
struct proc_dir_entry *dp = PDE(inode);
struct net_device *dev = dp-data;
struct airo_info *apriv = dev-priv;
StatsRid stats;
int i, j;
-   u32 *vals = stats.vals;
+   __le32 *vals = stats.vals;
+   int len = le16_to_cpu(stats.len);
 
if ((file-private_data = kzalloc(sizeof(struct proc_data ), 
GFP_KERNEL)) == NULL)
return -ENOMEM;
@@ -4761,17 +4764,17 @@ static int proc_stats_rid_open( struct inode *inode,
readStatsRid(apriv, stats, rid, 1);
 
 j = 0;
-   for(i=0; statsLabels[i]!=(char *)-1 
-   i*4stats.len; i++){
+   for(i=0; statsLabels[i]!=(char *)-1  i*4len; i++) {
if (!statsLabels[i]) continue;
if 

ipw2200 fix: -rt_chbitmask is le16

2008-01-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=472caf8c8a534367be8954dacf7c9e0317bb7e89
Commit: 472caf8c8a534367be8954dacf7c9e0317bb7e89
Parent: 743b84d2fc87cc19ca1c1cd2a821225caba862b0
Author: Al Viro [EMAIL PROTECTED]
AuthorDate: Thu Dec 27 01:50:54 2007 -0500
Committer:  David S. Miller [EMAIL PROTECTED]
CommitDate: Mon Jan 28 15:08:56 2008 -0800

ipw2200 fix: -rt_chbitmask is le16

A couple of places forgot cpu_to_le16() in assignments to
that field, even though right next to those in other branches
of if-else we do it correctly.

Signed-off-by: Al Viro [EMAIL PROTECTED]
Signed-off-by: John W. Linville [EMAIL PROTECTED]
---
 drivers/net/wireless/ipw2200.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/ipw2200.c b/drivers/net/wireless/ipw2200.c
index 5f4d39c..c0591bd 100644
--- a/drivers/net/wireless/ipw2200.c
+++ b/drivers/net/wireless/ipw2200.c
@@ -7792,7 +7792,7 @@ static void ipw_handle_data_packet_monitor(struct 
ipw_priv *priv,
cpu_to_le16((IEEE80211_CHAN_CCK | IEEE80211_CHAN_2GHZ));
} else {/* 802.11g */
ipw_rt-rt_chbitmask =
-   (IEEE80211_CHAN_OFDM | IEEE80211_CHAN_2GHZ);
+   cpu_to_le16(IEEE80211_CHAN_OFDM | IEEE80211_CHAN_2GHZ);
}
 
/* set the rate in multiples of 500k/s */
@@ -8009,7 +8009,7 @@ static void ipw_handle_promiscuous_rx(struct ipw_priv 
*priv,
cpu_to_le16((IEEE80211_CHAN_CCK | IEEE80211_CHAN_2GHZ));
} else {/* 802.11g */
ipw_rt-rt_chbitmask =
-   (IEEE80211_CHAN_OFDM | IEEE80211_CHAN_2GHZ);
+   cpu_to_le16(IEEE80211_CHAN_OFDM | IEEE80211_CHAN_2GHZ);
}
 
/* set the rate in multiples of 500k/s */
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


libertas: TX packet is radiotap iff it comes from rtap_dev

2008-01-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=a97bcfed96b563f56f55dbccee70e09bd2800414
Commit: a97bcfed96b563f56f55dbccee70e09bd2800414
Parent: 121947c62ab049bfaeb8fadc9908834b5a99daf0
Author: David Woodhouse [EMAIL PROTECTED]
AuthorDate: Sun Dec 9 22:00:55 2007 -0500
Committer:  David S. Miller [EMAIL PROTECTED]
CommitDate: Mon Jan 28 15:06:28 2008 -0800

libertas: TX packet is radiotap iff it comes from rtap_dev

Fix one of the barriers to simultaneous radiotap and normal operation --
stop misinterpreting the TX packets on the normal devices. We're also
going to have to clone the incoming skbs and feed them into both
devices, and there seem to be firmware problems with staying associated
too. But this is a reasonable start...

Signed-off-by: David Woodhouse [EMAIL PROTECTED]
Signed-off-by: John W. Linville [EMAIL PROTECTED]
---
 drivers/net/wireless/libertas/tx.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/wireless/libertas/tx.c 
b/drivers/net/wireless/libertas/tx.c
index aefe524..c2881a9 100644
--- a/drivers/net/wireless/libertas/tx.c
+++ b/drivers/net/wireless/libertas/tx.c
@@ -105,7 +105,7 @@ int lbs_hard_start_xmit(struct sk_buff *skb, struct 
net_device *dev)
p802x_hdr = skb-data;
pkt_len = skb-len;
 
-   if (priv-monitormode != LBS_MONITOR_OFF) {
+   if (dev == priv-rtap_net_dev) {
struct tx_radiotap_hdr *rtap_hdr = (void *)skb-data;
 
/* set txpd fields from the radiotap header */
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[IPV6]: addrconf sparse warnings

2008-01-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=d20b3109e9d122460929c50b857fcde251706ece
Commit: d20b3109e9d122460929c50b857fcde251706ece
Parent: 13a0a096e58a1149a8cffbd7722b820044e3801e
Author: Stephen Hemminger [EMAIL PROTECTED]
AuthorDate: Mon Jan 21 00:48:43 2008 -0800
Committer:  David S. Miller [EMAIL PROTECTED]
CommitDate: Mon Jan 28 15:08:37 2008 -0800

[IPV6]: addrconf sparse warnings

Get rid of a couple of sparse warnings in IPV6 addrconf code.

Signed-off-by: Stephen Hemminger [EMAIL PROTECTED]
Signed-off-by: David S. Miller [EMAIL PROTECTED]
---
 net/ipv6/addrconf.c |4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index 803caf1..aba7b5d 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -1900,7 +1900,7 @@ int addrconf_set_dstaddr(void __user *arg)
p.iph.ihl = 5;
p.iph.protocol = IPPROTO_IPV6;
p.iph.ttl = 64;
-   ifr.ifr_ifru.ifru_data = (void __user *)p;
+   ifr.ifr_ifru.ifru_data = (__force void __user *)p;
 
oldfs = get_fs(); set_fs(KERNEL_DS);
err = dev-do_ioctl(dev, ifr, SIOCADDTUNNEL);
@@ -2799,6 +2799,7 @@ static struct inet6_ifaddr *if6_get_idx(struct seq_file 
*seq, loff_t pos)
 }
 
 static void *if6_seq_start(struct seq_file *seq, loff_t *pos)
+   __acquires(addrconf_hash_lock)
 {
read_lock_bh(addrconf_hash_lock);
return if6_get_idx(seq, *pos);
@@ -2814,6 +2815,7 @@ static void *if6_seq_next(struct seq_file *seq, void *v, 
loff_t *pos)
 }
 
 static void if6_seq_stop(struct seq_file *seq, void *v)
+   __releases(addrconf_hash_lock)
 {
read_unlock_bh(addrconf_hash_lock);
 }
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[MACVLAN]: Fix thinko in macvlan_transfer_operstate()

2008-01-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=f12ca5f97b7f99288aff1dc32a91f21c3230fefe
Commit: f12ca5f97b7f99288aff1dc32a91f21c3230fefe
Parent: 91b4f954759653272504c55b715b757207ed1700
Author: Patrick McHardy [EMAIL PROTECTED]
AuthorDate: Mon Jan 21 00:47:08 2008 -0800
Committer:  David S. Miller [EMAIL PROTECTED]
CommitDate: Mon Jan 28 15:08:36 2008 -0800

[MACVLAN]: Fix thinko in macvlan_transfer_operstate()

When the lower device's carrier is off, the macvlan devices's
carrier state should be checked to decide whether it needs to
be turned off. Currently the lower device's state is checked
a second time.

This still works, but unnecessarily tries to turn off the
carrier when its already off.

Signed-off-by: Patrick McHardy [EMAIL PROTECTED]
Signed-off-by: David S. Miller [EMAIL PROTECTED]
---
 drivers/net/macvlan.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c
index b7c9791..6ef6b8b 100644
--- a/drivers/net/macvlan.c
+++ b/drivers/net/macvlan.c
@@ -375,7 +375,7 @@ static void macvlan_transfer_operstate(struct net_device 
*dev)
if (!netif_carrier_ok(dev))
netif_carrier_on(dev);
} else {
-   if (netif_carrier_ok(lowerdev))
+   if (netif_carrier_ok(dev))
netif_carrier_off(dev);
}
 }
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[VLAN]: Clean up initialization code

2008-01-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=69ab4b7d6db68396dbfa827daa8d6f30f9b546a8
Commit: 69ab4b7d6db68396dbfa827daa8d6f30f9b546a8
Parent: 198a291ce3a9103f4738600e3cf5416b66e009d9
Author: Patrick McHardy [EMAIL PROTECTED]
AuthorDate: Mon Jan 21 00:25:15 2008 -0800
Committer:  David S. Miller [EMAIL PROTECTED]
CommitDate: Mon Jan 28 15:08:30 2008 -0800

[VLAN]: Clean up initialization code

- move module init/exit functions to end of file, remove some now 
unnecessary
  forward declarations
- remove some obvious comments
- clean up proc init function and move a proc-related printk there

Signed-off-by: Patrick McHardy [EMAIL PROTECTED]
Signed-off-by: David S. Miller [EMAIL PROTECTED]
---
 net/8021q/vlan.c |  141 -
 net/8021q/vlanproc.c |   21 ---
 2 files changed, 70 insertions(+), 92 deletions(-)

diff --git a/net/8021q/vlan.c b/net/8021q/vlan.c
index 69a9e02..006d9a9 100644
--- a/net/8021q/vlan.c
+++ b/net/8021q/vlan.c
@@ -50,16 +50,6 @@ static char vlan_version[] = DRV_VERSION;
 static char vlan_copyright[] = Ben Greear [EMAIL PROTECTED];
 static char vlan_buggyright[] = David S. Miller [EMAIL PROTECTED];
 
-static int vlan_device_event(struct notifier_block *, unsigned long, void *);
-static int vlan_ioctl_handler(struct net *net, void __user *);
-static int unregister_vlan_dev(struct net_device *, unsigned short );
-
-static struct notifier_block vlan_notifier_block = {
-   .notifier_call = vlan_device_event,
-};
-
-/* These may be changed at run-time through IOCTLs */
-
 /* Determines interface naming scheme. */
 unsigned short vlan_name_type = VLAN_NAME_TYPE_RAW_PLUS_VID_NO_PAD;
 
@@ -70,79 +60,6 @@ static struct packet_type vlan_packet_type = {
 
 /* End of global variables definitions. */
 
-/*
- * Function vlan_proto_init (pro)
- *
- *Initialize VLAN protocol layer,
- *
- */
-static int __init vlan_proto_init(void)
-{
-   int err;
-
-   pr_info(%s v%s %s\n, vlan_fullname, vlan_version, vlan_copyright);
-   pr_info(All bugs added by %s\n, vlan_buggyright);
-
-   /* proc file system initialization */
-   err = vlan_proc_init();
-   if (err  0) {
-   pr_err(%s: can't create entry in proc filesystem!\n,
-  __FUNCTION__);
-   return err;
-   }
-
-   dev_add_pack(vlan_packet_type);
-
-   /* Register us to receive netdevice events */
-   err = register_netdevice_notifier(vlan_notifier_block);
-   if (err  0)
-   goto err1;
-
-   err = vlan_netlink_init();
-   if (err  0)
-   goto err2;
-
-   vlan_ioctl_set(vlan_ioctl_handler);
-   return 0;
-
-err2:
-   unregister_netdevice_notifier(vlan_notifier_block);
-err1:
-   vlan_proc_cleanup();
-   dev_remove_pack(vlan_packet_type);
-   return err;
-}
-
-/*
- * Module 'remove' entry point.
- * o delete /proc/net/router directory and static entries.
- */
-static void __exit vlan_cleanup_module(void)
-{
-   int i;
-
-   vlan_ioctl_set(NULL);
-   vlan_netlink_fini();
-
-   /* Un-register us from receiving netdevice events */
-   unregister_netdevice_notifier(vlan_notifier_block);
-
-   dev_remove_pack(vlan_packet_type);
-
-   /* This table must be empty if there are no module
-* references left.
-*/
-   for (i = 0; i  VLAN_GRP_HASH_SIZE; i++) {
-   BUG_ON(!hlist_empty(vlan_group_hash[i]));
-   }
-   vlan_proc_cleanup();
-
-   synchronize_net();
-}
-
-module_init(vlan_proto_init);
-module_exit(vlan_cleanup_module);
-
 /* Must be invoked with RCU read lock (no preempt) */
 static struct vlan_group *__vlan_find_group(int real_dev_ifindex)
 {
@@ -592,6 +509,10 @@ out:
return NOTIFY_DONE;
 }
 
+static struct notifier_block vlan_notifier_block __read_mostly = {
+   .notifier_call = vlan_device_event,
+};
+
 /*
  * VLAN IOCTL handler.
  * o execute requested action or pass command to the device driver
@@ -716,5 +637,59 @@ out:
return err;
 }
 
+static int __init vlan_proto_init(void)
+{
+   int err;
+
+   pr_info(%s v%s %s\n, vlan_fullname, vlan_version, vlan_copyright);
+   pr_info(All bugs added by %s\n, vlan_buggyright);
+
+   err = vlan_proc_init();
+   if (err  0)
+   goto err1;
+
+   err = register_netdevice_notifier(vlan_notifier_block);
+   if (err  0)
+   goto err2;
+
+   err = vlan_netlink_init();
+   if (err  0)
+   goto err3;
+
+   dev_add_pack(vlan_packet_type);
+   vlan_ioctl_set(vlan_ioctl_handler);
+   return 0;
+
+err3:
+   unregister_netdevice_notifier(vlan_notifier_block);
+err2:
+   vlan_proc_cleanup();
+err1:
+   return err;
+}
+
+static void __exit vlan_cleanup_module(void)
+{
+   unsigned int i;
+
+   vlan_ioctl_set(NULL);
+   

[VLAN]: Kill useless VLAN_NAME define

2008-01-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b7a4a83629c1ddde8c2e6a872618c66577cb20f0
Commit: b7a4a83629c1ddde8c2e6a872618c66577cb20f0
Parent: 740c15d0dd281c0cbe1a9ab1abc4f332e0df29bc
Author: Patrick McHardy [EMAIL PROTECTED]
AuthorDate: Mon Jan 21 00:19:16 2008 -0800
Committer:  David S. Miller [EMAIL PROTECTED]
CommitDate: Mon Jan 28 15:08:25 2008 -0800

[VLAN]: Kill useless VLAN_NAME define

The only user already includes __FUNCTION__ (vlan_proto_init) in the
output, which is enough to identify what the message is about.

Signed-off-by: Patrick McHardy [EMAIL PROTECTED]
Signed-off-by: David S. Miller [EMAIL PROTECTED]
---
 include/linux/if_vlan.h |2 --
 net/8021q/vlan.c|4 ++--
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h
index a1b0066..0325d6b 100644
--- a/include/linux/if_vlan.h
+++ b/include/linux/if_vlan.h
@@ -72,8 +72,6 @@ static inline struct vlan_ethhdr *vlan_eth_hdr(const struct 
sk_buff *skb)
 /* found in socket.c */
 extern void vlan_ioctl_set(int (*hook)(struct net *, void __user *));
 
-#define VLAN_NAME vlan
-
 /* if this changes, algorithm will have to be reworked because this
  * depends on completely exhausting the VLAN identifier space.  Thus
  * it gives constant time look-up, but in many cases it wastes memory.
diff --git a/net/8021q/vlan.c b/net/8021q/vlan.c
index 032bf44..af25255 100644
--- a/net/8021q/vlan.c
+++ b/net/8021q/vlan.c
@@ -89,8 +89,8 @@ static int __init vlan_proto_init(void)
err = vlan_proc_init();
if (err  0) {
printk(KERN_ERR
-  %s %s: can't create entry in proc filesystem!\n,
-  __FUNCTION__, VLAN_NAME);
+  %s: can't create entry in proc filesystem!\n,
+  __FUNCTION__);
return err;
}
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


libertas: add lbs_host_sleep_cfg() command function

2008-01-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=6ce4fd2a3a84e64a27c42aaa7de6e0e85dee3573
Commit: 6ce4fd2a3a84e64a27c42aaa7de6e0e85dee3573
Parent: a27b9f96f21a2f15c423cca745f65de3db61e364
Author: David Woodhouse [EMAIL PROTECTED]
AuthorDate: Wed Dec 12 15:19:29 2007 -0500
Committer:  David S. Miller [EMAIL PROTECTED]
CommitDate: Mon Jan 28 15:07:01 2008 -0800

libertas: add lbs_host_sleep_cfg() command function

Signed-off-by: David Woodhouse [EMAIL PROTECTED]
Signed-off-by: John W. Linville [EMAIL PROTECTED]
---
 drivers/net/wireless/libertas/cmd.c |   19 +++
 drivers/net/wireless/libertas/cmd.h |3 +++
 drivers/net/wireless/libertas/defs.h|7 +++
 drivers/net/wireless/libertas/host.h|2 ++
 drivers/net/wireless/libertas/hostcmd.h |7 +++
 5 files changed, 38 insertions(+), 0 deletions(-)

diff --git a/drivers/net/wireless/libertas/cmd.c 
b/drivers/net/wireless/libertas/cmd.c
index 8d8f9d9..2d7b646 100644
--- a/drivers/net/wireless/libertas/cmd.c
+++ b/drivers/net/wireless/libertas/cmd.c
@@ -111,6 +111,25 @@ out:
return ret;
 }
 
+int lbs_host_sleep_cfg(struct lbs_private *priv, uint32_t criteria,
+  uint8_t gpio, uint8_t gap)
+{
+   struct cmd_ds_host_sleep cmd_config;
+   int ret;
+
+   cmd_config.criteria = cpu_to_le32(criteria);
+   cmd_config.gpio = gpio;
+   cmd_config.gap = gap;
+
+   ret = lbs_cmd_with_response(priv, CMD_802_11_HOST_SLEEP_CFG, 
cmd_config);
+   if (ret) {
+   lbs_pr_info(HOST_SLEEP_CFG failed %d\n, ret);
+   return ret;
+   }
+   return ret;
+}
+EXPORT_SYMBOL_GPL(lbs_host_sleep_cfg);
+
 static int lbs_cmd_802_11_ps_mode(struct lbs_private *priv,
   struct cmd_ds_command *cmd,
   u16 cmd_action)
diff --git a/drivers/net/wireless/libertas/cmd.h 
b/drivers/net/wireless/libertas/cmd.h
index 80714b5..8d72c7e 100644
--- a/drivers/net/wireless/libertas/cmd.h
+++ b/drivers/net/wireless/libertas/cmd.h
@@ -35,4 +35,7 @@ int lbs_set_channel(struct lbs_private *priv, u8 channel);
 
 int lbs_mesh_config(struct lbs_private *priv, int enable);
 
+int lbs_host_sleep_cfg(struct lbs_private *priv, uint32_t criteria,
+  uint8_t gpio, uint8_t gap);
+
 #endif /* _LBS_CMD_H */
diff --git a/drivers/net/wireless/libertas/defs.h 
b/drivers/net/wireless/libertas/defs.h
index 9b98ae7..3053cc2 100644
--- a/drivers/net/wireless/libertas/defs.h
+++ b/drivers/net/wireless/libertas/defs.h
@@ -141,6 +141,13 @@ static inline void lbs_deb_hex(unsigned int grp, const 
char *prompt, u8 *buf, in
 #defineLBS_UPLD_SIZE   2312
 #define DEV_NAME_LEN   32
 
+/* Wake criteria for HOST_SLEEP_CFG command */
+#define EHS_WAKE_ON_BROADCAST_DATA 0x0001
+#define EHS_WAKE_ON_UNICAST_DATA   0x0002
+#define EHS_WAKE_ON_MAC_EVENT  0x0004
+#define EHS_WAKE_ON_MULTICAST_DATA 0x0008
+#define EHS_REMOVE_WAKEUP  0x
+
 /** Misc constants */
 /* This section defines 802.11 specific contants */
 
diff --git a/drivers/net/wireless/libertas/host.h 
b/drivers/net/wireless/libertas/host.h
index 64178cf..fe00081 100644
--- a/drivers/net/wireless/libertas/host.h
+++ b/drivers/net/wireless/libertas/host.h
@@ -73,6 +73,8 @@
 #define CMD_802_11_SET_AFC 0x003c
 #define CMD_802_11_GET_AFC 0x003d
 #define CMD_802_11_AD_HOC_STOP 0x0040
+#define CMD_802_11_HOST_SLEEP_CFG  0x0043
+#define CMD_802_11_HOST_SLEEP_ACTIVATE 0x0045
 #define CMD_802_11_BEACON_STOP 0x0049
 #define CMD_802_11_MAC_ADDRESS 0x004d
 #define CMD_802_11_LED_GPIO_CTRL   0x004e
diff --git a/drivers/net/wireless/libertas/hostcmd.h 
b/drivers/net/wireless/libertas/hostcmd.h
index aab5d64..aa4cea0 100644
--- a/drivers/net/wireless/libertas/hostcmd.h
+++ b/drivers/net/wireless/libertas/hostcmd.h
@@ -540,6 +540,13 @@ struct MrvlIEtype_keyParamSet {
u8 key[32];
 };
 
+struct cmd_ds_host_sleep {
+   struct cmd_header hdr;
+   __le32 criteria;
+   uint8_t gpio;
+   uint8_t gap;
+} __attribute__ ((packed));
+
 struct cmd_ds_802_11_key_material {
__le16 action;
struct MrvlIEtype_keyParamSet keyParamSet[2];
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


libertas: add ethtool support for wake-on-lan configuration

2008-01-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=506e9025e030c441679fb1ae77fb0d6266c34443
Commit: 506e9025e030c441679fb1ae77fb0d6266c34443
Parent: d1f7a5b8cfefdb443a05a9e3d636fe7fef57459a
Author: David Woodhouse [EMAIL PROTECTED]
AuthorDate: Wed Dec 12 20:06:06 2007 -0500
Committer:  David S. Miller [EMAIL PROTECTED]
CommitDate: Mon Jan 28 15:07:05 2008 -0800

libertas: add ethtool support for wake-on-lan configuration

Also, check that suspend is refused if HOST_SLEEP_CFG hasn't been done.

Signed-off-by: David Woodhouse [EMAIL PROTECTED]
Signed-off-by: John W. Linville [EMAIL PROTECTED]
---
 drivers/net/wireless/libertas/cmd.c |   14 +
 drivers/net/wireless/libertas/cmd.h |3 +-
 drivers/net/wireless/libertas/dev.h |5 +++
 drivers/net/wireless/libertas/ethtool.c |   47 +++
 drivers/net/wireless/libertas/if_usb.c  |6 ++--
 drivers/net/wireless/libertas/main.c|8 +
 6 files changed, 72 insertions(+), 11 deletions(-)

diff --git a/drivers/net/wireless/libertas/cmd.c 
b/drivers/net/wireless/libertas/cmd.c
index f87cecb..ddf1527 100644
--- a/drivers/net/wireless/libertas/cmd.c
+++ b/drivers/net/wireless/libertas/cmd.c
@@ -111,21 +111,23 @@ out:
return ret;
 }
 
-int lbs_host_sleep_cfg(struct lbs_private *priv, uint32_t criteria,
-  uint8_t gpio, uint8_t gap)
+int lbs_host_sleep_cfg(struct lbs_private *priv, uint32_t criteria)
 {
struct cmd_ds_host_sleep cmd_config;
int ret;
 
cmd_config.criteria = cpu_to_le32(criteria);
-   cmd_config.gpio = gpio;
-   cmd_config.gap = gap;
+   cmd_config.gpio = priv-wol_gpio;
+   cmd_config.gap = priv-wol_gap;
 
ret = lbs_cmd_with_response(priv, CMD_802_11_HOST_SLEEP_CFG, 
cmd_config);
-   if (ret) {
+   if (!ret) {
+   lbs_deb_cmd(Set WOL criteria to %x\n, criteria);
+   priv-wol_criteria = criteria;
+   } else {
lbs_pr_info(HOST_SLEEP_CFG failed %d\n, ret);
-   return ret;
}
+
return ret;
 }
 EXPORT_SYMBOL_GPL(lbs_host_sleep_cfg);
diff --git a/drivers/net/wireless/libertas/cmd.h 
b/drivers/net/wireless/libertas/cmd.h
index e44a0db..55f2436 100644
--- a/drivers/net/wireless/libertas/cmd.h
+++ b/drivers/net/wireless/libertas/cmd.h
@@ -33,8 +33,7 @@ int lbs_set_channel(struct lbs_private *priv, u8 channel);
 
 int lbs_mesh_config(struct lbs_private *priv, int enable);
 
-int lbs_host_sleep_cfg(struct lbs_private *priv, uint32_t criteria,
-  uint8_t gpio, uint8_t gap);
+int lbs_host_sleep_cfg(struct lbs_private *priv, uint32_t criteria);
 int lbs_suspend(struct lbs_private *priv);
 int lbs_resume(struct lbs_private *priv);
 
diff --git a/drivers/net/wireless/libertas/dev.h 
b/drivers/net/wireless/libertas/dev.h
index 86b45a4..60a6a51 100644
--- a/drivers/net/wireless/libertas/dev.h
+++ b/drivers/net/wireless/libertas/dev.h
@@ -153,6 +153,11 @@ struct lbs_private {
int (*hw_get_int_status) (struct lbs_private *priv, u8 *);
int (*hw_read_event_cause) (struct lbs_private *);
 
+   /* Wake On LAN */
+   uint32_t wol_criteria;
+   uint8_t wol_gpio;
+   uint8_t wol_gap;
+
/* was struct lbs_adapter from here... */
 
/** Wlan adapter data structure*/
diff --git a/drivers/net/wireless/libertas/ethtool.c 
b/drivers/net/wireless/libertas/ethtool.c
index a54b4f4..21e6f98 100644
--- a/drivers/net/wireless/libertas/ethtool.c
+++ b/drivers/net/wireless/libertas/ethtool.c
@@ -8,6 +8,8 @@
 #include dev.h
 #include join.h
 #include wext.h
+#include cmd.h
+
 static const char * mesh_stat_strings[]= {
drop_duplicate_bcast,
drop_ttl_zero,
@@ -172,6 +174,49 @@ static void lbs_ethtool_get_strings(struct net_device *dev,
lbs_deb_enter(LBS_DEB_ETHTOOL);
 }
 
+static void lbs_ethtool_get_wol(struct net_device *dev,
+   struct ethtool_wolinfo *wol)
+{
+   struct lbs_private *priv = dev-priv;
+
+   if (priv-wol_criteria == 0x) {
+   /* Interface driver didn't configure wake */
+   wol-supported = wol-wolopts = 0;
+   return;
+   }
+
+   wol-supported = WAKE_UCAST|WAKE_MCAST|WAKE_BCAST|WAKE_PHY;
+
+   if (priv-wol_criteria  EHS_WAKE_ON_UNICAST_DATA)
+   wol-wolopts |= WAKE_UCAST;
+   if (priv-wol_criteria  EHS_WAKE_ON_MULTICAST_DATA)
+   wol-wolopts |= WAKE_MCAST;
+   if (priv-wol_criteria  EHS_WAKE_ON_BROADCAST_DATA)
+   wol-wolopts |= WAKE_BCAST;
+   if (priv-wol_criteria  EHS_WAKE_ON_MAC_EVENT)
+   wol-wolopts |= WAKE_PHY;
+}
+
+static int lbs_ethtool_set_wol(struct net_device *dev,
+  struct ethtool_wolinfo *wol)
+{
+   struct lbs_private *priv = dev-priv;
+   uint32_t criteria = 0;
+
+   if 

e1000e endianness annotations

2008-01-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=a39fe742e71257aaae1bdddcd453877d91e681ad
Commit: a39fe742e71257aaae1bdddcd453877d91e681ad
Parent: 439104b3a39b2f576daa229d783eb2cefac8b7df
Author: Al Viro [EMAIL PROTECTED]
AuthorDate: Tue Dec 11 19:50:34 2007 +
Committer:  David S. Miller [EMAIL PROTECTED]
CommitDate: Mon Jan 28 15:07:11 2008 -0800

e1000e endianness annotations

Signed-off-by: Al Viro [EMAIL PROTECTED]
Signed-off-by: Jeff Garzik [EMAIL PROTECTED]
---
 drivers/net/e1000e/hw.h |   82 +-
 drivers/net/e1000e/netdev.c |   12 +++---
 2 files changed, 47 insertions(+), 47 deletions(-)

diff --git a/drivers/net/e1000e/hw.h b/drivers/net/e1000e/hw.h
index 71f93ce..3c5862f 100644
--- a/drivers/net/e1000e/hw.h
+++ b/drivers/net/e1000e/hw.h
@@ -423,35 +423,35 @@ enum e1000_smart_speed {
 
 /* Receive Descriptor */
 struct e1000_rx_desc {
-   u64 buffer_addr; /* Address of the descriptor's data buffer */
-   u16 length;  /* Length of data DMAed into data buffer */
-   u16 csum;   /* Packet checksum */
+   __le64 buffer_addr; /* Address of the descriptor's data buffer */
+   __le16 length;  /* Length of data DMAed into data buffer */
+   __le16 csum;/* Packet checksum */
u8  status;  /* Descriptor status */
u8  errors;  /* Descriptor Errors */
-   u16 special;
+   __le16 special;
 };
 
 /* Receive Descriptor - Extended */
 union e1000_rx_desc_extended {
struct {
-   u64 buffer_addr;
-   u64 reserved;
+   __le64 buffer_addr;
+   __le64 reserved;
} read;
struct {
struct {
-   u32 mrq;  /* Multiple Rx Queues */
+   __le32 mrq;   /* Multiple Rx Queues */
union {
-   u32 rss;/* RSS Hash */
+   __le32 rss; /* RSS Hash */
struct {
-   u16 ip_id;  /* IP id */
-   u16 csum;   /* Packet Checksum */
+   __le16 ip_id;  /* IP id */
+   __le16 csum;   /* Packet Checksum */
} csum_ip;
} hi_dword;
} lower;
struct {
-   u32 status_error; /* ext status/error */
-   u16 length;
-   u16 vlan;/* VLAN tag */
+   __le32 status_error; /* ext status/error */
+   __le16 length;
+   __le16 vlan; /* VLAN tag */
} upper;
} wb;  /* writeback */
 };
@@ -461,49 +461,49 @@ union e1000_rx_desc_extended {
 union e1000_rx_desc_packet_split {
struct {
/* one buffer for protocol header(s), three data buffers */
-   u64 buffer_addr[MAX_PS_BUFFERS];
+   __le64 buffer_addr[MAX_PS_BUFFERS];
} read;
struct {
struct {
-   u32 mrq;  /* Multiple Rx Queues */
+   __le32 mrq;   /* Multiple Rx Queues */
union {
-   u32 rss;  /* RSS Hash */
+   __le32 rss;   /* RSS Hash */
struct {
-   u16 ip_id;/* IP id */
-   u16 csum; /* Packet Checksum */
+   __le16 ip_id;/* IP id */
+   __le16 csum; /* Packet Checksum */
} csum_ip;
} hi_dword;
} lower;
struct {
-   u32 status_error; /* ext status/error */
-   u16 length0;  /* length of buffer 0 */
-   u16 vlan;/* VLAN tag */
+   __le32 status_error; /* ext status/error */
+   __le16 length0;   /* length of buffer 0 */
+   __le16 vlan; /* VLAN tag */
} middle;
struct {
-   u16 header_status;
-   u16 length[3];  /* length of buffers 1-3 */
+   __le16 header_status;
+   __le16 length[3];   /* length of buffers 1-3 */
} upper;
-   u64 reserved;
+   __le64 reserved;
} wb; /* writeback */
 };
 
 /* Transmit Descriptor */
 struct e1000_tx_desc {
-   u64 buffer_addr;  /* Address of the descriptor's data buffer */
+   __le64 

[NETNS]: Consolidate kernel netlink socket destruction.

2008-01-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b7c6ba6eb1234e35a74fb8ba8123232a7b1ba9e4
Commit: b7c6ba6eb1234e35a74fb8ba8123232a7b1ba9e4
Parent: 4f84d82f7a623f8641af2574425c329431ff158f
Author: Denis V. Lunev [EMAIL PROTECTED]
AuthorDate: Mon Jan 28 14:41:19 2008 -0800
Committer:  David S. Miller [EMAIL PROTECTED]
CommitDate: Mon Jan 28 15:08:07 2008 -0800

[NETNS]: Consolidate kernel netlink socket destruction.

Create a specific helper for netlink kernel socket disposal. This just
let the code look better and provides a ground for proper disposal
inside a namespace.

Signed-off-by: Denis V. Lunev [EMAIL PROTECTED]
Tested-by: Alexey Dobriyan [EMAIL PROTECTED]
Signed-off-by: David S. Miller [EMAIL PROTECTED]
---
 drivers/connector/connector.c   |9 +++--
 drivers/scsi/scsi_netlink.c |2 +-
 drivers/scsi/scsi_transport_iscsi.c |4 ++--
 fs/ecryptfs/netlink.c   |3 +--
 include/linux/netlink.h |1 +
 net/bridge/netfilter/ebt_ulog.c |4 ++--
 net/core/rtnetlink.c|2 +-
 net/decnet/netfilter/dn_rtmsg.c |4 ++--
 net/ipv4/fib_frontend.c |2 +-
 net/ipv4/inet_diag.c|2 +-
 net/ipv4/netfilter/ip_queue.c   |4 ++--
 net/ipv4/netfilter/ipt_ULOG.c   |4 ++--
 net/ipv6/netfilter/ip6_queue.c  |4 ++--
 net/netfilter/nfnetlink.c   |2 +-
 net/netlink/af_netlink.c|   11 +++
 net/xfrm/xfrm_user.c|2 +-
 16 files changed, 34 insertions(+), 26 deletions(-)

diff --git a/drivers/connector/connector.c b/drivers/connector/connector.c
index 37976dc..fea2d3e 100644
--- a/drivers/connector/connector.c
+++ b/drivers/connector/connector.c
@@ -420,8 +420,7 @@ static int __devinit cn_init(void)
 
dev-cbdev = cn_queue_alloc_dev(cqueue, dev-nls);
if (!dev-cbdev) {
-   if (dev-nls-sk_socket)
-   sock_release(dev-nls-sk_socket);
+   netlink_kernel_release(dev-nls);
return -EINVAL;
}

@@ -431,8 +430,7 @@ static int __devinit cn_init(void)
if (err) {
cn_already_initialized = 0;
cn_queue_free_dev(dev-cbdev);
-   if (dev-nls-sk_socket)
-   sock_release(dev-nls-sk_socket);
+   netlink_kernel_release(dev-nls);
return -EINVAL;
}
 
@@ -447,8 +445,7 @@ static void __devexit cn_fini(void)
 
cn_del_callback(dev-id);
cn_queue_free_dev(dev-cbdev);
-   if (dev-nls-sk_socket)
-   sock_release(dev-nls-sk_socket);
+   netlink_kernel_release(dev-nls);
 }
 
 subsys_initcall(cn_init);
diff --git a/drivers/scsi/scsi_netlink.c b/drivers/scsi/scsi_netlink.c
index 3e15918..370c78c 100644
--- a/drivers/scsi/scsi_netlink.c
+++ b/drivers/scsi/scsi_netlink.c
@@ -164,7 +164,7 @@ void
 scsi_netlink_exit(void)
 {
if (scsi_nl_sock) {
-   sock_release(scsi_nl_sock-sk_socket);
+   netlink_kernel_release(scsi_nl_sock);
netlink_unregister_notifier(scsi_netlink_notifier);
}
 
diff --git a/drivers/scsi/scsi_transport_iscsi.c 
b/drivers/scsi/scsi_transport_iscsi.c
index ef0e742..0d7b4e7 100644
--- a/drivers/scsi/scsi_transport_iscsi.c
+++ b/drivers/scsi/scsi_transport_iscsi.c
@@ -1558,7 +1558,7 @@ static __init int iscsi_transport_init(void)
return 0;
 
 release_nls:
-   sock_release(nls-sk_socket);
+   netlink_kernel_release(nls);
 unregister_session_class:
transport_class_unregister(iscsi_session_class);
 unregister_conn_class:
@@ -1573,7 +1573,7 @@ unregister_transport_class:
 static void __exit iscsi_transport_exit(void)
 {
destroy_workqueue(iscsi_eh_timer_workq);
-   sock_release(nls-sk_socket);
+   netlink_kernel_release(nls);
transport_class_unregister(iscsi_connection_class);
transport_class_unregister(iscsi_session_class);
transport_class_unregister(iscsi_host_class);
diff --git a/fs/ecryptfs/netlink.c b/fs/ecryptfs/netlink.c
index 9aa3451..f638a69 100644
--- a/fs/ecryptfs/netlink.c
+++ b/fs/ecryptfs/netlink.c
@@ -237,7 +237,6 @@ out:
  */
 void ecryptfs_release_netlink(void)
 {
-   if (ecryptfs_nl_sock  ecryptfs_nl_sock-sk_socket)
-   sock_release(ecryptfs_nl_sock-sk_socket);
+   netlink_kernel_release(ecryptfs_nl_sock);
ecryptfs_nl_sock = NULL;
 }
diff --git a/include/linux/netlink.h b/include/linux/netlink.h
index 2aee0f5..bd13b6f 100644
--- a/include/linux/netlink.h
+++ b/include/linux/netlink.h
@@ -178,6 +178,7 @@ extern struct sock *netlink_kernel_create(struct net *net,
  void (*input)(struct sk_buff *skb),
  struct mutex *cb_mutex,
  struct module *module);
+extern void 

annotate tun

2008-01-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=a3edb08311fc559652ffc959e93eb5be9294443f
Commit: a3edb08311fc559652ffc959e93eb5be9294443f
Parent: 7eefb04eb0761ce220890975fe33b7c262612c0d
Author: Al Viro [EMAIL PROTECTED]
AuthorDate: Sat Dec 22 17:52:42 2007 +
Committer:  David S. Miller [EMAIL PROTECTED]
CommitDate: Mon Jan 28 15:07:57 2008 -0800

annotate tun

Signed-off-by: Al Viro [EMAIL PROTECTED]
Signed-off-by: Jeff Garzik [EMAIL PROTECTED]
---
 drivers/net/tun.c  |2 +-
 include/linux/if_tun.h |4 +++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index 5db4df4..46339f6 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -506,7 +506,7 @@ static int tun_set_iff(struct file *file, struct ifreq *ifr)
/* Be promiscuous by default to maintain previous behaviour. */
tun-if_flags = IFF_PROMISC;
/* Generate random Ethernet address. */
-   *(u16 *)tun-dev_addr = htons(0x00FF);
+   *(__be16 *)tun-dev_addr = htons(0x00FF);
get_random_bytes(tun-dev_addr + sizeof(u16), 4);
memset(tun-chr_filter, 0, sizeof tun-chr_filter);
 
diff --git a/include/linux/if_tun.h b/include/linux/if_tun.h
index 33e489d..72f1c5f 100644
--- a/include/linux/if_tun.h
+++ b/include/linux/if_tun.h
@@ -21,6 +21,8 @@
 /* Uncomment to enable debugging */
 /* #define TUN_DEBUG 1 */
 
+#include linux/types.h
+
 #ifdef __KERNEL__
 
 #ifdef TUN_DEBUG
@@ -88,7 +90,7 @@ struct tun_struct {
 
 struct tun_pi {
unsigned short flags;
-   unsigned short proto;
+   __be16 proto;
 };
 #define TUN_PKT_STRIP  0x0001
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


libertas: convert ENABLE_RSN to a direct command

2008-01-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=4f59abf190b15350167bec5382dda205030ac9d0
Commit: 4f59abf190b15350167bec5382dda205030ac9d0
Parent: f70dd4515a8ad9c9d59ebb8c1d1fa2c610fb4020
Author: David Woodhouse [EMAIL PROTECTED]
AuthorDate: Tue Dec 18 00:47:17 2007 -0500
Committer:  David S. Miller [EMAIL PROTECTED]
CommitDate: Mon Jan 28 15:07:50 2008 -0800

libertas: convert ENABLE_RSN to a direct command

Signed-off-by: David Woodhouse [EMAIL PROTECTED]
Signed-off-by: John W. Linville [EMAIL PROTECTED]
---
 drivers/net/wireless/libertas/assoc.c   |   19 -
 drivers/net/wireless/libertas/cmd.c |   32 +-
 drivers/net/wireless/libertas/cmd.h |2 +
 drivers/net/wireless/libertas/cmdresp.c |   21 
 drivers/net/wireless/libertas/hostcmd.h |3 +-
 5 files changed, 23 insertions(+), 54 deletions(-)

diff --git a/drivers/net/wireless/libertas/assoc.c 
b/drivers/net/wireless/libertas/assoc.c
index e91cd67..c622e9b 100644
--- a/drivers/net/wireless/libertas/assoc.c
+++ b/drivers/net/wireless/libertas/assoc.c
@@ -305,8 +305,8 @@ static int assoc_helper_secinfo(struct lbs_private *priv,
 struct assoc_request * assoc_req)
 {
int ret = 0;
-   u32 do_wpa;
-   u32 rsn = 0;
+   uint16_t do_wpa;
+   uint16_t rsn = 0;
 
lbs_deb_enter(LBS_DEB_ASSOC);
 
@@ -323,28 +323,19 @@ static int assoc_helper_secinfo(struct lbs_private *priv,
 */
 
/* Get RSN enabled/disabled */
-   ret = lbs_prepare_and_send_command(priv,
-   CMD_802_11_ENABLE_RSN,
-   CMD_ACT_GET,
-   CMD_OPTION_WAITFORRSP,
-   0, rsn);
+   ret = lbs_cmd_802_11_enable_rsn(priv, CMD_ACT_GET, rsn);
if (ret) {
lbs_deb_assoc(Failed to get RSN status: %d\n, ret);
goto out;
}
 
/* Don't re-enable RSN if it's already enabled */
-   do_wpa = (assoc_req-secinfo.WPAenabled || 
assoc_req-secinfo.WPA2enabled);
+   do_wpa = assoc_req-secinfo.WPAenabled || 
assoc_req-secinfo.WPA2enabled;
if (do_wpa == rsn)
goto out;
 
/* Set RSN enabled/disabled */
-   rsn = do_wpa;
-   ret = lbs_prepare_and_send_command(priv,
-   CMD_802_11_ENABLE_RSN,
-   CMD_ACT_SET,
-   CMD_OPTION_WAITFORRSP,
-   0, rsn);
+   ret = lbs_cmd_802_11_enable_rsn(priv, CMD_ACT_SET, do_wpa);
 
 out:
lbs_deb_leave_args(LBS_DEB_ASSOC, ret %d, ret);
diff --git a/drivers/net/wireless/libertas/cmd.c 
b/drivers/net/wireless/libertas/cmd.c
index 05e25ce..5d2c928 100644
--- a/drivers/net/wireless/libertas/cmd.c
+++ b/drivers/net/wireless/libertas/cmd.c
@@ -300,30 +300,31 @@ done:
return ret;
 }
 
-static int lbs_cmd_802_11_enable_rsn(struct lbs_private *priv,
- struct cmd_ds_command *cmd,
- u16 cmd_action,
- void * pdata_buf)
+int lbs_cmd_802_11_enable_rsn(struct lbs_private *priv, uint16_t cmd_action,
+ uint16_t *enable)
 {
-   struct cmd_ds_802_11_enable_rsn *penableRSN = cmd-params.enbrsn;
-   u32 * enable = pdata_buf;
+   struct cmd_ds_802_11_enable_rsn cmd;
+   int ret;
 
lbs_deb_enter(LBS_DEB_CMD);
 
-   cmd-command = cpu_to_le16(CMD_802_11_ENABLE_RSN);
-   cmd-size = cpu_to_le16(sizeof(*penableRSN) + S_DS_GEN);
-   penableRSN-action = cpu_to_le16(cmd_action);
+   cmd.hdr.size = cpu_to_le16(sizeof(cmd));
+   cmd.action = cpu_to_le16(cmd_action);
 
if (cmd_action == CMD_ACT_SET) {
if (*enable)
-   penableRSN-enable = cpu_to_le16(CMD_ENABLE_RSN);
+   cmd.enable = cpu_to_le16(CMD_ENABLE_RSN);
else
-   penableRSN-enable = cpu_to_le16(CMD_DISABLE_RSN);
+   cmd.enable = cpu_to_le16(CMD_DISABLE_RSN);
lbs_deb_cmd(ENABLE_RSN: %d\n, *enable);
}
 
-   lbs_deb_leave(LBS_DEB_CMD);
-   return 0;
+   ret = lbs_cmd_with_response(priv, CMD_802_11_ENABLE_RSN, cmd);
+   if (!ret  cmd_action == CMD_ACT_GET)
+   *enable = le16_to_cpu(cmd.enable);
+
+   lbs_deb_leave_args(LBS_DEB_CMD, ret %d, ret);
+   return ret;
 }
 
 
@@ -1473,11 +1474,6 @@ int lbs_prepare_and_send_command(struct lbs_private 
*priv,
ret = lbs_cmd_80211_ad_hoc_stop(priv, cmdptr);
break;
 
-   case CMD_802_11_ENABLE_RSN:
-   ret = lbs_cmd_802_11_enable_rsn(priv, cmdptr, cmd_action,
-   pdata_buf);
-   break;
-
case 

libertas: submit RSSI command on tx timeout, to check whether module is dead

2008-01-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=354eca9820f1efbf11978585640f1b2e92d4c5b4
Commit: 354eca9820f1efbf11978585640f1b2e92d4c5b4
Parent: 18c52e7c3e3d0e7fbddd0334b58030bb89554cb9
Author: David Woodhouse [EMAIL PROTECTED]
AuthorDate: Mon Dec 17 19:22:40 2007 -0500
Committer:  David S. Miller [EMAIL PROTECTED]
CommitDate: Mon Jan 28 15:07:46 2008 -0800

libertas: submit RSSI command on tx timeout, to check whether module is dead

We don't necessarily want to reset the device on a TX timeout. But more
often than not, the real cause is that the firmware has crapped itself,
not just that the network is busy. So submit any harmless command, and
if _that_ times out, then the error handling code will reset the module,
as appropriate.

Signed-off-by: David Woodhouse [EMAIL PROTECTED]
Signed-off-by: John W. Linville [EMAIL PROTECTED]
---
 drivers/net/wireless/libertas/main.c |7 +++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/drivers/net/wireless/libertas/main.c 
b/drivers/net/wireless/libertas/main.c
index 9677b0d..74353e1 100644
--- a/drivers/net/wireless/libertas/main.c
+++ b/drivers/net/wireless/libertas/main.c
@@ -476,6 +476,13 @@ static void lbs_tx_timeout(struct net_device *dev)
   to kick it somehow? */
lbs_host_to_card_done(priv);
 
+   /* More often than not, this actually happens because the
+  firmware has crapped itself -- rather than just a very
+  busy medium. So send a harmless command, and if/when
+  _that_ times out, we'll kick it in the head. */
+   lbs_prepare_and_send_command(priv, CMD_802_11_RSSI, 0,
+0, 0, NULL);
+
lbs_deb_leave(LBS_DEB_TX);
 }
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


libertas: make lbs_submit_command always 'succeed' and set command timer

2008-01-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=18c52e7c3e3d0e7fbddd0334b58030bb89554cb9
Commit: 18c52e7c3e3d0e7fbddd0334b58030bb89554cb9
Parent: 8538823f7c692c98e8b7e19cb580faa56e25e89f
Author: David Woodhouse [EMAIL PROTECTED]
AuthorDate: Mon Dec 17 16:03:58 2007 -0500
Committer:  David S. Miller [EMAIL PROTECTED]
CommitDate: Mon Jan 28 15:07:46 2008 -0800

libertas: make lbs_submit_command always 'succeed' and set command timer

Even if it fails, we want to wait a while and try again, with an
ultimate timeout if it the condition persists. So again, just use the
standard command timeout behaviour.

Signed-off-by: David Woodhouse [EMAIL PROTECTED]
Signed-off-by: John W. Linville [EMAIL PROTECTED]
---
 drivers/net/wireless/libertas/cmd.c |   42 --
 1 files changed, 20 insertions(+), 22 deletions(-)

diff --git a/drivers/net/wireless/libertas/cmd.c 
b/drivers/net/wireless/libertas/cmd.c
index 10c60ba..0ae9851 100644
--- a/drivers/net/wireless/libertas/cmd.c
+++ b/drivers/net/wireless/libertas/cmd.c
@@ -1199,14 +1199,15 @@ done:
lbs_deb_leave(LBS_DEB_HOST);
 }
 
-static int lbs_submit_command(struct lbs_private *priv,
- struct cmd_ctrl_node *cmdnode)
+static void lbs_submit_command(struct lbs_private *priv,
+  struct cmd_ctrl_node *cmdnode)
 {
unsigned long flags;
struct cmd_header *cmd;
-   int ret = -1;
-   u16 cmdsize;
-   u16 command;
+   uint16_t cmdsize;
+   uint16_t command;
+   int timeo = 5 * HZ;
+   int ret;
 
lbs_deb_enter(LBS_DEB_HOST);
 
@@ -1220,33 +1221,30 @@ static int lbs_submit_command(struct lbs_private *priv,
cmdsize = le16_to_cpu(cmd-size);
command = le16_to_cpu(cmd-command);
 
+   /* These commands take longer */
+   if (command == CMD_802_11_SCAN || command == CMD_802_11_ASSOCIATE ||
+   command == CMD_802_11_AUTHENTICATE)
+   timeo = 10 * HZ;
+
lbs_deb_host(DNLD_CMD: command 0x%04x, seq %d, size %d, jiffies %lu\n,
 command, le16_to_cpu(cmd-seqnum), cmdsize, jiffies);
lbs_deb_hex(LBS_DEB_HOST, DNLD_CMD, (void *) cmdnode-cmdbuf, 
cmdsize);
 
ret = priv-hw_host_to_card(priv, MVMS_CMD, (u8 *) cmd, cmdsize);
+
if (ret) {
lbs_pr_info(DNLD_CMD: hw_host_to_card failed: %d\n, ret);
-   spin_lock_irqsave(priv-driver_lock, flags);
-   lbs_complete_command(priv, priv-cur_cmd, ret);
-   spin_unlock_irqrestore(priv-driver_lock, flags);
-   goto done;
-   }
-
-   lbs_deb_cmd(DNLD_CMD: sent command 0x%04x, jiffies %lu\n, command, 
jiffies);
+   /* Let the timer kick in and retry, and potentially reset
+  the whole thing if the condition persists */
+   timeo = HZ;
+   } else
+   lbs_deb_cmd(DNLD_CMD: sent command 0x%04x, jiffies %lu\n,
+   command, jiffies);
 
/* Setup the timer after transmit command */
-   if (command == CMD_802_11_SCAN || command == CMD_802_11_AUTHENTICATE
-   || command == CMD_802_11_ASSOCIATE)
-   mod_timer(priv-command_timer, jiffies + (10*HZ));
-   else
-   mod_timer(priv-command_timer, jiffies + (5*HZ));
-
-   ret = 0;
+   mod_timer(priv-command_timer, jiffies + timeo);
 
-done:
-   lbs_deb_leave_args(LBS_DEB_HOST, ret %d, ret);
-   return ret;
+   lbs_deb_leave(LBS_DEB_HOST);
 }
 
 static int lbs_cmd_mac_control(struct lbs_private *priv,
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


libertas: reduce explicit references to priv-cur_cmd-cmdbuf

2008-01-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=ac4cced6e850496b66c0825b7f74d51ef02c6371
Commit: ac4cced6e850496b66c0825b7f74d51ef02c6371
Parent: 4694961cc2f868d6061be3b2c3d1fcf39584ff17
Author: David Woodhouse [EMAIL PROTECTED]
AuthorDate: Mon Dec 17 15:12:49 2007 -0500
Committer:  David S. Miller [EMAIL PROTECTED]
CommitDate: Mon Jan 28 15:07:44 2008 -0800

libertas: reduce explicit references to priv-cur_cmd-cmdbuf

We have a local variable 'resp' which we use for this. So use it,
instead of typing the whole thing.

In preparation for actually using priv-upld_buf for the responses
instead...

Signed-off-by: David Woodhouse [EMAIL PROTECTED]
Signed-off-by: John W. Linville [EMAIL PROTECTED]
---
 drivers/net/wireless/libertas/cmdresp.c |8 
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wireless/libertas/cmdresp.c 
b/drivers/net/wireless/libertas/cmdresp.c
index 8f9eda4..d305e98 100644
--- a/drivers/net/wireless/libertas/cmdresp.c
+++ b/drivers/net/wireless/libertas/cmdresp.c
@@ -639,10 +639,10 @@ int lbs_process_rx_command(struct lbs_private *priv)
goto done;
}
 
-   curcmd = le16_to_cpu(priv-cur_cmd-cmdbuf-command);
-
resp = priv-cur_cmd-cmdbuf;
 
+   curcmd = le16_to_cpu(resp-command);
+
respcmd = le16_to_cpu(resp-command);
result = le16_to_cpu(resp-result);
 
@@ -650,9 +650,9 @@ int lbs_process_rx_command(struct lbs_private *priv)
 respcmd, le16_to_cpu(resp-seqnum), priv-upld_len, 
jiffies);
lbs_deb_hex(LBS_DEB_HOST, CMD_RESP, (void *) resp, priv-upld_len);
 
-   if (resp-seqnum != priv-cur_cmd-cmdbuf-seqnum) {
+   if (resp-seqnum != resp-seqnum) {
lbs_pr_info(Received CMD_RESP with invalid sequence %d 
(expected %d)\n,
-   le16_to_cpu(resp-seqnum), 
le16_to_cpu(priv-cur_cmd-cmdbuf-seqnum));
+   le16_to_cpu(resp-seqnum), 
le16_to_cpu(resp-seqnum));
spin_unlock_irqrestore(priv-driver_lock, flags);
ret = -1;
goto done;
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


libertas: don't clear priv-dnld_sent after sending sleep confirm

2008-01-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=24dba5f39194c57f98090d1ee504be5740dc521c
Commit: 24dba5f39194c57f98090d1ee504be5740dc521c
Parent: 38bfab1a01c66cb1a5001dc702b0856b2f942fd5
Author: David Woodhouse [EMAIL PROTECTED]
AuthorDate: Mon Dec 17 12:35:28 2007 -0500
Committer:  David S. Miller [EMAIL PROTECTED]
CommitDate: Mon Jan 28 15:07:41 2008 -0800

libertas: don't clear priv-dnld_sent after sending sleep confirm

DNLD_RES_RECEIVED is a bit of a misnomer -- we never wait for the result
to be received; it's purely representing the state of the TX path, and
in this case the TX path is definitely busy.

Of course, that means that we don't actually care about DATA_SENT vs.
CMD_SENT either, but that's a can of worms for another day...

Signed-off-by: David Woodhouse [EMAIL PROTECTED]
Signed-off-by: John W. Linville [EMAIL PROTECTED]
---
 drivers/net/wireless/libertas/cmd.c |1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/drivers/net/wireless/libertas/cmd.c 
b/drivers/net/wireless/libertas/cmd.c
index 2765b9c..10c60ba 100644
--- a/drivers/net/wireless/libertas/cmd.c
+++ b/drivers/net/wireless/libertas/cmd.c
@@ -2000,7 +2000,6 @@ static int sendconfirmsleep(struct lbs_private *priv, u8 
*cmdptr, u16 size)
lbs_deb_hex(LBS_DEB_HOST, sleep confirm command, cmdptr, size);
 
ret = priv-hw_host_to_card(priv, MVMS_CMD, cmdptr, size);
-   priv-dnld_sent = DNLD_RES_RECEIVED;
 
spin_lock_irqsave(priv-driver_lock, flags);
if (priv-intcounter || priv-currenttxskb)
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


libertas: handle command timeout in main thread instead of directly in timer

2008-01-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=2a345099a4fbe551a1982630b3d89c85fa5a341d
Commit: 2a345099a4fbe551a1982630b3d89c85fa5a341d
Parent: 9fae899c2b5dc224042da63b14118abdb22ae9b6
Author: David Woodhouse [EMAIL PROTECTED]
AuthorDate: Sat Dec 15 19:33:43 2007 -0500
Committer:  David S. Miller [EMAIL PROTECTED]
CommitDate: Mon Jan 28 15:07:37 2008 -0800

libertas: handle command timeout in main thread instead of directly in timer

And handle the case where it times out more than once, too, instead of
locking up for ever.

Signed-off-by: David Woodhouse [EMAIL PROTECTED]
Signed-off-by: John W. Linville [EMAIL PROTECTED]
---
 drivers/net/wireless/libertas/cmdresp.c |6 +++
 drivers/net/wireless/libertas/dev.h |2 +
 drivers/net/wireless/libertas/main.c|   52 ++-
 3 files changed, 38 insertions(+), 22 deletions(-)

diff --git a/drivers/net/wireless/libertas/cmdresp.c 
b/drivers/net/wireless/libertas/cmdresp.c
index 4c22e78..ef63c37 100644
--- a/drivers/net/wireless/libertas/cmdresp.c
+++ b/drivers/net/wireless/libertas/cmdresp.c
@@ -667,6 +667,12 @@ int lbs_process_rx_command(struct lbs_private *priv)
 
/* Now we got response from FW, cancel the command timer */
del_timer(priv-command_timer);
+   priv-cmd_timed_out = 0;
+   if (priv-nr_retries) {
+   lbs_pr_info(Received result %x to command %x after %d 
retries\n,
+   result, curcmd, priv-nr_retries);
+   priv-nr_retries = 0;
+   }
 
/* Store the response code to cur_cmd_retcode. */
priv-cur_cmd_retcode = result;
diff --git a/drivers/net/wireless/libertas/dev.h 
b/drivers/net/wireless/libertas/dev.h
index e6f553d..465080f 100644
--- a/drivers/net/wireless/libertas/dev.h
+++ b/drivers/net/wireless/libertas/dev.h
@@ -201,6 +201,8 @@ struct lbs_private {
 
/** Timers */
struct timer_list command_timer;
+   int nr_retries;
+   int cmd_timed_out;
 
u8 hisregcpy;
 
diff --git a/drivers/net/wireless/libertas/main.c 
b/drivers/net/wireless/libertas/main.c
index 839ffe8..9677b0d 100644
--- a/drivers/net/wireless/libertas/main.c
+++ b/drivers/net/wireless/libertas/main.c
@@ -670,6 +670,8 @@ static int lbs_thread(void *data)
shouldsleep = 1;/* Sleep mode. Nothing we can 
do till it wakes */
else if (priv-intcounter)
shouldsleep = 0;/* Interrupt pending. Deal with 
it now */
+   else if (priv-cmd_timed_out)
+   shouldsleep = 0;/* Command timed out. Recover */
else if (!priv-fw_ready)
shouldsleep = 1;/* Firmware not ready. We're 
waiting for it */
else if (priv-dnld_sent)
@@ -740,6 +742,26 @@ static int lbs_thread(void *data)
spin_lock_irq(priv-driver_lock);
}
 
+   if (priv-cmd_timed_out  priv-cur_cmd) {
+   struct cmd_ctrl_node *cmdnode = priv-cur_cmd;
+
+   if (++priv-nr_retries  10) {
+   lbs_pr_info(Excessive timeouts submitting 
command %x\n,
+   
le16_to_cpu(cmdnode-cmdbuf-command));
+   lbs_complete_command(priv, cmdnode, -ETIMEDOUT);
+   priv-nr_retries = 0;
+   } else {
+   priv-cur_cmd = NULL;
+   lbs_pr_info(requeueing command %x due to 
timeout (#%d)\n,
+   
le16_to_cpu(cmdnode-cmdbuf-command), priv-nr_retries);
+
+   /* Stick it back at the _top_ of the pending 
queue
+  for immediate resubmission */
+   list_add(cmdnode-list, priv-cmdpendingq);
+   }
+   }
+   priv-cmd_timed_out = 0;
+
/* Any Card Event */
if (priv-hisregcpy  MRVDRV_CARDEVENT) {
lbs_deb_thread(main-thread: Card Event Activity\n);
@@ -922,35 +944,21 @@ done:
 static void command_timer_fn(unsigned long data)
 {
struct lbs_private *priv = (struct lbs_private *)data;
-   struct cmd_ctrl_node *node;
unsigned long flags;
 
-   node = priv-cur_cmd;
-   if (node == NULL) {
-   lbs_deb_fw(ptempnode empty\n);
-   return;
-   }
+   spin_lock_irqsave(priv-driver_lock, flags);
 
-   if (!node-cmdbuf) {
-   lbs_deb_fw(cmd is NULL\n);
-   return;
+   if (!priv-cur_cmd) {
+   lbs_pr_info(Command timer expired; no pending command\n);
+   goto out;
}
 
-   lbs_pr_info(command %x timed out\n, 
le16_to_cpu(node-cmdbuf-command));
-
-   if 

libertas: kill unused wait_option field in struct cmd_ctrl_node

2008-01-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=8e5b6b2d32304f4d6a096a6dfae23d12dc6f9287
Commit: 8e5b6b2d32304f4d6a096a6dfae23d12dc6f9287
Parent: 7e226272fcf9c1ec8b67fac995ce4227f4f76971
Author: David Woodhouse [EMAIL PROTECTED]
AuthorDate: Fri Dec 14 23:08:13 2007 -0500
Committer:  David S. Miller [EMAIL PROTECTED]
CommitDate: Mon Jan 28 15:07:28 2008 -0800

libertas: kill unused wait_option field in struct cmd_ctrl_node

Signed-off-by: David Woodhouse [EMAIL PROTECTED]
Signed-off-by: John W. Linville [EMAIL PROTECTED]
---
 drivers/net/wireless/libertas/cmd.c |   12 
 drivers/net/wireless/libertas/hostcmd.h |2 --
 2 files changed, 4 insertions(+), 10 deletions(-)

diff --git a/drivers/net/wireless/libertas/cmd.c 
b/drivers/net/wireless/libertas/cmd.c
index ffef721..5ceb331 100644
--- a/drivers/net/wireless/libertas/cmd.c
+++ b/drivers/net/wireless/libertas/cmd.c
@@ -17,7 +17,7 @@ static void cleanup_cmdnode(struct cmd_ctrl_node *ptempnode);
 static struct cmd_ctrl_node *lbs_get_cmd_ctrl_node(struct lbs_private *priv);
 static void lbs_set_cmd_ctrl_node(struct lbs_private *priv,
struct cmd_ctrl_node *ptempnode,
-   u16 wait_option, void *pdata_buf);
+   void *pdata_buf);
 
 
 /**
@@ -1392,7 +1392,7 @@ int lbs_prepare_and_send_command(struct lbs_private *priv,
goto done;
}
 
-   lbs_set_cmd_ctrl_node(priv, cmdnode, wait_option, pdata_buf);
+   lbs_set_cmd_ctrl_node(priv, cmdnode, pdata_buf);
 
cmdptr = (struct cmd_ds_command *)cmdnode-cmdbuf;
 
@@ -1554,7 +1554,7 @@ int lbs_prepare_and_send_command(struct lbs_private *priv,
case CMD_802_11_INACTIVITY_TIMEOUT:
ret = lbs_cmd_802_11_inactivity_timeout(priv, cmdptr,
 cmd_action, pdata_buf);
-   lbs_set_cmd_ctrl_node(priv, cmdnode, 0, pdata_buf);
+   lbs_set_cmd_ctrl_node(priv, cmdnode, pdata_buf);
break;
 
case CMD_802_11_TPC_CFG:
@@ -1800,7 +1800,6 @@ static void cleanup_cmdnode(struct cmd_ctrl_node *cmdnode)
return;
cmdnode-cmdwaitqwoken = 1;
wake_up_interruptible(cmdnode-cmdwait_q);
-   cmdnode-wait_option = 0;
cmdnode-pdata_buf = NULL;
cmdnode-callback = NULL;
cmdnode-callback_arg = 0;
@@ -1816,20 +1815,18 @@ static void cleanup_cmdnode(struct cmd_ctrl_node 
*cmdnode)
  *
  *  @param privA pointer to struct lbs_private structure
  *  @param ptempnode   A pointer to cmd_ctrl_node structure
- *  @param wait_option wait option: wait response or not
  *  @param pdata_buf   A pointer to informaion buffer
  *  @return0 or -1
  */
 static void lbs_set_cmd_ctrl_node(struct lbs_private *priv,
  struct cmd_ctrl_node *ptempnode,
- u16 wait_option, void *pdata_buf)
+ void *pdata_buf)
 {
lbs_deb_enter(LBS_DEB_HOST);
 
if (!ptempnode)
return;
 
-   ptempnode-wait_option = wait_option;
ptempnode-pdata_buf = pdata_buf;
ptempnode-callback = NULL;
ptempnode-callback_arg = 0;
@@ -2213,7 +2210,6 @@ int __lbs_cmd(struct lbs_private *priv, uint16_t command,
goto done;
}
 
-   cmdnode-wait_option = CMD_OPTION_WAITFORRSP;
cmdnode-callback = callback;
cmdnode-callback_arg = callback_arg;
 
diff --git a/drivers/net/wireless/libertas/hostcmd.h 
b/drivers/net/wireless/libertas/hostcmd.h
index aa4cea0..1b31250 100644
--- a/drivers/net/wireless/libertas/hostcmd.h
+++ b/drivers/net/wireless/libertas/hostcmd.h
@@ -74,8 +74,6 @@ struct cmd_header {
 
 struct cmd_ctrl_node {
struct list_head list;
-   /* wait for finish or not */
-   u16 wait_option;
/* command response */
void *pdata_buf;
int (*callback)(struct lbs_private *, unsigned long, struct cmd_header 
*);
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


S2io: Fixes to enable multiple transmit fifo support

2008-01-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=2fda096d188ddae51a0fe8cd5b13cf9c84b03c1e
Commit: 2fda096d188ddae51a0fe8cd5b13cf9c84b03c1e
Parent: bc4b6b52691bae42b1eec3eb86ab4c718387d9f0
Author: Surjit Reang [EMAIL PROTECTED]
AuthorDate: Thu Jan 24 02:08:59 2008 -0800
Committer:  David S. Miller [EMAIL PROTECTED]
CommitDate: Mon Jan 28 15:07:23 2008 -0800

S2io: Fixes to enable multiple transmit fifo support

Fixes to enable multiple transmit fifos (upto a maximum of eight).
  - Moved single tx_lock from struct s2io_nic to struct fifo_info.
  - Moved single ufo_in_band_v structure from struct s2io_nic to struct
fifo_info.
  - Assign the respective interrupt number for the transmitting fifo in the
transmit descriptor (TXD).
- Added boundary checks for number of FIFOs enabled and FIFO length.

Signed-off-by: Surjit Reang [EMAIL PROTECTED]
Signed-off-by: Sreenivasa Honnur [EMAIL PROTECTED]
Signed-off-by: Ramkrishna Vepa [EMAIL PROTECTED]
Signed-off-by: Jeff Garzik [EMAIL PROTECTED]
Signed-off-by: David S. Miller [EMAIL PROTECTED]
---
 drivers/net/s2io.c |  136 +--
 drivers/net/s2io.h |   12 -
 2 files changed, 97 insertions(+), 51 deletions(-)

diff --git a/drivers/net/s2io.c b/drivers/net/s2io.c
index 5defb0b..e2c206c 100644
--- a/drivers/net/s2io.c
+++ b/drivers/net/s2io.c
@@ -84,7 +84,7 @@
 #include s2io.h
 #include s2io-regs.h
 
-#define DRV_VERSION 2.0.26.17
+#define DRV_VERSION 2.0.26.15-1
 
 /* S2io Driver name  version. */
 static char s2io_driver_name[] = Neterion;
@@ -368,12 +368,19 @@ static void do_s2io_copy_mac_addr(struct s2io_nic *sp, 
int offset, u64 mac_addr)
 static void s2io_vlan_rx_register(struct net_device *dev,
struct vlan_group *grp)
 {
+   int i;
struct s2io_nic *nic = dev-priv;
-   unsigned long flags;
+   unsigned long flags[MAX_TX_FIFOS];
+   struct mac_info *mac_control = nic-mac_control;
+   struct config_param *config = nic-config;
+
+   for (i = 0; i  config-tx_fifo_num; i++)
+   spin_lock_irqsave(mac_control-fifos[i].tx_lock, flags[i]);
 
-   spin_lock_irqsave(nic-tx_lock, flags);
nic-vlgrp = grp;
-   spin_unlock_irqrestore(nic-tx_lock, flags);
+   for (i = config-tx_fifo_num - 1; i = 0; i--)
+   spin_unlock_irqrestore(mac_control-fifos[i].tx_lock,
+   flags[i]);
 }
 
 /* A flag indicating whether 'RX_PA_CFG_STRIP_VLAN_TAG' bit is set or not */
@@ -565,6 +572,21 @@ static int init_shared_mem(struct s2io_nic *nic)
return -EINVAL;
}
 
+   size = 0;
+   for (i = 0; i  config-tx_fifo_num; i++) {
+   size = config-tx_cfg[i].fifo_len;
+   /*
+* Legal values are from 2 to 8192
+*/
+   if (size  2) {
+   DBG_PRINT(ERR_DBG, s2io: Invalid fifo len (%d), size);
+   DBG_PRINT(ERR_DBG, for fifo %d\n, i);
+   DBG_PRINT(ERR_DBG, s2io: Legal values for fifo len
+   are 2 to 8192\n);
+   return -EINVAL;
+   }
+   }
+
lst_size = (sizeof(struct TxD) * config-max_txds);
lst_per_page = PAGE_SIZE / lst_size;
 
@@ -639,10 +661,14 @@ static int init_shared_mem(struct s2io_nic *nic)
}
}
 
-   nic-ufo_in_band_v = kcalloc(size, sizeof(u64), GFP_KERNEL);
-   if (!nic-ufo_in_band_v)
-   return -ENOMEM;
-mem_allocated += (size * sizeof(u64));
+   for (i = 0; i  config-tx_fifo_num; i++) {
+   size = config-tx_cfg[i].fifo_len;
+   mac_control-fifos[i].ufo_in_band_v
+   = kcalloc(size, sizeof(u64), GFP_KERNEL);
+   if (!mac_control-fifos[i].ufo_in_band_v)
+   return -ENOMEM;
+   mem_allocated += (size * sizeof(u64));
+   }
 
/* Allocation and initialization of RXDs in Rings */
size = 0;
@@ -829,7 +855,6 @@ static int init_shared_mem(struct s2io_nic *nic)
 static void free_shared_mem(struct s2io_nic *nic)
 {
int i, j, blk_cnt, size;
-   u32 ufo_size = 0;
void *tmp_v_addr;
dma_addr_t tmp_p_addr;
struct mac_info *mac_control;
@@ -850,7 +875,6 @@ static void free_shared_mem(struct s2io_nic *nic)
lst_per_page = PAGE_SIZE / lst_size;
 
for (i = 0; i  config-tx_fifo_num; i++) {
-   ufo_size += config-tx_cfg[i].fifo_len;
page_num = TXD_MEM_PAGE_CNT(config-tx_cfg[i].fifo_len,
lst_per_page);
for (j = 0; j  page_num; j++) {
@@ -940,18 +964,21 @@ static void free_shared_mem(struct s2io_nic *nic)
}
}
 
+   for (i = 0; i  

forcedeth endianness bugs

2008-01-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=5bb7ea26148369315492c3dfc43c3b6366a9f279
Commit: 5bb7ea26148369315492c3dfc43c3b6366a9f279
Parent: 79ea13ce07c951bb4d95471e7300baa0f1be9e78
Author: Al Viro [EMAIL PROTECTED]
AuthorDate: Sun Dec 9 16:06:41 2007 +
Committer:  David S. Miller [EMAIL PROTECTED]
CommitDate: Mon Jan 28 15:07:13 2008 -0800

forcedeth endianness bugs

* misannotation: struct register_test members are actually host-endian
* bug: cpu_to_le64(n)  32 instead of cpu_to_le32(n  32) in setting
-bufhigh and similar for -buflow (take low bits, _then_ convert to
little-endian, not the other way round).
* bug: setup_hw_rings() should not convert to little-endian at all (we
feed the result to writel(), not store in shared data structure), let
alone try to play with shifting and masking little-endian values.  
Introduced
when setup_hw_rings() went in, screwed both 64bit case and the old code for
32bit rings it had replaced.

Signed-off-by: Al Viro [EMAIL PROTECTED]
Signed-off-by: Jeff Garzik [EMAIL PROTECTED]
---
 drivers/net/forcedeth.c |   46 --
 1 files changed, 28 insertions(+), 18 deletions(-)

diff --git a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c
index f84c752..7667a62 100644
--- a/drivers/net/forcedeth.c
+++ b/drivers/net/forcedeth.c
@@ -712,8 +712,8 @@ static const struct nv_ethtool_str nv_etests_str[] = {
 };
 
 struct register_test {
-   __le32 reg;
-   __le32 mask;
+   __u32 reg;
+   __u32 mask;
 };
 
 static const struct register_test nv_registers_test[] = {
@@ -929,6 +929,16 @@ static int reg_delay(struct net_device *dev, int offset, 
u32 mask, u32 target,
 #define NV_SETUP_RX_RING 0x01
 #define NV_SETUP_TX_RING 0x02
 
+static inline u32 dma_low(dma_addr_t addr)
+{
+   return addr;
+}
+
+static inline u32 dma_high(dma_addr_t addr)
+{
+   return addr311; /* 0 if 32bit, shift down by 32 if 64bit */
+}
+
 static void setup_hw_rings(struct net_device *dev, int rxtx_flags)
 {
struct fe_priv *np = get_nvpriv(dev);
@@ -936,19 +946,19 @@ static void setup_hw_rings(struct net_device *dev, int 
rxtx_flags)
 
if (np-desc_ver == DESC_VER_1 || np-desc_ver == DESC_VER_2) {
if (rxtx_flags  NV_SETUP_RX_RING) {
-   writel((u32) cpu_to_le64(np-ring_addr), base + 
NvRegRxRingPhysAddr);
+   writel(dma_low(np-ring_addr), base + 
NvRegRxRingPhysAddr);
}
if (rxtx_flags  NV_SETUP_TX_RING) {
-   writel((u32) cpu_to_le64(np-ring_addr + 
np-rx_ring_size*sizeof(struct ring_desc)), base + NvRegTxRingPhysAddr);
+   writel(dma_low(np-ring_addr + 
np-rx_ring_size*sizeof(struct ring_desc)), base + NvRegTxRingPhysAddr);
}
} else {
if (rxtx_flags  NV_SETUP_RX_RING) {
-   writel((u32) cpu_to_le64(np-ring_addr), base + 
NvRegRxRingPhysAddr);
-   writel((u32) (cpu_to_le64(np-ring_addr)  32), base + 
NvRegRxRingPhysAddrHigh);
+   writel(dma_low(np-ring_addr), base + 
NvRegRxRingPhysAddr);
+   writel(dma_high(np-ring_addr), base + 
NvRegRxRingPhysAddrHigh);
}
if (rxtx_flags  NV_SETUP_TX_RING) {
-   writel((u32) cpu_to_le64(np-ring_addr + 
np-rx_ring_size*sizeof(struct ring_desc_ex)), base + NvRegTxRingPhysAddr);
-   writel((u32) (cpu_to_le64(np-ring_addr + 
np-rx_ring_size*sizeof(struct ring_desc_ex))  32), base + 
NvRegTxRingPhysAddrHigh);
+   writel(dma_low(np-ring_addr + 
np-rx_ring_size*sizeof(struct ring_desc_ex)), base + NvRegTxRingPhysAddr);
+   writel(dma_high(np-ring_addr + 
np-rx_ring_size*sizeof(struct ring_desc_ex)), base + NvRegTxRingPhysAddrHigh);
}
}
 }
@@ -1571,8 +1581,8 @@ static int nv_alloc_rx_optimized(struct net_device *dev)
 skb_tailroom(skb),
 
PCI_DMA_FROMDEVICE);
np-put_rx_ctx-dma_len = skb_tailroom(skb);
-   np-put_rx.ex-bufhigh = 
cpu_to_le64(np-put_rx_ctx-dma)  32;
-   np-put_rx.ex-buflow = 
cpu_to_le64(np-put_rx_ctx-dma)  0x0;
+   np-put_rx.ex-bufhigh = 
cpu_to_le32(dma_high(np-put_rx_ctx-dma));
+   np-put_rx.ex-buflow = 
cpu_to_le32(dma_low(np-put_rx_ctx-dma));
wmb();
np-put_rx.ex-flaglen = cpu_to_le32(np-rx_buf_sz | 
NV_RX2_AVAIL);
if (unlikely(np-put_rx.ex++ == np-last_rx.ex))
@@ -1937,8 +1947,8 @@ static int nv_start_xmit_optimized(struct sk_buff *skb, 
struct net_device *dev)

libertas: use spin_is_locked() instead of spin_trylock() in lbs_interrupt()

2008-01-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=f5a3ea6f966700ae82504202fdd827f2d3c79e66
Commit: f5a3ea6f966700ae82504202fdd827f2d3c79e66
Parent: 860621347e88b23517fc4ec93fa5af940401c3ec
Author: David Woodhouse [EMAIL PROTECTED]
AuthorDate: Thu Dec 13 01:53:57 2007 -0500
Committer:  David S. Miller [EMAIL PROTECTED]
CommitDate: Mon Jan 28 15:07:08 2008 -0800

libertas: use spin_is_locked() instead of spin_trylock() in lbs_interrupt()

We get scary warnings on UP if we use spin_trylock() and find, as we
hoped, that the lock in question is already locked.

Signed-off-by: David Woodhouse [EMAIL PROTECTED]
Signed-off-by: John W. Linville [EMAIL PROTECTED]
---
 drivers/net/wireless/libertas/main.c |3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/libertas/main.c 
b/drivers/net/wireless/libertas/main.c
index 9232b97..5d2bf53 100644
--- a/drivers/net/wireless/libertas/main.c
+++ b/drivers/net/wireless/libertas/main.c
@@ -1414,8 +1414,7 @@ void lbs_interrupt(struct lbs_private *priv)
 
lbs_deb_thread(lbs_interrupt: intcounter=%d\n, priv-intcounter);
 
-   if (spin_trylock(priv-driver_lock)) {
-   spin_unlock(priv-driver_lock);
+   if (!spin_is_locked(priv-driver_lock)) {
printk(KERN_CRIT %s called without driver_lock held\n, 
__func__);
WARN_ON(1);
}
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


libertas: switch lbs_cmd() to take a _pointer_ to the command structure

2008-01-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=689442dca16eb27fee19074499d42845fe54c12a
Commit: 689442dca16eb27fee19074499d42845fe54c12a
Parent: 6ce4fd2a3a84e64a27c42aaa7de6e0e85dee3573
Author: David Woodhouse [EMAIL PROTECTED]
AuthorDate: Wed Dec 12 16:00:42 2007 -0500
Committer:  David S. Miller [EMAIL PROTECTED]
CommitDate: Mon Jan 28 15:07:02 2008 -0800

libertas: switch lbs_cmd() to take a _pointer_ to the command structure

This way, it looks more like a normal function.

Signed-off-by: David Woodhouse [EMAIL PROTECTED]
Signed-off-by: John W. Linville [EMAIL PROTECTED]
---
 drivers/net/wireless/libertas/cmd.c|   17 +
 drivers/net/wireless/libertas/cmd.h|   10 --
 drivers/net/wireless/libertas/if_usb.c |2 +-
 3 files changed, 14 insertions(+), 15 deletions(-)

diff --git a/drivers/net/wireless/libertas/cmd.c 
b/drivers/net/wireless/libertas/cmd.c
index 2d7b646..f87cecb 100644
--- a/drivers/net/wireless/libertas/cmd.c
+++ b/drivers/net/wireless/libertas/cmd.c
@@ -56,7 +56,7 @@ int lbs_update_hw_spec(struct lbs_private *priv)
memset(cmd, 0, sizeof(cmd));
cmd.hdr.size = cpu_to_le16(sizeof(cmd));
memcpy(cmd.permanentaddr, priv-current_addr, ETH_ALEN);
-   ret = lbs_cmd_with_response(priv, CMD_GET_HW_SPEC, cmd);
+   ret = lbs_cmd_with_response(priv, CMD_GET_HW_SPEC, cmd);
if (ret)
goto out;
 
@@ -121,7 +121,7 @@ int lbs_host_sleep_cfg(struct lbs_private *priv, uint32_t 
criteria,
cmd_config.gpio = gpio;
cmd_config.gap = gap;
 
-   ret = lbs_cmd_with_response(priv, CMD_802_11_HOST_SLEEP_CFG, 
cmd_config);
+   ret = lbs_cmd_with_response(priv, CMD_802_11_HOST_SLEEP_CFG, 
cmd_config);
if (ret) {
lbs_pr_info(HOST_SLEEP_CFG failed %d\n, ret);
return ret;
@@ -743,7 +743,7 @@ int lbs_get_data_rate(struct lbs_private *priv)
cmd.hdr.size = cpu_to_le16(sizeof(cmd));
cmd.action = cpu_to_le16(CMD_ACT_GET_TX_RATE);
 
-   ret = lbs_cmd_with_response(priv, CMD_802_11_DATA_RATE, cmd);
+   ret = lbs_cmd_with_response(priv, CMD_802_11_DATA_RATE, cmd);
if (ret)
goto out;
 
@@ -790,7 +790,7 @@ int lbs_set_data_rate(struct lbs_private *priv, u8 rate)
lbs_deb_cmd(DATA_RATE: setting auto\n);
}
 
-   ret = lbs_cmd_with_response(priv, CMD_802_11_DATA_RATE, cmd);
+   ret = lbs_cmd_with_response(priv, CMD_802_11_DATA_RATE, cmd);
if (ret)
goto out;
 
@@ -846,7 +846,7 @@ int lbs_get_channel(struct lbs_private *priv)
cmd.hdr.size = cpu_to_le16(sizeof(cmd));
cmd.action = cpu_to_le16(CMD_OPT_802_11_RF_CHANNEL_GET);
 
-   ret = lbs_cmd_with_response(priv, CMD_802_11_RF_CHANNEL, cmd);
+   ret = lbs_cmd_with_response(priv, CMD_802_11_RF_CHANNEL, cmd);
if (ret)
goto out;
 
@@ -878,7 +878,7 @@ int lbs_set_channel(struct lbs_private *priv, u8 channel)
cmd.action = cpu_to_le16(CMD_OPT_802_11_RF_CHANNEL_SET);
cmd.channel = cpu_to_le16(channel);
 
-   ret = lbs_cmd_with_response(priv, CMD_802_11_RF_CHANNEL, cmd);
+   ret = lbs_cmd_with_response(priv, CMD_802_11_RF_CHANNEL, cmd);
if (ret)
goto out;
 
@@ -1105,7 +1105,7 @@ int lbs_mesh_access(struct lbs_private *priv, uint16_t 
cmd_action,
 
cmd-action = cpu_to_le16(cmd_action);
 
-   ret = lbs_cmd_with_response(priv, CMD_MESH_ACCESS, (*cmd));
+   ret = lbs_cmd_with_response(priv, CMD_MESH_ACCESS, cmd);
 
lbs_deb_leave(LBS_DEB_CMD);
return ret;
@@ -1128,7 +1128,7 @@ int lbs_mesh_config(struct lbs_private *priv, int enable)
lbs_deb_cmd(mesh config channel %d SSID %s\n,
priv-curbssparams.channel,
escape_essid(priv-mesh_ssid, priv-mesh_ssid_len));
-   return lbs_cmd_with_response(priv, CMD_MESH_CONFIG, cmd);
+   return lbs_cmd_with_response(priv, CMD_MESH_CONFIG, cmd);
 }
 
 static int lbs_cmd_bcn_ctrl(struct lbs_private * priv,
@@ -2160,6 +2160,7 @@ int lbs_cmd_copyback(struct lbs_private *priv, unsigned 
long extra,
lbs_deb_leave(LBS_DEB_CMD);
return 0;
 }
+EXPORT_SYMBOL_GPL(lbs_cmd_copyback);
 
 /**
  *  @brief Simple way to call firmware functions
diff --git a/drivers/net/wireless/libertas/cmd.h 
b/drivers/net/wireless/libertas/cmd.h
index 8d72c7e..e800295 100644
--- a/drivers/net/wireless/libertas/cmd.h
+++ b/drivers/net/wireless/libertas/cmd.h
@@ -6,13 +6,11 @@
 #include hostcmd.h
 #include dev.h
 
-#define lbs_cmd(priv, cmdnr, cmd, callback, callback_arg) \
-   __lbs_cmd(priv, cmdnr, (cmd).hdr, sizeof(cmd),   \
-   callback, callback_arg)
+#define lbs_cmd(priv, cmdnr, cmd, cb, cb_arg)  \
+   __lbs_cmd(priv, cmdnr, (cmd)-hdr, sizeof(*(cmd)), cb, cb_arg)
 
-#define lbs_cmd_with_response(priv, cmdnr, cmd) \
-   __lbs_cmd(priv, cmdnr, 

libertas: disable mesh temporarily while setting eth channel/assoc

2008-01-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=8642f1f06292c4f30c7870a693f9ae94252e7ff2
Commit: 8642f1f06292c4f30c7870a693f9ae94252e7ff2
Parent: 88ae2915ccff97466e7a1e542f4a4d01c46b23f6
Author: David Woodhouse [EMAIL PROTECTED]
AuthorDate: Tue Dec 11 20:03:01 2007 -0500
Committer:  David S. Miller [EMAIL PROTECTED]
CommitDate: Mon Jan 28 15:06:58 2008 -0800

libertas: disable mesh temporarily while setting eth channel/assoc

Otherwise the device won't let us change channels.

Signed-off-by: David Woodhouse [EMAIL PROTECTED]
Signed-off-by: John W. Linville [EMAIL PROTECTED]
---
 drivers/net/wireless/libertas/assoc.c |   14 --
 1 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/libertas/assoc.c 
b/drivers/net/wireless/libertas/assoc.c
index a4b9756..7b672fe 100644
--- a/drivers/net/wireless/libertas/assoc.c
+++ b/drivers/net/wireless/libertas/assoc.c
@@ -204,6 +204,12 @@ static int assoc_helper_channel(struct lbs_private *priv,
if (assoc_req-channel == priv-curbssparams.channel)
goto done;
 
+   if (priv-mesh_dev) {
+   /* Disconnect mesh while associating -- otherwise it
+  won't let us change channels */
+   lbs_mesh_config(priv, 0);
+   }
+
lbs_deb_assoc(ASSOC: channel: %d - %d\n,
   priv-curbssparams.channel, assoc_req-channel);
 
@@ -221,7 +227,7 @@ static int assoc_helper_channel(struct lbs_private *priv,
if (assoc_req-channel != priv-curbssparams.channel) {
lbs_deb_assoc(ASSOC: channel: failed to update channel to 
%d\n,
  assoc_req-channel);
-   goto done;
+   goto restore_mesh;
}
 
if (   assoc_req-secinfo.wep_enabled
@@ -236,7 +242,11 @@ static int assoc_helper_channel(struct lbs_private *priv,
/* Must restart/rejoin adhoc networks after channel change */
set_bit(ASSOC_FLAG_SSID, assoc_req-flags);
 
-done:
+ restore_mesh:
+   if (priv-mesh_dev)
+   lbs_mesh_config(priv, 1);
+
+ done:
lbs_deb_leave_args(LBS_DEB_ASSOC, ret %d, ret);
return ret;
 }
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


libertas: clean up direct command handling

2008-01-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=7ad994dec7d36c319cb35cbf3a920d3bda96e6b0
Commit: 7ad994dec7d36c319cb35cbf3a920d3bda96e6b0
Parent: b15152a4033d4c82015bb79c6b81eeb0a2edeeea
Author: Dan Williams [EMAIL PROTECTED]
AuthorDate: Tue Dec 11 12:33:30 2007 -0500
Committer:  David S. Miller [EMAIL PROTECTED]
CommitDate: Mon Jan 28 15:06:41 2008 -0800

libertas: clean up direct command handling

Move direct command handling through __lbs_cmd() over to using the
header as the first member of the command structure, and only define
the __lbs_cmd() callback in one place rather than 3.  Convert boot2
version command to new usage.

Signed-off-by: Dan Williams [EMAIL PROTECTED]
Signed-off-by: David Woodhouse [EMAIL PROTECTED]
Signed-off-by: John W. Linville [EMAIL PROTECTED]
---
 drivers/net/wireless/libertas/cmd.c |   22 --
 drivers/net/wireless/libertas/cmd.h |8 +---
 drivers/net/wireless/libertas/cmdresp.c |7 ---
 drivers/net/wireless/libertas/hostcmd.h |   12 ++--
 4 files changed, 31 insertions(+), 18 deletions(-)

diff --git a/drivers/net/wireless/libertas/cmd.c 
b/drivers/net/wireless/libertas/cmd.c
index 2efba57..78870c7 100644
--- a/drivers/net/wireless/libertas/cmd.c
+++ b/drivers/net/wireless/libertas/cmd.c
@@ -1988,12 +1988,13 @@ void lbs_ps_confirm_sleep(struct lbs_private *priv, u16 
psmode)
  *  the result code from the firmware
  */
 
-int __lbs_cmd(struct lbs_private *priv, uint16_t command, void *cmd, int 
cmd_size,
- int (*callback)(struct lbs_private *, unsigned long, struct 
cmd_ds_command *),
+int __lbs_cmd(struct lbs_private *priv, uint16_t command,
+ struct cmd_header *in_cmd, int in_cmd_size,
+ int (*callback)(struct lbs_private *, unsigned long, struct 
cmd_header *),
  unsigned long callback_arg)
 {
struct cmd_ctrl_node *cmdnode;
-   struct cmd_ds_gen *cmdptr;
+   struct cmd_header *send_cmd;
unsigned long flags;
int ret = 0;
 
@@ -2012,7 +2013,6 @@ int __lbs_cmd(struct lbs_private *priv, uint16_t command, 
void *cmd, int cmd_siz
}
 
cmdnode = lbs_get_cmd_ctrl_node(priv);
-
if (cmdnode == NULL) {
lbs_deb_host(PREP_CMD: cmdnode is NULL\n);
 
@@ -2022,18 +2022,20 @@ int __lbs_cmd(struct lbs_private *priv, uint16_t 
command, void *cmd, int cmd_siz
goto done;
}
 
-   cmdptr = (struct cmd_ds_gen *)cmdnode-bufvirtualaddr;
+   send_cmd = (struct cmd_header *) cmdnode-bufvirtualaddr;
cmdnode-wait_option = CMD_OPTION_WAITFORRSP;
cmdnode-callback = callback;
cmdnode-callback_arg = callback_arg;
 
+   /* Copy the incoming command to the buffer */
+   memcpy(send_cmd, in_cmd, in_cmd_size);
+
/* Set sequence number, clean result, move to buffer */
priv-seqnum++;
-   cmdptr-command = cpu_to_le16(command);
-   cmdptr-size= cpu_to_le16(cmd_size + S_DS_GEN);
-   cmdptr-seqnum = cpu_to_le16(priv-seqnum);
-   cmdptr-result = 0;
-   memcpy(cmdptr-cmdresp, cmd, cmd_size);
+   send_cmd-command = cpu_to_le16(command);
+   send_cmd-size= cpu_to_le16(in_cmd_size);
+   send_cmd-seqnum  = cpu_to_le16(priv-seqnum);
+   send_cmd-result  = 0;
 
lbs_deb_host(PREP_CMD: command 0x%04x\n, command);
 
diff --git a/drivers/net/wireless/libertas/cmd.h 
b/drivers/net/wireless/libertas/cmd.h
index 546db49..259d3e8 100644
--- a/drivers/net/wireless/libertas/cmd.h
+++ b/drivers/net/wireless/libertas/cmd.h
@@ -7,10 +7,12 @@
 #include dev.h
 
 #define lbs_cmd(priv, cmdnr, cmd, callback, callback_arg) \
-   __lbs_cmd(priv, cmdnr, cmd, sizeof(cmd), callback, callback_arg)
+   __lbs_cmd(priv, cmdnr, (struct cmd_header *) cmd, sizeof(cmd), \
+   callback, callback_arg)
 
-int __lbs_cmd(struct lbs_private *priv, uint16_t command, void *cmd, int 
cmd_size, 
- int (*callback)(struct lbs_private *, unsigned long, struct 
cmd_ds_command *),
+int __lbs_cmd(struct lbs_private *priv, uint16_t command,
+ struct cmd_header *in_cmd, int in_cmd_size, 
+ int (*callback)(struct lbs_private *, unsigned long, struct 
cmd_header *),
  unsigned long callback_arg);
 
 #endif /* _LBS_CMD_H */
diff --git a/drivers/net/wireless/libertas/cmdresp.c 
b/drivers/net/wireless/libertas/cmdresp.c
index 7bad257..9113669 100644
--- a/drivers/net/wireless/libertas/cmdresp.c
+++ b/drivers/net/wireless/libertas/cmdresp.c
@@ -861,9 +861,10 @@ int lbs_process_rx_command(struct lbs_private *priv)
 
spin_unlock_irqrestore(priv-driver_lock, flags);
 
-   if (priv-cur_cmd  priv-cur_cmd-callback)
-   ret = priv-cur_cmd-callback(priv, 
priv-cur_cmd-callback_arg, resp);
-   else
+   if (priv-cur_cmd  priv-cur_cmd-callback) {
+   ret = 

libertas: make rtap and normal modes mutually exclusive, clean up open/stop

2008-01-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=8552855f9860b222673e86a88de2543f53f83dc2
Commit: 8552855f9860b222673e86a88de2543f53f83dc2
Parent: 852e1f2a2627274102a3c2dc70a6547aeab99cb6
Author: David Woodhouse [EMAIL PROTECTED]
AuthorDate: Mon Dec 10 16:38:18 2007 -0500
Committer:  David S. Miller [EMAIL PROTECTED]
CommitDate: Mon Jan 28 15:06:38 2008 -0800

libertas: make rtap and normal modes mutually exclusive, clean up open/stop

Signed-off-by: David Woodhouse [EMAIL PROTECTED]
Signed-off-by: John W. Linville [EMAIL PROTECTED]
---
 drivers/net/wireless/libertas/dev.h  |1 -
 drivers/net/wireless/libertas/main.c |  133 +-
 2 files changed, 50 insertions(+), 84 deletions(-)

diff --git a/drivers/net/wireless/libertas/dev.h 
b/drivers/net/wireless/libertas/dev.h
index 4681405..9921d0c 100644
--- a/drivers/net/wireless/libertas/dev.h
+++ b/drivers/net/wireless/libertas/dev.h
@@ -99,7 +99,6 @@ struct lbs_mesh_stats {
 
 /** Private structure for the MV device */
 struct lbs_private {
-   int open;
int mesh_open;
int infra_open;
int mesh_autostart_enabled;
diff --git a/drivers/net/wireless/libertas/main.c 
b/drivers/net/wireless/libertas/main.c
index 3d9de7a..8866402 100644
--- a/drivers/net/wireless/libertas/main.c
+++ b/drivers/net/wireless/libertas/main.c
@@ -274,6 +274,8 @@ static ssize_t lbs_rtap_set(struct device *dev,
if(priv-monitormode == monitor_mode)
return strlen(buf);
if (priv-monitormode == LBS_MONITOR_OFF) {
+   if (priv-infra_open || priv-mesh_open)
+   return -EBUSY;
if (priv-mode == IW_MODE_INFRA)
lbs_send_deauthentication(priv);
else if (priv-mode == IW_MODE_ADHOC)
@@ -367,84 +369,42 @@ static struct attribute_group lbs_mesh_attr_group = {
 };
 
 /**
- *  @brief This function opens the device
+ *  @brief This function opens the ethX or mshX interface
  *
  *  @param dev A pointer to net_device structure
- *  @return   0
+ *  @return   0 or -EBUSY if monitor mode active
  */
 static int lbs_dev_open(struct net_device *dev)
 {
-   struct lbs_private *priv = (struct lbs_private *) dev-priv;
-
-   lbs_deb_enter(LBS_DEB_NET);
+   struct lbs_private *priv = (struct lbs_private *) dev-priv ;
+   int ret = 0;
 
-   priv-open = 1;
+   spin_lock_irq(priv-driver_lock);
 
-   if (priv-connect_status == LBS_CONNECTED)
-   netif_carrier_on(priv-dev);
-   else
-   netif_carrier_off(priv-dev);
+   if (priv-monitormode != LBS_MONITOR_OFF) {
+   ret = -EBUSY;
+   goto out;
+   }
 
-   if (priv-mesh_dev) {
-   if (priv-mesh_connect_status == LBS_CONNECTED)
-   netif_carrier_on(priv-mesh_dev);
+   if (dev == priv-mesh_dev) {
+   priv-mesh_open = 1;
+   priv-mesh_connect_status = LBS_CONNECTED;
+   netif_carrier_on(dev);
+   } else {
+   priv-infra_open = 1;
+   
+   if (priv-connect_status == LBS_CONNECTED)
+   netif_carrier_on(dev);
else
-   netif_carrier_off(priv-mesh_dev);
+   netif_carrier_off(dev);
}
 
-   lbs_deb_leave(LBS_DEB_NET);
-   return 0;
-}
-/**
- *  @brief This function opens the mshX interface
- *
- *  @param dev A pointer to net_device structure
- *  @return   0
- */
-static int lbs_mesh_open(struct net_device *dev)
-{
-   struct lbs_private *priv = (struct lbs_private *) dev-priv ;
-
-   priv-mesh_open = 1 ;
-   netif_wake_queue(priv-mesh_dev);
-
-   priv-mesh_connect_status = LBS_CONNECTED;
-
-   netif_carrier_on(priv-mesh_dev);
-   netif_wake_queue(priv-mesh_dev);
-   if (priv-infra_open == 0)
-   return lbs_dev_open(priv-dev) ;
-   return 0;
-}
-
-/**
- *  @brief This function opens the ethX interface
- *
- *  @param dev A pointer to net_device structure
- *  @return   0
- */
-static int lbs_open(struct net_device *dev)
-{
-   struct lbs_private *priv = (struct lbs_private *) dev-priv ;
-
-   priv-infra_open = 1 ;
-   netif_wake_queue(priv-dev);
-   if (priv-open == 0)
-   return lbs_dev_open(priv-dev) ;
-   return 0;
-}
+   if (!priv-tx_pending_len)
+   netif_wake_queue(dev);
+ out:
 
-static int lbs_dev_close(struct net_device *dev)
-{
-   struct lbs_private *priv = dev-priv;
-
-   lbs_deb_enter(LBS_DEB_NET);
-
-   netif_carrier_off(priv-dev);
-   priv-open = 0;
-
-   lbs_deb_leave(LBS_DEB_NET);
-   return 0;
+   spin_unlock_irq(priv-driver_lock);
+   return ret;
 }
 
 /**
@@ -453,16 +413,20 @@ static int lbs_dev_close(struct 

libertas: kill (IS,SET,UNSET)_MESH_FRAME.

2008-01-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=c3f949618d01d6c40a0267ae8c01695cc2de08e2
Commit: c3f949618d01d6c40a0267ae8c01695cc2de08e2
Parent: 6f93a8e7e41c2d29749242f983f41e3f6a75b40b
Author: David Woodhouse [EMAIL PROTECTED]
AuthorDate: Mon Dec 10 00:51:35 2007 -0500
Committer:  David S. Miller [EMAIL PROTECTED]
CommitDate: Mon Jan 28 15:06:33 2008 -0800

libertas: kill (IS,SET,UNSET)_MESH_FRAME.

No need for these any more. We've collapsed all the unneeded nests of
functions which needed to keep track of which device the skb belonged to.

Signed-off-by: David Woodhouse [EMAIL PROTECTED]
Signed-off-by: John W. Linville [EMAIL PROTECTED]
---
 drivers/net/wireless/libertas/defs.h |4 
 1 files changed, 0 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wireless/libertas/defs.h 
b/drivers/net/wireless/libertas/defs.h
index 8242384..04db6af 100644
--- a/drivers/net/wireless/libertas/defs.h
+++ b/drivers/net/wireless/libertas/defs.h
@@ -257,10 +257,6 @@ static inline void lbs_deb_hex(unsigned int grp, const 
char *prompt, u8 *buf, in
 
 #defineMAX_LEDS8
 
-#define IS_MESH_FRAME(x) (x-cb[6])
-#define SET_MESH_FRAME(x) (x-cb[6]=1)
-#define UNSET_MESH_FRAME(x) (x-cb[6]=0)
-
 /** Global Variable Declaration */
 extern const char lbs_driver_version[];
 extern u16 lbs_region_code_to_index[MRVDRV_MAX_REGION_CODE];
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


libertas: kill internal tx queue for PS mode

2008-01-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=2abdc0b7756ece70b1f0fd65a651bf8ce487a223
Commit: 2abdc0b7756ece70b1f0fd65a651bf8ce487a223
Parent: 020bb19e2f8cfebb314b8bce4bc48a511c6f5940
Author: David Woodhouse [EMAIL PROTECTED]
AuthorDate: Sun Dec 9 12:37:27 2007 -0500
Committer:  David S. Miller [EMAIL PROTECTED]
CommitDate: Mon Jan 28 15:06:22 2008 -0800

libertas: kill internal tx queue for PS mode

It was buggy as hell anyway, since it was just spewing packets at the
device when it wasn't necessarily ready for them (in the USB case, while
the URB was still busy).

We could probably do with a better way of flushing packets to the device
_immediately_, before we stick it back into sleep mode. But we can no
longer just dequeue packets directly, it seems.

Signed-off-by: David Woodhouse [EMAIL PROTECTED]
Signed-off-by: John W. Linville [EMAIL PROTECTED]
---
 drivers/net/wireless/libertas/decl.h |2 -
 drivers/net/wireless/libertas/dev.h  |5 
 drivers/net/wireless/libertas/main.c |6 -
 drivers/net/wireless/libertas/tx.c   |   40 ++---
 4 files changed, 3 insertions(+), 50 deletions(-)

diff --git a/drivers/net/wireless/libertas/decl.h 
b/drivers/net/wireless/libertas/decl.h
index e255b19..b094514 100644
--- a/drivers/net/wireless/libertas/decl.h
+++ b/drivers/net/wireless/libertas/decl.h
@@ -62,8 +62,6 @@ void lbs_ps_sleep(struct lbs_private *priv, int wait_option);
 void lbs_ps_confirm_sleep(struct lbs_private *priv, u16 psmode);
 void lbs_ps_wakeup(struct lbs_private *priv, int wait_option);
 
-void lbs_tx_runqueue(struct lbs_private *priv);
-
 struct chan_freq_power *lbs_find_cfp_by_band_and_channel(
struct lbs_private *priv,
u8 band,
diff --git a/drivers/net/wireless/libertas/dev.h 
b/drivers/net/wireless/libertas/dev.h
index 21b0d38..a9c3adc 100644
--- a/drivers/net/wireless/libertas/dev.h
+++ b/drivers/net/wireless/libertas/dev.h
@@ -197,11 +197,6 @@ struct lbs_private {
/** Timers */
struct timer_list command_timer;
 
-   /* TX queue used in PS mode */
-   spinlock_t txqueue_lock;
-   struct sk_buff *tx_queue_ps[NR_TX_QUEUE];
-   unsigned int tx_queue_idx;
-
u8 hisregcpy;
 
/** current ssid/bssid related parameters*/
diff --git a/drivers/net/wireless/libertas/main.c 
b/drivers/net/wireless/libertas/main.c
index 2ff5f1b..c638995 100644
--- a/drivers/net/wireless/libertas/main.c
+++ b/drivers/net/wireless/libertas/main.c
@@ -914,8 +914,6 @@ static int lbs_thread(void *data)
 */
if (!list_empty(priv-cmdpendingq))
wake_up_all(priv-cmd_pending);
-
-   lbs_tx_runqueue(priv);
}
 
del_timer(priv-command_timer);
@@ -1072,10 +1070,6 @@ static int lbs_init_adapter(struct lbs_private *priv)
 
mutex_init(priv-lock);
 
-   memset(priv-tx_queue_ps, 0, NR_TX_QUEUE*sizeof(struct sk_buff*));
-   priv-tx_queue_idx = 0;
-   spin_lock_init(priv-txqueue_lock);
-
setup_timer(priv-command_timer, command_timer_fn,
(unsigned long)priv);
 
diff --git a/drivers/net/wireless/libertas/tx.c 
b/drivers/net/wireless/libertas/tx.c
index 4cb39d3..749535e 100644
--- a/drivers/net/wireless/libertas/tx.c
+++ b/drivers/net/wireless/libertas/tx.c
@@ -164,41 +164,6 @@ done:
 }
 
 
-void lbs_tx_runqueue(struct lbs_private *priv)
-{
-   int i;
-
-   spin_lock(priv-txqueue_lock);
-   for (i = 0; i  priv-tx_queue_idx; i++) {
-   struct sk_buff *skb = priv-tx_queue_ps[i];
-   spin_unlock(priv-txqueue_lock);
-   SendSinglePacket(priv, skb);
-   spin_lock(priv-txqueue_lock);
-   }
-   priv-tx_queue_idx = 0;
-   spin_unlock(priv-txqueue_lock);
-}
-
-static void lbs_tx_queue(struct lbs_private *priv, struct sk_buff *skb)
-{
-
-   spin_lock(priv-txqueue_lock);
-
-   WARN_ON(priv-tx_queue_idx = NR_TX_QUEUE);
-   priv-tx_queue_ps[priv-tx_queue_idx++] = skb;
-   if (priv-tx_queue_idx == NR_TX_QUEUE) {
-   netif_stop_queue(priv-dev);
-   if (priv-mesh_dev)
-   netif_stop_queue(priv-mesh_dev);
-   } else {
-   netif_start_queue(priv-dev);
-   if (priv-mesh_dev)
-   netif_start_queue(priv-mesh_dev);
-   }
-
-   spin_unlock(priv-txqueue_lock);
-}
-
 /**
  *  @brief This function checks the conditions and sends packet to IF
  *  layer if everything is ok.
@@ -221,8 +186,9 @@ int lbs_process_tx(struct lbs_private *priv, struct sk_buff 
*skb)
 
if ((priv-psstate == PS_STATE_SLEEP) ||
(priv-psstate == PS_STATE_PRE_SLEEP)) {
-   lbs_tx_queue(priv, skb);
-   return ret;
+   lbs_pr_alert(TX error: packet xmit in %ssleep mode\n,
+priv-psstate == 

libertas: handy function to call firmware commands

2008-01-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=675787e29fd97d08bf7e6253c89ab6de23bf7089
Commit: 675787e29fd97d08bf7e6253c89ab6de23bf7089
Parent: 0d61d04210b617963c202a3c4dcbcd26a024d5d3
Author: Holger Schurig [EMAIL PROTECTED]
AuthorDate: Wed Dec 5 17:58:11 2007 +0100
Committer:  David S. Miller [EMAIL PROTECTED]
CommitDate: Mon Jan 28 15:06:04 2008 -0800

libertas: handy function to call firmware commands

Using an arbitrary firmware command was actually very painful. One
had to change big switch() statements in cmd.c, cmdresp.c, add
structs to the big union in struct cmd_ds_command and add the
define for the CMD_802_11_xxx to the proper place.

With this function, this is now much easier. For now, it implements
a blocking (a.k.a. CMD_OPTION_WAITFORRSP) way where one deals directly
with command requests and response buffers. You can do everything in
one place:

Signed-off-by: Holger Schurig [EMAIL PROTECTED]
Signed-off-by: David Woodhouse [EMAIL PROTECTED]
Signed-off-by: John W. Linville [EMAIL PROTECTED]
---
 drivers/net/wireless/libertas/cmd.c |   96 +++
 drivers/net/wireless/libertas/cmdresp.c |   23 ++--
 drivers/net/wireless/libertas/decl.h|6 ++
 drivers/net/wireless/libertas/hostcmd.h |   11 ++-
 4 files changed, 126 insertions(+), 10 deletions(-)

diff --git a/drivers/net/wireless/libertas/cmd.c 
b/drivers/net/wireless/libertas/cmd.c
index 54ef990..9064513 100644
--- a/drivers/net/wireless/libertas/cmd.c
+++ b/drivers/net/wireless/libertas/cmd.c
@@ -2007,3 +2007,99 @@ void lbs_ps_confirm_sleep(struct lbs_private *priv, u16 
psmode)
 
lbs_deb_leave(LBS_DEB_HOST);
 }
+
+
+/**
+ *  @brief Simple way to call firmware functions
+ *
+ *  @param privA pointer to struct lbs_private structure
+ *  @param psmode  one of the many CMD_802_11_
+ *  @param cmd  pointer to the parameters structure for above command
+ *  (this should not include the command, size, sequence
+ *  and result fields from struct cmd_ds_gen)
+ *  @param cmd_size size structure pointed to by cmd
+ *  @param rsp  pointer to an area where the result should be placed
+ *  @param rsp_size pointer to the size of the rsp area. If the firmware
+ *  returns fewer bytes, then this *rsp_size will be
+ *  changed to the actual size.
+ *  @return-1 in case of a higher level error, otherwise
+ *  the result code from the firmware
+ */
+int lbs_cmd(struct lbs_private *priv,
+   u16 command,
+   void *cmd, int cmd_size,
+   void *rsp, int *rsp_size)
+{
+   struct lbs_adapter *adapter = priv-adapter;
+   struct cmd_ctrl_node *cmdnode;
+   struct cmd_ds_gen *cmdptr;
+   unsigned long flags;
+   int ret = 0;
+
+   lbs_deb_enter(LBS_DEB_HOST);
+   lbs_deb_host(rsp at %p, rsp_size at %p\n, rsp, rsp_size);
+
+   if (!adapter || !rsp_size) {
+   lbs_deb_host(PREP_CMD: adapter is NULL\n);
+   ret = -1;
+   goto done;
+   }
+
+   if (adapter-surpriseremoved) {
+   lbs_deb_host(PREP_CMD: card removed\n);
+   ret = -1;
+   goto done;
+   }
+
+   cmdnode = lbs_get_cmd_ctrl_node(priv);
+
+   if (cmdnode == NULL) {
+   lbs_deb_host(PREP_CMD: cmdnode is NULL\n);
+
+   /* Wake up main thread to execute next command */
+   wake_up_interruptible(priv-waitq);
+   ret = -1;
+   goto done;
+   }
+
+   cmdptr = (struct cmd_ds_gen *)cmdnode-bufvirtualaddr;
+   cmdnode-wait_option = CMD_OPTION_WAITFORRSP;
+   cmdnode-pdata_buf = rsp;
+   cmdnode-pdata_size = rsp_size;
+
+   /* Set sequence number, clean result, move to buffer */
+   adapter-seqnum++;
+   cmdptr-command = cpu_to_le16(command);
+   cmdptr-size= cmd_size + S_DS_GEN;
+   cmdptr-seqnum = cpu_to_le16(adapter-seqnum);
+   cmdptr-result = 0;
+   memcpy(cmdptr-cmdresp, cmd, cmd_size);
+
+   lbs_deb_host(PREP_CMD: command 0x%04x\n, command);
+
+   /* here was the big old switch() statement, which is now obsolete,
+* because the caller of lbs_cmd() sets up all of *cmd for us. */
+
+   cmdnode-cmdwaitqwoken = 0;
+   lbs_queue_cmd(adapter, cmdnode, 1);
+   wake_up_interruptible(priv-waitq);
+
+   might_sleep();
+   wait_event_interruptible(cmdnode-cmdwait_q, cmdnode-cmdwaitqwoken);
+
+   spin_lock_irqsave(adapter-driver_lock, flags);
+   if (adapter-cur_cmd_retcode) {
+   lbs_deb_host(PREP_CMD: command failed with return code %d\n,
+  adapter-cur_cmd_retcode);
+   adapter-cur_cmd_retcode = 0;
+   ret = -1;
+   }
+   

libertas: Consolidate lbs_host_to_card_done() function.

2008-01-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=e775ed7c677b163c80643036c32e23d3e59b9429
Commit: e775ed7c677b163c80643036c32e23d3e59b9429
Parent: f5ece8fc8d3f5e36bda3554b74b0fbecb0a14309
Author: David Woodhouse [EMAIL PROTECTED]
AuthorDate: Thu Dec 6 14:36:11 2007 +
Committer:  David S. Miller [EMAIL PROTECTED]
CommitDate: Mon Jan 28 15:06:01 2008 -0800

libertas: Consolidate lbs_host_to_card_done() function.

As we move towards having this done by a state machine, start by having
a single 'stuff sent' function, which is called by if_usb/if_sdio/if_cs
after sending both data and commands.

Signed-off-by: David Woodhouse [EMAIL PROTECTED]
Signed-off-by: John W. Linville [EMAIL PROTECTED]
---
 drivers/net/wireless/libertas/decl.h|1 +
 drivers/net/wireless/libertas/if_cs.c   |   12 +++-
 drivers/net/wireless/libertas/if_sdio.c |9 +++--
 drivers/net/wireless/libertas/if_usb.c  |   18 ++
 drivers/net/wireless/libertas/main.c|   18 ++
 5 files changed, 27 insertions(+), 31 deletions(-)

diff --git a/drivers/net/wireless/libertas/decl.h 
b/drivers/net/wireless/libertas/decl.h
index 447297a..201ec60 100644
--- a/drivers/net/wireless/libertas/decl.h
+++ b/drivers/net/wireless/libertas/decl.h
@@ -86,5 +86,6 @@ int lbs_stop_card(struct lbs_private *priv);
 int lbs_add_mesh(struct lbs_private *priv, struct device *dev);
 void lbs_remove_mesh(struct lbs_private *priv);
 int lbs_reset_device(struct lbs_private *priv);
+void lbs_host_to_card_done(struct lbs_private *priv);
 
 #endif
diff --git a/drivers/net/wireless/libertas/if_cs.c 
b/drivers/net/wireless/libertas/if_cs.c
index 5fadcc0..54b1ba3 100644
--- a/drivers/net/wireless/libertas/if_cs.c
+++ b/drivers/net/wireless/libertas/if_cs.c
@@ -253,19 +253,13 @@ static irqreturn_t if_cs_interrupt(int irq, void *data)
/* Not for us */
return IRQ_NONE;
 
-   } else if(int_cause == 0x) {
+   } else if (int_cause == 0x) {
/* Read in junk, the card has probably been removed */
card-priv-adapter-surpriseremoved = 1;
 
} else {
-   if(int_cause  IF_CS_H_IC_TX_OVER) {
-   card-priv-dnld_sent = DNLD_RES_RECEIVED;
-   if (!card-priv-adapter-cur_cmd)
-   wake_up_interruptible(card-priv-waitq);
-
-   if (card-priv-adapter-connect_status == 
LBS_CONNECTED)
-   netif_wake_queue(card-priv-dev);
-   }
+   if (int_cause  IF_CS_H_IC_TX_OVER)
+   lbs_host_to_card_done(card-priv);
 
/* clear interrupt */
if_cs_write16(card, IF_CS_C_INT_CAUSE, int_cause  
IF_CS_C_IC_MASK);
diff --git a/drivers/net/wireless/libertas/if_sdio.c 
b/drivers/net/wireless/libertas/if_sdio.c
index 7a7037b..a31 100644
--- a/drivers/net/wireless/libertas/if_sdio.c
+++ b/drivers/net/wireless/libertas/if_sdio.c
@@ -835,12 +835,9 @@ static void if_sdio_interrupt(struct sdio_func *func)
 * Ignore the define name, this really means the card has
 * successfully received the command.
 */
-   if (cause  IF_SDIO_H_INT_DNLD) {
-   if ((card-priv-dnld_sent == DNLD_DATA_SENT) 
-   (card-priv-adapter-connect_status == LBS_CONNECTED))
-   netif_wake_queue(card-priv-dev);
-   card-priv-dnld_sent = DNLD_RES_RECEIVED;
-   }
+   if (cause  IF_SDIO_H_INT_DNLD)
+   lbs_host_to_card_done(card-priv);
+
 
if (cause  IF_SDIO_H_INT_UPLD) {
ret = if_sdio_card_to_host(card);
diff --git a/drivers/net/wireless/libertas/if_usb.c 
b/drivers/net/wireless/libertas/if_usb.c
index c27ffcf..418dcab 100644
--- a/drivers/net/wireless/libertas/if_usb.c
+++ b/drivers/net/wireless/libertas/if_usb.c
@@ -66,22 +66,8 @@ static void if_usb_write_bulk_callback(struct urb *urb)
/* Used for both firmware TX and regular TX.  priv isn't
 * valid at firmware load time.
 */
-   if (priv) {
-   struct lbs_adapter *adapter = priv-adapter;
-   struct net_device *dev = priv-dev;
-
-   priv-dnld_sent = DNLD_RES_RECEIVED;
-
-   /* Wake main thread if commands are pending */
-   if (!adapter-cur_cmd)
-   wake_up_interruptible(priv-waitq);
-
-   if (adapter-connect_status == LBS_CONNECTED)
-   netif_wake_queue(dev);
-
-   if (priv-mesh_dev  (adapter-mesh_connect_status == 
LBS_CONNECTED))
-   netif_wake_queue(priv-mesh_dev);
-   }
+   if (priv)
+   lbs_host_to_card_done(priv);
  

libertas: Remove cmd_oid from struct cmd_ctrl_node

2008-01-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=f5ece8fc8d3f5e36bda3554b74b0fbecb0a14309
Commit: f5ece8fc8d3f5e36bda3554b74b0fbecb0a14309
Parent: 77d8cf2c093be3b58f6deed10673d0bc8cbd4202
Author: David Woodhouse [EMAIL PROTECTED]
AuthorDate: Sat Dec 1 15:15:41 2007 +
Committer:  David S. Miller [EMAIL PROTECTED]
CommitDate: Mon Jan 28 15:06:00 2008 -0800

libertas: Remove cmd_oid from struct cmd_ctrl_node

This is only needed for SNMP and key operations; it doesn't need to be
preserved outside that context.

Signed-off-by: David Woodhouse [EMAIL PROTECTED]
Signed-off-by: John W. Linville [EMAIL PROTECTED]
---
 drivers/net/wireless/libertas/cmd.c |9 +++--
 drivers/net/wireless/libertas/decl.h|2 +-
 drivers/net/wireless/libertas/hostcmd.h |2 --
 3 files changed, 4 insertions(+), 9 deletions(-)

diff --git a/drivers/net/wireless/libertas/cmd.c 
b/drivers/net/wireless/libertas/cmd.c
index d98bec9..6658590 100644
--- a/drivers/net/wireless/libertas/cmd.c
+++ b/drivers/net/wireless/libertas/cmd.c
@@ -1231,7 +1231,7 @@ int lbs_prepare_and_send_command(struct lbs_private *priv,
goto done;
}
 
-   lbs_set_cmd_ctrl_node(priv, cmdnode, cmd_oid, wait_option, pdata_buf);
+   lbs_set_cmd_ctrl_node(priv, cmdnode, wait_option, pdata_buf);
 
cmdptr = (struct cmd_ds_command *)cmdnode-bufvirtualaddr;
 
@@ -1404,7 +1404,7 @@ int lbs_prepare_and_send_command(struct lbs_private *priv,
case CMD_802_11_INACTIVITY_TIMEOUT:
ret = lbs_cmd_802_11_inactivity_timeout(priv, cmdptr,
 cmd_action, pdata_buf);
-   lbs_set_cmd_ctrl_node(priv, cmdnode, 0, 0, pdata_buf);
+   lbs_set_cmd_ctrl_node(priv, cmdnode, 0, pdata_buf);
break;
 
case CMD_802_11_TPC_CFG:
@@ -1668,7 +1668,6 @@ static void cleanup_cmdnode(struct cmd_ctrl_node 
*ptempnode)
ptempnode-cmdwaitqwoken = 1;
wake_up_interruptible(ptempnode-cmdwait_q);
ptempnode-status = 0;
-   ptempnode-cmd_oid = (u32) 0;
ptempnode-wait_option = 0;
ptempnode-pdata_buf = NULL;
 
@@ -1683,21 +1682,19 @@ static void cleanup_cmdnode(struct cmd_ctrl_node 
*ptempnode)
  *
  *  @param privA pointer to struct lbs_private structure
  *  @param ptempnode   A pointer to cmd_ctrl_node structure
- *  @param cmd_oid cmd oid: treated as sub command
  *  @param wait_option wait option: wait response or not
  *  @param pdata_buf   A pointer to informaion buffer
  *  @return0 or -1
  */
 void lbs_set_cmd_ctrl_node(struct lbs_private *priv,
struct cmd_ctrl_node *ptempnode,
-   u32 cmd_oid, u16 wait_option, void *pdata_buf)
+   u16 wait_option, void *pdata_buf)
 {
lbs_deb_enter(LBS_DEB_HOST);
 
if (!ptempnode)
return;
 
-   ptempnode-cmd_oid = cmd_oid;
ptempnode-wait_option = wait_option;
ptempnode-pdata_buf = pdata_buf;
 
diff --git a/drivers/net/wireless/libertas/decl.h 
b/drivers/net/wireless/libertas/decl.h
index 74187f3..447297a 100644
--- a/drivers/net/wireless/libertas/decl.h
+++ b/drivers/net/wireless/libertas/decl.h
@@ -26,7 +26,7 @@ struct cmd_ctrl_node *lbs_get_free_cmd_ctrl_node(struct 
lbs_private *priv);
 
 void lbs_set_cmd_ctrl_node(struct lbs_private *priv,
struct cmd_ctrl_node *ptempnode,
-   u32 cmd_oid, u16 wait_option, void *pdata_buf);
+   u16 wait_option, void *pdata_buf);
 
 int lbs_prepare_and_send_command(struct lbs_private *priv,
u16 cmd_no,
diff --git a/drivers/net/wireless/libertas/hostcmd.h 
b/drivers/net/wireless/libertas/hostcmd.h
index 614db6c..c029149 100644
--- a/drivers/net/wireless/libertas/hostcmd.h
+++ b/drivers/net/wireless/libertas/hostcmd.h
@@ -69,8 +69,6 @@ struct cmd_ctrl_node {
/* CMD link list */
struct list_head list;
u32 status;
-   /* CMD ID */
-   u32 cmd_oid;
/*CMD wait option: wait for finish or no wait */
u16 wait_option;
/* command parameter */
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


b43legacy: properly fix a bogus gcc warning

2008-01-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=125c5cc2c8c1fab6a6a1d8a07f7073b240e6d325
Commit: 125c5cc2c8c1fab6a6a1d8a07f7073b240e6d325
Parent: 013978b688d2a27af3ab55ca739e8c8ac7254870
Author: Frank Lichtenheld [EMAIL PROTECTED]
AuthorDate: Sat Nov 24 21:11:08 2007 +0100
Committer:  David S. Miller [EMAIL PROTECTED]
CommitDate: Mon Jan 28 15:05:02 2008 -0800

b43legacy: properly fix a bogus gcc warning

Use initialized_var() to properly fix a bogus gcc warning.

Signed-off-by: Stefano Brivio [EMAIL PROTECTED]
Cc: Frank Lichtenheld [EMAIL PROTECTED]
Signed-off-by: John W. Linville [EMAIL PROTECTED]
---
 drivers/net/wireless/b43legacy/debugfs.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/wireless/b43legacy/debugfs.c 
b/drivers/net/wireless/b43legacy/debugfs.c
index 619b453..03ce082 100644
--- a/drivers/net/wireless/b43legacy/debugfs.c
+++ b/drivers/net/wireless/b43legacy/debugfs.c
@@ -209,7 +209,7 @@ static ssize_t b43legacy_debugfs_read(struct file *file, 
char __user *userbuf,
struct b43legacy_wldev *dev;
struct b43legacy_debugfs_fops *dfops;
struct b43legacy_dfs_file *dfile;
-   ssize_t ret = 0;
+   ssize_t uninitialized_var(ret);
char *buf;
const size_t bufsize = 1024 * 128;
const size_t buforder = get_order(bufsize);
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


ipg: remove IPG_DEV_KFREE_SKB macro

2008-01-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=85d68a58833a9e361ecabd5e89d228301d346d94
Commit: 85d68a58833a9e361ecabd5e89d228301d346d94
Parent: 4602e665ff45e0af4cc64a6caf4c872f18d14148
Author: Pekka Enberg [EMAIL PROTECTED]
AuthorDate: Fri Nov 30 09:53:51 2007 +0200
Committer:  David S. Miller [EMAIL PROTECTED]
CommitDate: Mon Jan 28 15:05:49 2008 -0800

ipg: remove IPG_DEV_KFREE_SKB macro

Signed-off-by: Pekka Enberg [EMAIL PROTECTED]
Cc: Francois Romieu [EMAIL PROTECTED]
Cc: Sorbica Shieh [EMAIL PROTECTED]
Cc: Jesse Huang [EMAIL PROTECTED]
---
 drivers/net/ipg.c |   28 ++--
 drivers/net/ipg.h |2 --
 2 files changed, 14 insertions(+), 16 deletions(-)

diff --git a/drivers/net/ipg.c b/drivers/net/ipg.c
index 50f0c17..780882f 100644
--- a/drivers/net/ipg.c
+++ b/drivers/net/ipg.c
@@ -776,7 +776,7 @@ static int init_rfdlist(struct net_device *dev)
pci_unmap_single(sp-pdev,
le64_to_cpu(rxfd-frag_info)  ~IPG_RFI_FRAGLEN,
sp-rx_buf_sz, PCI_DMA_FROMDEVICE);
-   IPG_DEV_KFREE_SKB(sp-RxBuff[i]);
+   dev_kfree_skb_irq(sp-RxBuff[i]);
sp-RxBuff[i] = NULL;
}
 
@@ -829,7 +829,7 @@ static void init_tfdlist(struct net_device *dev)
txfd-tfc = cpu_to_le64(IPG_TFC_TFDDONE);
 
if (sp-TxBuff[i]) {
-   IPG_DEV_KFREE_SKB(sp-TxBuff[i]);
+   dev_kfree_skb_irq(sp-TxBuff[i]);
sp-TxBuff[i] = NULL;
}
 
@@ -884,7 +884,7 @@ static void ipg_nic_txfree(struct net_device *dev)
le64_to_cpu(txfd-frag_info)  ~IPG_TFI_FRAGLEN,
skb-len, PCI_DMA_TODEVICE);
 
-   IPG_DEV_KFREE_SKB(skb);
+   dev_kfree_skb_irq(skb);
 
sp-TxBuff[dirty] = NULL;
}
@@ -1112,7 +1112,7 @@ inline void ipg_nic_rx_free_skb(struct net_device *dev)
pci_unmap_single(sp-pdev,
le64_to_cpu(rxfd-frag_info  ~IPG_RFI_FRAGLEN),
sp-rx_buf_sz, PCI_DMA_FROMDEVICE);
-   IPG_DEV_KFREE_SKB(sp-RxBuff[entry]);
+   dev_kfree_skb_irq(sp-RxBuff[entry]);
sp-RxBuff[entry] = NULL;
}
 }
@@ -1180,7 +1180,7 @@ inline int ipg_nic_rx_check_error(struct net_device *dev)
le64_to_cpu(rxfd-frag_info  ~IPG_RFI_FRAGLEN),
sp-rx_buf_sz, PCI_DMA_FROMDEVICE);
 
-   IPG_DEV_KFREE_SKB(sp-RxBuff[entry]);
+   dev_kfree_skb_irq(sp-RxBuff[entry]);
sp-RxBuff[entry] = NULL;
}
return ErrorPacket;
@@ -1197,7 +1197,7 @@ static void ipg_nic_rx_with_start_and_end(struct 
net_device *dev,
int framelen;
 
if (jumbo-FoundStart) {
-   IPG_DEV_KFREE_SKB(jumbo-skb);
+   dev_kfree_skb_irq(jumbo-skb);
jumbo-FoundStart = 0;
jumbo-CurrentSize = 0;
jumbo-skb = NULL;
@@ -1242,7 +1242,7 @@ static void ipg_nic_rx_with_start(struct net_device *dev,
return;
 
if (jumbo-FoundStart)
-   IPG_DEV_KFREE_SKB(jumbo-skb);
+   dev_kfree_skb_irq(jumbo-skb);
 
pci_unmap_single(pdev, le64_to_cpu(rxfd-frag_info  ~IPG_RFI_FRAGLEN),
 sp-rx_buf_sz, PCI_DMA_FROMDEVICE);
@@ -1281,7 +1281,7 @@ static void ipg_nic_rx_with_end(struct net_device *dev,
framelen=IPG_RXFRAG_SIZE;
 */
if (framelen  IPG_RXSUPPORT_SIZE)
-   IPG_DEV_KFREE_SKB(jumbo-skb);
+   dev_kfree_skb_irq(jumbo-skb);
else {
memcpy(skb_put(jumbo-skb, endframeLen),
   skb-data, endframeLen);
@@ -1301,7 +1301,7 @@ static void ipg_nic_rx_with_end(struct net_device *dev,
 
ipg_nic_rx_free_skb(dev);
} else {
-   IPG_DEV_KFREE_SKB(jumbo-skb);
+   dev_kfree_skb_irq(jumbo-skb);
jumbo-FoundStart = 0;
jumbo-CurrentSize = 0;
jumbo-skb = NULL;
@@ -1331,7 +1331,7 @@ static void ipg_nic_rx_no_start_no_end(struct net_device 
*dev,
ipg_nic_rx_free_skb(dev);
}
} else {
-   IPG_DEV_KFREE_SKB(jumbo-skb);
+   dev_kfree_skb_irq(jumbo-skb);
jumbo-FoundStart = 0;
jumbo-CurrentSize = 0;
jumbo-skb = NULL;
@@ -1472,7 +1472,7 @@ static int ipg_nic_rx(struct net_device *dev)
le64_to_cpu(info)  

ipg: remove boolean macros

2008-01-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=4602e665ff45e0af4cc64a6caf4c872f18d14148
Commit: 4602e665ff45e0af4cc64a6caf4c872f18d14148
Parent: 9305a775210030a09f2e373e72920573770a37de
Author: Pekka Enberg [EMAIL PROTECTED]
AuthorDate: Fri Nov 30 09:53:33 2007 +0200
Committer:  David S. Miller [EMAIL PROTECTED]
CommitDate: Mon Jan 28 15:05:49 2008 -0800

ipg: remove boolean macros

Signed-off-by: Pekka Enberg [EMAIL PROTECTED]
Cc: Francois Romieu [EMAIL PROTECTED]
Cc: Sorbica Shieh [EMAIL PROTECTED]
Cc: Jesse Huang [EMAIL PROTECTED]
---
 drivers/net/ipg.h |   18 +++---
 1 files changed, 7 insertions(+), 11 deletions(-)

diff --git a/drivers/net/ipg.h b/drivers/net/ipg.h
index 7bbb131..017727f 100644
--- a/drivers/net/ipg.h
+++ b/drivers/net/ipg.h
@@ -478,38 +478,34 @@ enum ipg_regs {
  * Tune
  */
 
-/* Miscellaneous Constants. */
-#define   TRUE  1
-#define   FALSE 0
-
 /* Assign IPG_APPEND_FCS_ON_TX  0 for auto FCS append on TX. */
-#define IPG_APPEND_FCS_ON_TX TRUE
+#define IPG_APPEND_FCS_ON_TX 1
 
 /* Assign IPG_APPEND_FCS_ON_TX  0 for auto FCS strip on RX. */
-#define IPG_STRIP_FCS_ON_RX  TRUE
+#define IPG_STRIP_FCS_ON_RX  1
 
 /* Assign IPG_DROP_ON_RX_ETH_ERRORS  0 to drop RX frames with
  * Ethernet errors.
  */
-#define IPG_DROP_ON_RX_ETH_ERRORSTRUE
+#define IPG_DROP_ON_RX_ETH_ERRORS1
 
 /* Assign IPG_INSERT_MANUAL_VLAN_TAG  0 to insert VLAN tags manually
  * (via TFC).
  */
-#defineIPG_INSERT_MANUAL_VLAN_TAG   FALSE
+#defineIPG_INSERT_MANUAL_VLAN_TAG   0
 
 /* Assign IPG_ADD_IPCHECKSUM_ON_TX  0 for auto IP checksum on TX. */
-#define IPG_ADD_IPCHECKSUM_ON_TX FALSE
+#define IPG_ADD_IPCHECKSUM_ON_TX 0
 
 /* Assign IPG_ADD_TCPCHECKSUM_ON_TX  0 for auto TCP checksum on TX.
  * DO NOT USE FOR SILICON REVISIONS B3 AND EARLIER.
  */
-#define IPG_ADD_TCPCHECKSUM_ON_TXFALSE
+#define IPG_ADD_TCPCHECKSUM_ON_TX0
 
 /* Assign IPG_ADD_UDPCHECKSUM_ON_TX  0 for auto UDP checksum on TX.
  * DO NOT USE FOR SILICON REVISIONS B3 AND EARLIER.
  */
-#define IPG_ADD_UDPCHECKSUM_ON_TXFALSE
+#define IPG_ADD_UDPCHECKSUM_ON_TX0
 
 /* If inserting VLAN tags manually, assign the IPG_MANUAL_VLAN_xx
  * constants as desired.
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


iwlwifi: continue namespace changes - fix CONFIG variables

2008-01-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=0054b34d295f0c77110c8c8ae5e3320ef40617b2
Commit: 0054b34d295f0c77110c8c8ae5e3320ef40617b2
Parent: 90e759d14cd58ea1e34042bab930ce434fa0e4fa
Author: Reinette Chatre [EMAIL PROTECTED]
AuthorDate: Thu Nov 29 11:09:42 2007 +0800
Committer:  David S. Miller [EMAIL PROTECTED]
CommitDate: Mon Jan 28 15:05:13 2008 -0800

iwlwifi: continue namespace changes - fix CONFIG variables

- Remove HT code from iwl-3945.h - it is not needed here as 3945
  does not support HT. The code ended up here during the header file
  split.
- Modify a few places where the CONFIG variables were named
  incorrectly: all changes are to comments only.

Signed-off-by: Reinette Chatre [EMAIL PROTECTED]
Signed-off-by: John W. Linville [EMAIL PROTECTED]
---
 drivers/net/wireless/iwlwifi/iwl-3945.h |   25 -
 drivers/net/wireless/iwlwifi/iwl-4965.c |2 +-
 drivers/net/wireless/iwlwifi/iwl3945-base.c |2 +-
 drivers/net/wireless/iwlwifi/iwl4965-base.c |2 +-
 4 files changed, 3 insertions(+), 28 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl-3945.h 
b/drivers/net/wireless/iwlwifi/iwl-3945.h
index e5b345d..02040ef 100644
--- a/drivers/net/wireless/iwlwifi/iwl-3945.h
+++ b/drivers/net/wireless/iwlwifi/iwl-3945.h
@@ -445,31 +445,6 @@ union iwl3945_ht_rate_supp {
};
 };
 
-#ifdef CONFIG_IWL3945_HT
-#define CFG_HT_RX_AMPDU_FACTOR_DEF  (0x3)
-#define HT_IE_MAX_AMSDU_SIZE_4K (0)
-#define CFG_HT_MPDU_DENSITY_2USEC   (0x5)
-#define CFG_HT_MPDU_DENSITY_DEF CFG_HT_MPDU_DENSITY_2USEC
-
-struct sta_ht_info {
-   u8 is_ht;
-   u16 rx_mimo_ps_mode;
-   u16 tx_mimo_ps_mode;
-   u16 control_channel;
-   u8 max_amsdu_size;
-   u8 ampdu_factor;
-   u8 mpdu_density;
-   u8 operating_mode;
-   u8 supported_chan_width;
-   u8 extension_chan_offset;
-   u8 is_green_field;
-   u8 sgf;
-   u8 supp_rates[16];
-   u8 tx_chan_width;
-   u8 chan_width_cap;
-};
-#endif /*CONFIG_IWL3945_HT */
-
 #ifdef CONFIG_IWL3945_QOS
 
 union iwl3945_qos_capabity {
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.c 
b/drivers/net/wireless/iwlwifi/iwl-4965.c
index 9b8560d..5dee8e5 100644
--- a/drivers/net/wireless/iwlwifi/iwl-4965.c
+++ b/drivers/net/wireless/iwlwifi/iwl-4965.c
@@ -4667,7 +4667,7 @@ void iwl4965_hw_setup_deferred_work(struct iwl4965_priv 
*priv)
 #ifdef CONFIG_IWL4965_HT
 #ifdef CONFIG_IWL4965_HT_AGG
INIT_WORK(priv-agg_work, iwl4965_bg_agg_work);
-#endif /* CONFIG_IWL4965_AGG */
+#endif /* CONFIG_IWL4965_HT_AGG */
 #endif /* CONFIG_IWL4965_HT */
init_timer(priv-statistics_periodic);
priv-statistics_periodic.data = (unsigned long)priv;
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c 
b/drivers/net/wireless/iwlwifi/iwl3945-base.c
index 4fa85d8..036e2f1 100644
--- a/drivers/net/wireless/iwlwifi/iwl3945-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c
@@ -7362,7 +7362,7 @@ static int iwl3945_mac_conf_tx(struct ieee80211_hw *hw, 
int queue,
 #ifdef CONFIG_IWL3945_QOS
unsigned long flags;
int q;
-#endif /* CONFIG_IWL_QOS */
+#endif /* CONFIG_IWL3945_QOS */
 
IWL_DEBUG_MAC80211(enter\n);
 
diff --git a/drivers/net/wireless/iwlwifi/iwl4965-base.c 
b/drivers/net/wireless/iwlwifi/iwl4965-base.c
index 921c662..11ef1c0 100644
--- a/drivers/net/wireless/iwlwifi/iwl4965-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl4965-base.c
@@ -7795,7 +7795,7 @@ static int iwl4965_mac_conf_tx(struct ieee80211_hw *hw, 
int queue,
 #ifdef CONFIG_IWL4965_QOS
unsigned long flags;
int q;
-#endif /* CONFIG_IWL_QOS */
+#endif /* CONFIG_IWL4965_QOS */
 
IWL_DEBUG_MAC80211(enter\n);
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


iwlwifi: update version number to 1.2.22

2008-01-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=d128394894d6489370e4e3466e799ec9e5a705a3
Commit: d128394894d6489370e4e3466e799ec9e5a705a3
Parent: fde3571fd8613483f1203d11394ae316c6b79a03
Author: Zhu Yi [EMAIL PROTECTED]
AuthorDate: Thu Nov 29 11:10:16 2007 +0800
Committer:  David S. Miller [EMAIL PROTECTED]
CommitDate: Mon Jan 28 15:05:38 2008 -0800

iwlwifi: update version number to 1.2.22

Signed-off-by: Zhu Yi [EMAIL PROTECTED]
Signed-off-by: John W. Linville [EMAIL PROTECTED]
---
 drivers/net/wireless/iwlwifi/iwl3945-base.c |2 +-
 drivers/net/wireless/iwlwifi/iwl4965-base.c |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c 
b/drivers/net/wireless/iwlwifi/iwl3945-base.c
index dbb6eff..ae352da 100644
--- a/drivers/net/wireless/iwlwifi/iwl3945-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c
@@ -91,7 +91,7 @@ int iwl3945_param_queues_num = IWL_MAX_NUM_QUEUES; /* def: 8 
Tx queues */
 #define VS
 #endif
 
-#define IWLWIFI_VERSION 1.1.19k VD VS
+#define IWLWIFI_VERSION 1.2.22k VD VS
 #define DRV_COPYRIGHT  Copyright(c) 2003-2007 Intel Corporation
 #define DRV_VERSION IWLWIFI_VERSION
 
diff --git a/drivers/net/wireless/iwlwifi/iwl4965-base.c 
b/drivers/net/wireless/iwlwifi/iwl4965-base.c
index b6e9a09..6a8c629 100644
--- a/drivers/net/wireless/iwlwifi/iwl4965-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl4965-base.c
@@ -90,7 +90,7 @@ int iwl4965_param_queues_num = IWL_MAX_NUM_QUEUES; /* def: 16 
Tx queues */
 #define VS
 #endif
 
-#define IWLWIFI_VERSION 1.1.19k VD VS
+#define IWLWIFI_VERSION 1.2.22k VD VS
 #define DRV_COPYRIGHT  Copyright(c) 2003-2007 Intel Corporation
 #define DRV_VERSION IWLWIFI_VERSION
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


iwlwifi: enhance WPA authenication stability

2008-01-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=7878a5a4fcc5002e805c054730c4c5639c9d071d
Commit: 7878a5a4fcc5002e805c054730c4c5639c9d071d
Parent: 2bdc7031f9ea1826e16bffc3540d05de891c98bc
Author: Mohamed Abbas [EMAIL PROTECTED]
AuthorDate: Thu Nov 29 11:10:13 2007 +0800
Committer:  David S. Miller [EMAIL PROTECTED]
CommitDate: Mon Jan 28 15:05:36 2008 -0800

iwlwifi: enhance WPA authenication stability

This patch enhanced WPA authenication stability by avoiding scan
immediately followed by association. We don't do any scanning right
after association in next several seconds. This will allow WPA
authentication to take place without any interruption.

Signed-off-by: Mohamed Abbas [EMAIL PROTECTED]
Signed-off-by: Zhu Yi [EMAIL PROTECTED]
Signed-off-by: John W. Linville [EMAIL PROTECTED]
---
 drivers/net/wireless/iwlwifi/iwl-3945.c |9 +
 drivers/net/wireless/iwlwifi/iwl-3945.h |1 +
 drivers/net/wireless/iwlwifi/iwl-4965.c |8 
 drivers/net/wireless/iwlwifi/iwl-4965.h |1 +
 drivers/net/wireless/iwlwifi/iwl3945-base.c |   24 +---
 drivers/net/wireless/iwlwifi/iwl4965-base.c |   24 +---
 6 files changed, 53 insertions(+), 14 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl-3945.c 
b/drivers/net/wireless/iwlwifi/iwl-3945.c
index 51b9030..1b81545 100644
--- a/drivers/net/wireless/iwlwifi/iwl-3945.c
+++ b/drivers/net/wireless/iwlwifi/iwl-3945.c
@@ -285,6 +285,8 @@ static void iwl3945_handle_data_packet(struct iwl3945_priv 
*priv, int is_data,
rxb-skb = NULL;
 }
 
+#define IWL_DELAY_NEXT_SCAN_AFTER_ASSOC (HZ*6)
+
 static void iwl3945_rx_reply_rx(struct iwl3945_priv *priv,
struct iwl3945_rx_mem_buffer *rxb)
 {
@@ -442,6 +444,13 @@ static void iwl3945_rx_reply_rx(struct iwl3945_priv *priv,
case IEEE80211_STYPE_REASSOC_RESP:{
struct ieee80211_mgmt *mgnt =
(struct ieee80211_mgmt *)header;
+
+   /* We have just associated, give some
+* time for the 4-way handshake if
+* any. Don't start scan too early. */
+   priv-next_scan_jiffies = jiffies +
+   IWL_DELAY_NEXT_SCAN_AFTER_ASSOC;
+
priv-assoc_id = (~((1  15) | (1  14)) 
  le16_to_cpu(mgnt-u.
  assoc_resp.aid));
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945.h 
b/drivers/net/wireless/iwlwifi/iwl-3945.h
index 75cef3e..1f82061 100644
--- a/drivers/net/wireless/iwlwifi/iwl-3945.h
+++ b/drivers/net/wireless/iwlwifi/iwl-3945.h
@@ -752,6 +752,7 @@ struct iwl3945_priv {
 
/* Scan related variables */
unsigned long last_scan_jiffies;
+   unsigned long next_scan_jiffies;
unsigned long scan_start;
unsigned long scan_pass_start;
unsigned long scan_start_tsf;
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.c 
b/drivers/net/wireless/iwlwifi/iwl-4965.c
index 40c795e..c8e7adf 100644
--- a/drivers/net/wireless/iwlwifi/iwl-4965.c
+++ b/drivers/net/wireless/iwlwifi/iwl-4965.c
@@ -3802,6 +3802,8 @@ static void iwl4965_update_ps_mode(struct iwl4965_priv 
*priv, u16 ps_bit, u8 *ad
}
 }
 
+#define IWL_DELAY_NEXT_SCAN_AFTER_ASSOC (HZ*6)
+
 /* Called for REPLY_4965_RX (legacy ABG frames), or
  * REPLY_RX_MPDU_CMD (HT high-throughput N frames). */
 static void iwl4965_rx_reply_rx(struct iwl4965_priv *priv,
@@ -3973,6 +3975,12 @@ static void iwl4965_rx_reply_rx(struct iwl4965_priv 
*priv,
struct ieee80211_mgmt *mgnt =
(struct ieee80211_mgmt *)header;
 
+   /* We have just associated, give some
+* time for the 4-way handshake if
+* any. Don't start scan too early. */
+   priv-next_scan_jiffies = jiffies +
+   IWL_DELAY_NEXT_SCAN_AFTER_ASSOC;
+
priv-assoc_id = (~((1  15) | (1  14))
 le16_to_cpu(mgnt-u.assoc_resp.aid));
priv-assoc_capability =
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.h 
b/drivers/net/wireless/iwlwifi/iwl-4965.h
index 2930c10..c062738 100644
--- a/drivers/net/wireless/iwlwifi/iwl-4965.h
+++ b/drivers/net/wireless/iwlwifi/iwl-4965.h
@@ -1082,6 +1082,7 @@ struct iwl4965_priv {
 
/* Scan related variables */
unsigned long last_scan_jiffies;
+   unsigned long next_scan_jiffies;
unsigned long scan_start;
unsigned long scan_pass_start;
unsigned long 

iwlwifi: document 4965 rate scaling

2008-01-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=2bdc7031f9ea1826e16bffc3540d05de891c98bc
Commit: 2bdc7031f9ea1826e16bffc3540d05de891c98bc
Parent: 529699815b79f15a6644786dc4d6e9dd5153a447
Author: Ben Cahill [EMAIL PROTECTED]
AuthorDate: Thu Nov 29 11:10:12 2007 +0800
Committer:  David S. Miller [EMAIL PROTECTED]
CommitDate: Mon Jan 28 15:05:35 2008 -0800

iwlwifi: document 4965 rate scaling

Document 4965 rate scaling

Signed-off-by: Ben Cahill [EMAIL PROTECTED]
Signed-off-by: Zhu Yi [EMAIL PROTECTED]
Signed-off-by: John W. Linville [EMAIL PROTECTED]
---
 drivers/net/wireless/iwlwifi/iwl-4965-commands.h |  251 +-
 1 files changed, 247 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl-4965-commands.h 
b/drivers/net/wireless/iwlwifi/iwl-4965-commands.h
index cbe91db..7988c75 100644
--- a/drivers/net/wireless/iwlwifi/iwl-4965-commands.h
+++ b/drivers/net/wireless/iwlwifi/iwl-4965-commands.h
@@ -1322,6 +1322,8 @@ struct iwl4965_compressed_ba_resp {
 
 /*
  * REPLY_TX_PWR_TABLE_CMD = 0x97 (command, has simple generic response)
+ *
+ * See details under TXPOWER in iwl-4965-hw.h.
  */
 struct iwl4965_txpowertable_cmd {
u8 band;/* 0: 5 GHz, 1: 2.4 GHz */
@@ -1333,39 +1335,280 @@ struct iwl4965_txpowertable_cmd {
 /*RS_NEW_API: only TLC_RTS remains and moved to bit 0 */
 #define  LINK_QUAL_FLAGS_SET_STA_TLC_RTS_MSK   (10)
 
+/* # of EDCA prioritized tx fifos */
 #define  LINK_QUAL_AC_NUM AC_NUM
+
+/* # entries in rate scale table to support Tx retries */
 #define  LINK_QUAL_MAX_RETRY_NUM 16
 
+/* Tx antenna selection values */
 #define  LINK_QUAL_ANT_A_MSK (10)
 #define  LINK_QUAL_ANT_B_MSK (11)
 #define  LINK_QUAL_ANT_MSK   (LINK_QUAL_ANT_A_MSK|LINK_QUAL_ANT_B_MSK)
 
+
+/**
+ * struct iwl4965_link_qual_general_params
+ *
+ * Used in REPLY_TX_LINK_QUALITY_CMD
+ */
 struct iwl4965_link_qual_general_params {
u8 flags;
+
+   /* No entries at or above this (driver chosen) index contain MIMO */
u8 mimo_delimiter;
-   u8 single_stream_ant_msk;
-   u8 dual_stream_ant_msk;
+
+   /* Best single antenna to use for single stream (legacy, SISO). */
+   u8 single_stream_ant_msk;   /* LINK_QUAL_ANT_* */
+
+   /* Best antennas to use for MIMO (unused for 4965, assumes both). */
+   u8 dual_stream_ant_msk; /* LINK_QUAL_ANT_* */
+
+   /*
+* If driver needs to use different initial rates for different
+* EDCA QOS access categories (as implemented by tx fifos 0-3),
+* this table will set that up, by indicating the indexes in the
+* rs_table[LINK_QUAL_MAX_RETRY_NUM] rate table at which to start.
+* Otherwise, driver should set all entries to 0.
+*
+* Entry usage:
+* 0 = Background, 1 = Best Effort (normal), 2 = Video, 3 = Voice
+* TX FIFOs above 3 use same value (typically 0) as TX FIFO 3.
+*/
u8 start_rate_index[LINK_QUAL_AC_NUM];
 } __attribute__ ((packed));
 
+/**
+ * struct iwl4965_link_qual_agg_params
+ *
+ * Used in REPLY_TX_LINK_QUALITY_CMD
+ */
 struct iwl4965_link_qual_agg_params {
+
+   /* Maximum number of uSec in aggregation.
+* Driver should set this to 4000 (4 milliseconds). */
__le16 agg_time_limit;
+
+   /*
+* Number of Tx retries allowed for a frame, before that frame will
+* no longer be considered for the start of an aggregation sequence
+* (scheduler will then try to tx it as single frame).
+* Driver should set this to 3.
+*/
u8 agg_dis_start_th;
+
+   /*
+* Maximum number of frames in aggregation.
+* 0 = no limit (default).  1 = no aggregation.
+* Other values = max # frames in aggregation.
+*/
u8 agg_frame_cnt_limit;
+
__le32 reserved;
 } __attribute__ ((packed));
 
 /*
  * REPLY_TX_LINK_QUALITY_CMD = 0x4e (command, has simple generic response)
+ *
+ * For 4965 only; 3945 uses REPLY_RATE_SCALE.
+ *
+ * Each station in the 4965's internal station table has its own table of 16
+ * Tx rates and modulation modes (e.g. legacy/SISO/MIMO) for retrying Tx when
+ * an ACK is not received.  This command replaces the entire table for
+ * one station.
+ *
+ * NOTE:  Station must already be in 4965's station table.  Use REPLY_ADD_STA.
+ *
+ * The rate scaling procedures described below work well.  Of course, other
+ * procedures are possible, and may work better for particular environments.
+ *
+ *
+ * FILLING THE RATE TABLE
+ *
+ * Given a particular initial rate and mode, as determined by the rate
+ * scaling algorithm described below, the Linux driver uses the following
+ * formula to fill the rs_table[LINK_QUAL_MAX_RETRY_NUM] rate table in the
+ * Link Quality command:
+ *
+ *
+ * 1)  If using High-throughput (HT) (SISO or MIMO) initial rate:
+ * a) Use this same initial rate for first 3 entries.
+ 

iwlwifi: document shared Tx structures

2008-01-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=5d5456fe50cb07347dd350fc045dc98677dbc58f
Commit: 5d5456fe50cb07347dd350fc045dc98677dbc58f
Parent: 483fd7e5ffa527daeaff006e033225e273d110f8
Author: Ben Cahill [EMAIL PROTECTED]
AuthorDate: Thu Nov 29 11:10:06 2007 +0800
Committer:  David S. Miller [EMAIL PROTECTED]
CommitDate: Mon Jan 28 15:05:30 2008 -0800

iwlwifi: document shared Tx structures

Document shared Tx structures

Signed-off-by: Ben Cahill [EMAIL PROTECTED]
Signed-off-by: Zhu Yi [EMAIL PROTECTED]
Signed-off-by: John W. Linville [EMAIL PROTECTED]
---
 drivers/net/wireless/iwlwifi/iwl-4965-hw.h |  147 +---
 1 files changed, 135 insertions(+), 12 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl-4965-hw.h 
b/drivers/net/wireless/iwlwifi/iwl-4965-hw.h
index e7c7f71..b548b79 100644
--- a/drivers/net/wireless/iwlwifi/iwl-4965-hw.h
+++ b/drivers/net/wireless/iwlwifi/iwl-4965-hw.h
@@ -452,6 +452,13 @@ struct iwl4965_eeprom {
  */
 #define CSR_HW_REV_WA_REG  (CSR_BASE+0x22C)
 
+/* Hardware interface configuration bits */
+#define CSR_HW_IF_CONFIG_REG_BIT_KEDRON_R  (0x0010)
+#define CSR_HW_IF_CONFIG_REG_MSK_BOARD_VER (0x0C00)
+#define CSR_HW_IF_CONFIG_REG_BIT_MAC_SI(0x0100)
+#define CSR_HW_IF_CONFIG_REG_BIT_RADIO_SI  (0x0200)
+#define CSR_HW_IF_CONFIG_REG_BIT_EEPROM_OWN_SEM (0x0020)
+
 /* interrupt flags in INTA, set by uCode or hardware (e.g. dma),
  * acknowledged (reset) by host writing 1 to flagged bits. */
 #define CSR_INT_BIT_FH_RX(131) /* Rx DMA, cmd responses, 
FH_INT[17:16] */
@@ -1574,12 +1581,6 @@ enum {
 #define SCD_QUEUE_CTX_REG2_FRAME_LIMIT_POS (16)
 #define SCD_QUEUE_CTX_REG2_FRAME_LIMIT_MSK (0x007F)
 
-#define CSR_HW_IF_CONFIG_REG_BIT_KEDRON_R  (0x0010)
-#define CSR_HW_IF_CONFIG_REG_MSK_BOARD_VER (0x0C00)
-#define CSR_HW_IF_CONFIG_REG_BIT_MAC_SI(0x0100)
-#define CSR_HW_IF_CONFIG_REG_BIT_RADIO_SI  (0x0200)
-#define CSR_HW_IF_CONFIG_REG_BIT_EEPROM_OWN_SEM (0x0020)
-
 static inline u8 iwl4965_hw_get_rate(__le32 rate_n_flags)
 {
return le32_to_cpu(rate_n_flags)  0xFF;
@@ -1593,6 +1594,53 @@ static inline __le32 iwl4965_hw_set_rate_n_flags(u8 
rate, u16 flags)
return cpu_to_le32(flags|(u16)rate);
 }
 
+
+/**
+ * Tx/Rx Queues
+ *
+ * Most communication between driver and 4965 is via queues of data buffers.
+ * For example, all commands that the driver issues to device's embedded
+ * controller (uCode) are via the command queue (one of the Tx queues).  All
+ * uCode command responses/replies/notifications, including Rx frames, are
+ * conveyed from uCode to driver via the Rx queue.
+ *
+ * Most support for these queues, including handshake support, resides in
+ * structures in host DRAM, shared between the driver and the device.  When
+ * allocating this memory, the driver must make sure that data written by
+ * the host CPU updates DRAM immediately (and does not get stuck in CPU's
+ * cache memory), so DRAM and cache are consistent, and the device can
+ * immediately see changes made by the driver.
+ *
+ * 4965 supports up to 16 DRAM-based Tx queues, and services these queues via
+ * up to 7 DMA channels (FIFOs).  Each Tx queue is supported by a circular 
array
+ * in DRAM containing 256 Transmit Frame Descriptors (TFDs).
+ */
+#define IWL4965_MAX_WIN_SIZE  64
+#define IWL4965_QUEUE_SIZE   256
+#define IWL4965_NUM_FIFOS  7
+#define IWL_MAX_NUM_QUEUES16
+
+
+/**
+ * struct iwl4965_tfd_frame_data
+ *
+ * Describes up to 2 buffers containing (contiguous) portions of a Tx frame.
+ * Each buffer must be on dword boundary.
+ * Up to 10 iwl_tfd_frame_data structures, describing up to 20 buffers,
+ * may be filled within a TFD (iwl_tfd_frame).
+ *
+ * Bit fields in tb1_addr:
+ * 31- 0: Tx buffer 1 address bits [31:0]
+ *
+ * Bit fields in val1:
+ * 31-16: Tx buffer 2 address bits [15:0]
+ * 15- 4: Tx buffer 1 length (bytes)
+ *  3- 0: Tx buffer 1 address bits [32:32]
+ *
+ * Bit fields in val2:
+ * 31-20: Tx buffer 2 length (bytes)
+ * 19- 0: Tx buffer 2 address bits [35:16]
+ */
 struct iwl4965_tfd_frame_data {
__le32 tb1_addr;
 
@@ -1621,6 +1669,35 @@ struct iwl4965_tfd_frame_data {
 #define IWL_tb2_len_SYM val2
 } __attribute__ ((packed));
 
+
+/**
+ * struct iwl4965_tfd_frame
+ *
+ * Transmit Frame Descriptor (TFD)
+ *
+ * 4965 supports up to 16 Tx queues resident in host DRAM.
+ * Each Tx queue uses a circular buffer of 256 TFDs stored in host DRAM.
+ * Both driver and device share these circular buffers, each of which must be
+ * contiguous 256 TFDs x 128 bytes-per-TFD = 32 KBytes for 4965.
+ *
+ * Driver must indicate the physical address of the base of each
+ * circular buffer via the 4965's FH_MEM_CBBC_QUEUE registers.
+ *
+ * Each TFD contains pointer/size information for up to 20 

iwlwifi: document temperature calculation

2008-01-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=5991b419f04dee78c36d43de6b6ff2d27934d707
Commit: 5991b419f04dee78c36d43de6b6ff2d27934d707
Parent: fcd427bbba10fc315d1c958b85bba74448db4eb4
Author: Ben Cahill [EMAIL PROTECTED]
AuthorDate: Thu Nov 29 11:10:01 2007 +0800
Committer:  David S. Miller [EMAIL PROTECTED]
CommitDate: Mon Jan 28 15:05:27 2008 -0800

iwlwifi: document temperature calculation

Document temperature calculation

Signed-off-by: Ben Cahill [EMAIL PROTECTED]
Signed-off-by: Zhu Yi [EMAIL PROTECTED]
Signed-off-by: John W. Linville [EMAIL PROTECTED]
---
 drivers/net/wireless/iwlwifi/iwl-4965-hw.h |   57 ++-
 1 files changed, 46 insertions(+), 11 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl-4965-hw.h 
b/drivers/net/wireless/iwlwifi/iwl-4965-hw.h
index 3c09225..78d9854 100644
--- a/drivers/net/wireless/iwlwifi/iwl-4965-hw.h
+++ b/drivers/net/wireless/iwlwifi/iwl-4965-hw.h
@@ -645,21 +645,43 @@ static inline int iwl4965_hw_valid_rtc_data_addr(u32 addr)
   (addr  KDR_RTC_DATA_UPPER_BOUND);
 }
 
-/* START TXPOWER */
-
-enum {
-   CALIB_CH_GROUP_1 = 0,
-   CALIB_CH_GROUP_2 = 1,
-   CALIB_CH_GROUP_3 = 2,
-   CALIB_CH_GROUP_4 = 3,
-   CALIB_CH_GROUP_5 = 4,
-   CALIB_CH_GROUP_MAX
-};
+/* START TEMPERATURE */
 
-/* Temperature calibration offset is 3% 0C in Kelvin */
+/*
+ * 4965 temperature calculation.
+ *
+ * The driver must calculate the device temperature before calculating
+ * a txpower setting (amplifier gain is temperature dependent).  The
+ * calculation uses 4 measurements, 3 of which (R1, R2, R3) are calibration
+ * values used for the life of the driver, and one of which (R4) is the
+ * real-time temperature indicator.
+ *
+ * uCode provides all 4 values to the driver via the initialize alive
+ * notification (see struct iwl4965_init_alive_resp).  After the runtime uCode
+ * image loads, uCode updates the R4 value via statistics notifications
+ * (see STATISTICS_NOTIFICATION), which occur after each received beacon
+ * when associated, or can be requested via REPLY_STATISTICS_CMD.
+ *
+ * NOTE:  uCode provides the R4 value as a 23-bit signed value.  Driver
+ *must sign-extend to 32 bits before applying formula below.
+ *
+ * Formula:
+ *
+ * degrees Kelvin = ((97 * 259 * (R4 - R2) / (R3 - R1)) / 100) + 8
+ *
+ * NOTE:  The basic formula is 259 * (R4-R2) / (R3-R1).  The 97/100 is
+ * an additional correction, which should be centered around 0 degrees
+ * Celsius (273 degrees Kelvin).  The 8 (3 percent of 273) compensates for
+ * centering the 97/100 correction around 0 degrees K.
+ *
+ * Add 273 to Kelvin value to find degrees Celsius, for comparing current
+ * temperature with factory-measured temperatures when calculating txpower
+ * settings.
+ */
 #define TEMPERATURE_CALIB_KELVIN_OFFSET 8
 #define TEMPERATURE_CALIB_A_VAL 259
 
+/* Limit range of calculated temperature to be between these Kelvin values */
 #define IWL_TX_POWER_TEMPERATURE_MIN  (263)
 #define IWL_TX_POWER_TEMPERATURE_MAX  (410)
 
@@ -667,6 +689,19 @@ enum {
(((t)  IWL_TX_POWER_TEMPERATURE_MIN) || \
 ((t)  IWL_TX_POWER_TEMPERATURE_MAX))
 
+/* END TEMPERATURE ***/
+
+/* START TXPOWER */
+
+enum {
+   CALIB_CH_GROUP_1 = 0,
+   CALIB_CH_GROUP_2 = 1,
+   CALIB_CH_GROUP_3 = 2,
+   CALIB_CH_GROUP_4 = 3,
+   CALIB_CH_GROUP_5 = 4,
+   CALIB_CH_GROUP_MAX
+};
+
 #define IWL_TX_POWER_MIMO_REGULATORY_COMPENSATION (6)
 
 #define IWL_TX_POWER_TARGET_POWER_MIN   (0)/* 0 dBm = 1 milliwatt 
*/
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


iwlwifi: move uCode API definitions to iwl-4965-commands.h

2008-01-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=14519a0b46085db68e610147098d03386c34801f
Commit: 14519a0b46085db68e610147098d03386c34801f
Parent: 2248d8d8bc9799baf7f0a08afee7cb3afcc20ed3
Author: Ben Cahill [EMAIL PROTECTED]
AuthorDate: Thu Nov 29 11:09:59 2007 +0800
Committer:  David S. Miller [EMAIL PROTECTED]
CommitDate: Mon Jan 28 15:05:26 2008 -0800

iwlwifi: move uCode API definitions to iwl-4965-commands.h

Move uCode API definitions to iwl-4965-commands.h

Signed-off-by: Ben Cahill [EMAIL PROTECTED]
Signed-off-by: Zhu Yi [EMAIL PROTECTED]
Signed-off-by: John W. Linville [EMAIL PROTECTED]
---
 drivers/net/wireless/iwlwifi/iwl-4965-commands.h |   39 ++
 drivers/net/wireless/iwlwifi/iwl-4965-hw.h   |   37 
 2 files changed, 39 insertions(+), 37 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl-4965-commands.h 
b/drivers/net/wireless/iwlwifi/iwl-4965-commands.h
index bd55709..49582b9 100644
--- a/drivers/net/wireless/iwlwifi/iwl-4965-commands.h
+++ b/drivers/net/wireless/iwlwifi/iwl-4965-commands.h
@@ -335,6 +335,21 @@ enum {
RXON_DEV_TYPE_SNIFFER = 6,
 };
 
+
+#define RXON_RX_CHAIN_DRIVER_FORCE_MSK __constant_cpu_to_le16(0x10)
+#define RXON_RX_CHAIN_VALID_MSK
__constant_cpu_to_le16(0x71)
+#define RXON_RX_CHAIN_VALID_POS(1)
+#define RXON_RX_CHAIN_FORCE_SEL_MSK__constant_cpu_to_le16(0x74)
+#define RXON_RX_CHAIN_FORCE_SEL_POS(4)
+#define RXON_RX_CHAIN_FORCE_MIMO_SEL_MSK   __constant_cpu_to_le16(0x77)
+#define RXON_RX_CHAIN_FORCE_MIMO_SEL_POS   (7)
+#define RXON_RX_CHAIN_CNT_MSK  __constant_cpu_to_le16(0x310)
+#define RXON_RX_CHAIN_CNT_POS  (10)
+#define RXON_RX_CHAIN_MIMO_CNT_MSK __constant_cpu_to_le16(0x312)
+#define RXON_RX_CHAIN_MIMO_CNT_POS (12)
+#define RXON_RX_CHAIN_MIMO_FORCE_MSK   __constant_cpu_to_le16(0x114)
+#define RXON_RX_CHAIN_MIMO_FORCE_POS   (14)
+
 /* rx_config flags */
 /* band  modulation selection */
 #define RXON_FLG_BAND_24G_MSK   __constant_cpu_to_le32(1  0)
@@ -358,6 +373,21 @@ enum {
 * (according to ON_AIR deassertion) */
 #define RXON_FLG_TSF2HOST_MSK   __constant_cpu_to_le32(1  15)
 
+
+/* HT flags */
+#define RXON_FLG_CTRL_CHANNEL_LOC_POS  (22)
+#define RXON_FLG_CTRL_CHANNEL_LOC_HI_MSK   __constant_cpu_to_le32(0x122)
+
+#define RXON_FLG_HT_OPERATING_MODE_POS (23)
+
+#define RXON_FLG_HT_PROT_MSK   __constant_cpu_to_le32(0x123)
+#define RXON_FLG_FAT_PROT_MSK  __constant_cpu_to_le32(0x223)
+
+#define RXON_FLG_CHANNEL_MODE_POS  (25)
+#define RXON_FLG_CHANNEL_MODE_MSK  __constant_cpu_to_le32(0x325)
+#define RXON_FLG_CHANNEL_MODE_PURE_40_MSK  __constant_cpu_to_le32(0x125)
+#define RXON_FLG_CHANNEL_MODE_MIXED_MSK
__constant_cpu_to_le32(0x225)
+
 /* rx_config filter flags */
 /* accept all data frames */
 #define RXON_FILTER_PROMISC_MSK __constant_cpu_to_le32(1  0)
@@ -431,6 +461,15 @@ struct iwl4965_tx_power {
 #define POWER_TABLE_NUM_ENTRIES33
 #define POWER_TABLE_NUM_HT_OFDM_ENTRIES32
 #define POWER_TABLE_CCK_ENTRY  32
+
+union iwl4965_tx_power_dual_stream {
+   struct {
+   u8 radio_tx_gain[2];
+   u8 dsp_predis_atten[2];
+   } s;
+   u32 dw;
+};
+
 struct tx_power_dual_stream {
__le32 dw;
 } __attribute__ ((packed));
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965-hw.h 
b/drivers/net/wireless/iwlwifi/iwl-4965-hw.h
index 02ea71e..962aef2 100644
--- a/drivers/net/wireless/iwlwifi/iwl-4965-hw.h
+++ b/drivers/net/wireless/iwlwifi/iwl-4965-hw.h
@@ -698,45 +698,8 @@ enum {
 #define CALIB_IWL_TX_ATTEN_GR5_FCH 1
 #define CALIB_IWL_TX_ATTEN_GR5_LCH 20
 
-union iwl4965_tx_power_dual_stream {
-   struct {
-   u8 radio_tx_gain[2];
-   u8 dsp_predis_atten[2];
-   } s;
-   u32 dw;
-};
-
 /* END TXPOWER */
 
-/* HT flags */
-#define RXON_FLG_CTRL_CHANNEL_LOC_POS  (22)
-#define RXON_FLG_CTRL_CHANNEL_LOC_HI_MSK   __constant_cpu_to_le32(0x122)
-
-#define RXON_FLG_HT_OPERATING_MODE_POS (23)
-
-#define RXON_FLG_HT_PROT_MSK   __constant_cpu_to_le32(0x123)
-#define RXON_FLG_FAT_PROT_MSK  __constant_cpu_to_le32(0x223)
-
-#define RXON_FLG_CHANNEL_MODE_POS  (25)
-#define RXON_FLG_CHANNEL_MODE_MSK  __constant_cpu_to_le32(0x325)
-#define RXON_FLG_CHANNEL_MODE_PURE_40_MSK  __constant_cpu_to_le32(0x125)
-#define RXON_FLG_CHANNEL_MODE_MIXED_MSK
__constant_cpu_to_le32(0x225)
-
-#define RXON_RX_CHAIN_DRIVER_FORCE_MSK __constant_cpu_to_le16(0x10)
-#define RXON_RX_CHAIN_VALID_MSK  

iwlwifi: add comments, mostly on Tx queues

2008-01-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=8b6eaea8ec79b111a18a1c60333deb16ba27e6b3
Commit: 8b6eaea8ec79b111a18a1c60333deb16ba27e6b3
Parent: 74093ddf4c42da74922b63fb6844989e21164d9e
Author: Cahill, Ben M [EMAIL PROTECTED]
AuthorDate: Thu Nov 29 11:09:54 2007 +0800
Committer:  David S. Miller [EMAIL PROTECTED]
CommitDate: Mon Jan 28 15:05:22 2008 -0800

iwlwifi: add comments, mostly on Tx queues

Add comments, mostly on Tx queues

Signed-off-by: Cahill, Ben M [EMAIL PROTECTED]
Signed-off-by: Zhu Yi [EMAIL PROTECTED]
Signed-off-by: John W. Linville [EMAIL PROTECTED]
---
 drivers/net/wireless/iwlwifi/iwl-4965.c |  252 +++
 drivers/net/wireless/iwlwifi/iwl4965-base.c |   18 ++-
 2 files changed, 231 insertions(+), 39 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.c 
b/drivers/net/wireless/iwlwifi/iwl-4965.c
index d44166a..40c795e 100644
--- a/drivers/net/wireless/iwlwifi/iwl-4965.c
+++ b/drivers/net/wireless/iwlwifi/iwl-4965.c
@@ -144,7 +144,7 @@ int iwl4965_hw_rxq_stop(struct iwl4965_priv *priv)
return rc;
}
 
-   /* stop HW */
+   /* stop Rx DMA */
iwl4965_write_direct32(priv, FH_MEM_RCSR_CHNL0_CONFIG_REG, 0);
rc = iwl4965_poll_direct_bit(priv, FH_MEM_RSSR_RX_STATUS_REG,
 (1  24), 1000);
@@ -234,17 +234,22 @@ static int iwl4965_rx_init(struct iwl4965_priv *priv, 
struct iwl4965_rx_queue *r
return rc;
}
 
-   /* stop HW */
+   /* Stop Rx DMA */
iwl4965_write_direct32(priv, FH_MEM_RCSR_CHNL0_CONFIG_REG, 0);
 
+   /* Reset driver's Rx queue write index */
iwl4965_write_direct32(priv, FH_RSCSR_CHNL0_RBDCB_WPTR_REG, 0);
+
+   /* Tell device where to find RBD circular buffer in DRAM */
iwl4965_write_direct32(priv, FH_RSCSR_CHNL0_RBDCB_BASE_REG,
 rxq-dma_addr  8);
 
+   /* Tell device where in DRAM to update its Rx status */
iwl4965_write_direct32(priv, FH_RSCSR_CHNL0_STTS_WPTR_REG,
 (priv-hw_setting.shared_phys +
  offsetof(struct iwl4965_shared, val0))  4);
 
+   /* Enable Rx DMA, enable host interrupt, Rx buffer size 4k, 256 RBDs */
iwl4965_write_direct32(priv, FH_MEM_RCSR_CHNL0_CONFIG_REG,
 FH_RCSR_RX_CONFIG_CHNL_EN_ENABLE_VAL |
 FH_RCSR_CHNL0_RX_CONFIG_IRQ_DEST_INT_HOST_VAL |
@@ -263,6 +268,7 @@ static int iwl4965_rx_init(struct iwl4965_priv *priv, 
struct iwl4965_rx_queue *r
return 0;
 }
 
+/* Tell 4965 where to find the keep warm buffer */
 static int iwl4965_kw_init(struct iwl4965_priv *priv)
 {
unsigned long flags;
@@ -297,6 +303,11 @@ static int iwl4965_kw_alloc(struct iwl4965_priv *priv)
 #define CHECK_AND_PRINT(x) ((eeprom_ch-flags  EEPROM_CHANNEL_##x) \
? # x   : )
 
+/**
+ * iwl4965_set_fat_chan_info - Copy fat channel info into driver's priv.
+ *
+ * Does not set up a command, or touch hardware.
+ */
 int iwl4965_set_fat_chan_info(struct iwl4965_priv *priv, int phymode, u16 
channel,
  const struct iwl4965_eeprom_channel *eeprom_ch,
  u8 fat_extension_channel)
@@ -337,6 +348,9 @@ int iwl4965_set_fat_chan_info(struct iwl4965_priv *priv, 
int phymode, u16 channe
return 0;
 }
 
+/**
+ * iwl4965_kw_free - Free the keep warm buffer
+ */
 static void iwl4965_kw_free(struct iwl4965_priv *priv)
 {
struct pci_dev *dev = priv-pci_dev;
@@ -363,9 +377,10 @@ static int iwl4965_txq_ctx_reset(struct iwl4965_priv *priv)
 
iwl4965_kw_free(priv);
 
+   /* Free all tx/cmd queues and keep-warm buffer */
iwl4965_hw_txq_ctx_free(priv);
 
-   /* Tx CMD queue */
+   /* Alloc keep-warm buffer */
rc = iwl4965_kw_alloc(priv);
if (rc) {
IWL_ERROR(Keep Warm allocation failed);
@@ -381,17 +396,20 @@ static int iwl4965_txq_ctx_reset(struct iwl4965_priv 
*priv)
goto error_reset;
}
 
+   /* Turn off all Tx DMA channels */
iwl4965_write_prph(priv, KDR_SCD_TXFACT, 0);
iwl4965_release_nic_access(priv);
spin_unlock_irqrestore(priv-lock, flags);
 
+   /* Tell 4965 where to find the keep-warm buffer */
rc = iwl4965_kw_init(priv);
if (rc) {
IWL_ERROR(kw_init failed\n);
goto error_reset;
}
 
-   /* Tx queue(s) */
+   /* Alloc and init all (default 16) Tx queues,
+* including the command queue (#4) */
for (txq_id = 0; txq_id  priv-hw_setting.max_txq_num; txq_id++) {
slots_num = (txq_id == IWL_CMD_QUEUE_NUM) ?
TFD_CMD_SLOTS : TFD_TX_CMD_SLOTS;
@@ -545,6 +563,8 @@ int iwl4965_hw_nic_init(struct iwl4965_priv *priv)

iwlwifi: Document Rx calibration

2008-01-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=f7d09d7c453f197d802c50172b27170a43e1a816
Commit: f7d09d7c453f197d802c50172b27170a43e1a816
Parent: abceddb40728397fcfd0b295d7530920a606ab88
Author: Ben Cahill [EMAIL PROTECTED]
AuthorDate: Thu Nov 29 11:09:51 2007 +0800
Committer:  David S. Miller [EMAIL PROTECTED]
CommitDate: Mon Jan 28 15:05:20 2008 -0800

iwlwifi: Document Rx calibration

Document Rx calibration

Signed-off-by: Ben Cahill [EMAIL PROTECTED]
Signed-off-by: Zhu Yi [EMAIL PROTECTED]
Signed-off-by: John W. Linville [EMAIL PROTECTED]
---
 drivers/net/wireless/iwlwifi/iwl-4965-commands.h |  267 +-
 drivers/net/wireless/iwlwifi/iwl-4965.c  |1 +
 drivers/net/wireless/iwlwifi/iwl-4965.h  |   18 --
 3 files changed, 261 insertions(+), 25 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl-4965-commands.h 
b/drivers/net/wireless/iwlwifi/iwl-4965-commands.h
index 00d4ab7..575a065 100644
--- a/drivers/net/wireless/iwlwifi/iwl-4965-commands.h
+++ b/drivers/net/wireless/iwlwifi/iwl-4965-commands.h
@@ -1573,25 +1573,278 @@ struct iwl4965_missed_beacon_notif {
__le32 num_recvd_beacons;
 } __attribute__ ((packed));
 
+
 /**
  * (11)
  * Rx Calibration Commands:
  *
+ * With the uCode used for open source drivers, most Tx calibration (except
+ * for Tx Power) and most Rx calibration is done by uCode during the
+ * initialize phase of uCode boot.  Driver must calibrate only:
+ *
+ * 1)  Tx power (depends on temperature), described elsewhere
+ * 2)  Receiver gain balance (optimize MIMO, and detect disconnected antennas)
+ * 3)  Receiver sensitivity (to optimize signal detection)
+ *
  */
 
-#define PHY_CALIBRATE_DIFF_GAIN_CMD (7)
-#define HD_TABLE_SIZE  (11)
+/**
+ * SENSITIVITY_CMD = 0xa8 (command, has simple generic response)
+ *
+ * This command sets up the Rx signal detector for a sensitivity level that
+ * is high enough to lock onto all signals within the associated network,
+ * but low enough to ignore signals that are below a certain threshold, so as
+ * not to have too many false alarms.  False alarms are signals that the
+ * Rx DSP tries to lock onto, but then discards after determining that they
+ * are noise.
+ *
+ * The optimum number of false alarms is between 5 and 50 per 200 TUs
+ * (200 * 1024 uSecs, i.e. 204.8 milliseconds) of actual Rx time (i.e.
+ * time listening, not transmitting).  Driver must adjust sensitivity so that
+ * the ratio of actual false alarms to actual Rx time falls within this range.
+ *
+ * While associated, uCode delivers STATISTICS_NOTIFICATIONs after each
+ * received beacon.  These provide information to the driver to analyze the
+ * sensitivity.  Don't analyze statistics that come in from scanning, or any
+ * other non-associated-network source.  Pertinent statistics include:
+ *
+ * From general statistics (struct statistics_rx_non_phy):
+ *
+ * (beacon_energy_[abc]  0x0FF00)  8 (unsigned, higher value is lower level)
+ *   Measure of energy of desired signal.  Used for establishing a level
+ *   below which the device does not detect signals.
+ *
+ * (beacon_silence_rssi_[abc]  0x0FF00)  8 (unsigned, units in dB)
+ *   Measure of background noise in silent period after beacon.
+ *
+ * channel_load
+ *   uSecs of actual Rx time during beacon period (varies according to
+ *   how much time was spent transmitting).
+ *
+ * From cck and ofdm statistics (struct statistics_rx_phy), separately:
+ *
+ * false_alarm_cnt
+ *   Signal locks abandoned early (before phy-level header).
+ *
+ * plcp_err
+ *   Signal locks abandoned late (during phy-level header).
+ *
+ * NOTE:  Both false_alarm_cnt and plcp_err increment monotonically from
+ *beacon to beacon, i.e. each value is an accumulation of all errors
+ *before and including the latest beacon.  Values will wrap around to 0
+ *after counting up to 2^32 - 1.  Driver must differentiate vs.
+ *previous beacon's values to determine # false alarms in the current
+ *beacon period.
+ *
+ * Total number of false alarms = false_alarms + plcp_errs
+ *
+ * For OFDM, adjust the following table entries in struct iwl_sensitivity_cmd
+ * (notice that the start points for OFDM are at or close to settings for
+ * maximum sensitivity):
+ *
+ * START  /  MIN  /  MAX
+ *   HD_AUTO_CORR32_X1_TH_ADD_MIN_INDEX  90   /   85  /  120
+ *   HD_AUTO_CORR32_X1_TH_ADD_MIN_MRC_INDEX 170   /  170  /  210
+ *   HD_AUTO_CORR32_X4_TH_ADD_MIN_INDEX 105   /  105  /  140
+ *   HD_AUTO_CORR32_X4_TH_ADD_MIN_MRC_INDEX 220   /  220  /  270
+ *
+ *   If actual rate of OFDM false alarms (+ plcp_errors) is too high
+ *   (greater than 50 for each 204.8 msecs listening), 

iwl-4965-hw.h: clean up unused eeprom structures and definitions

2008-01-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=40ac81a35c3a19f6a78f0a9f58368d36048df35b
Commit: 40ac81a35c3a19f6a78f0a9f58368d36048df35b
Parent: 796083cb1d45d52d40ae2c933afcfc56d91ef427
Author: Ben Cahill [EMAIL PROTECTED]
AuthorDate: Thu Nov 29 11:09:46 2007 +0800
Committer:  David S. Miller [EMAIL PROTECTED]
CommitDate: Mon Jan 28 15:05:16 2008 -0800

iwl-4965-hw.h: clean up unused eeprom structures and definitions

Clean up unused eeprom structures and definitions in iwl-4965-hw.h.

Signed-off-by: Ben Cahill [EMAIL PROTECTED]
Signed-off-by: Zhu Yi [EMAIL PROTECTED]
Signed-off-by: John W. Linville [EMAIL PROTECTED]
---
 drivers/net/wireless/iwlwifi/iwl-4965-hw.h |   58 +---
 1 files changed, 1 insertions(+), 57 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl-4965-hw.h 
b/drivers/net/wireless/iwlwifi/iwl-4965-hw.h
index 4741fa2..a71c32a 100644
--- a/drivers/net/wireless/iwlwifi/iwl-4965-hw.h
+++ b/drivers/net/wireless/iwlwifi/iwl-4965-hw.h
@@ -169,57 +169,6 @@ struct iwl4965_eeprom_channel {
s8 max_power_avg;   /* max power (dBm) on this chnl, limit 31 */
 } __attribute__ ((packed));
 
-/*
- * Mapping of a Tx power level, at factory calibration temperature,
- *   to a radio/DSP gain table index.
- * One for each of 5 sample power levels in each band.
- * v_det is measured at the factory, using the 3945's built-in power amplifier
- *   (PA) output voltage detector.  This same detector is used during Tx of
- *   long packets in normal operation to provide feedback as to proper output
- *   level.
- * Data copied from EEPROM.
- */
-struct iwl4965_eeprom_txpower_sample {
-   u8 gain_index;  /* index into power (gain) setup table ... */
-   s8 power;   /* ... for this pwr level for this chnl group */
-   u16 v_det;  /* PA output voltage */
-} __attribute__ ((packed));
-
-/*
- * Mappings of Tx power levels - nominal radio/DSP gain table indexes.
- * One for each channel group (a.k.a. band) (1 for BG, 4 for A).
- * Tx power setup code interpolates between the 5 sample power levels
- *to determine the nominal setup for a requested power level.
- * Data copied from EEPROM.
- * DO NOT ALTER THIS STRUCTURE!!!
- */
-struct iwl4965_eeprom_txpower_group {
-   struct iwl4965_eeprom_txpower_sample samples[5];/* 5 power 
levels */
-   s32 a, b, c, d, e;  /* coefficients for voltage-power
-* formula (signed) */
-   s32 Fa, Fb, Fc, Fd, Fe; /* these modify coeffs based on
-* frequency (signed) */
-   s8 saturation_power;/* highest power possible by h/w in this
-* band */
-   u8 group_channel;   /* representative channel # in this band */
-   s16 temperature;/* h/w temperature at factory calib this band
-* (signed) */
-} __attribute__ ((packed));
-
-/*
- * Temperature-based Tx-power compensation data, not band-specific.
- * These coefficients are use to modify a/b/c/d/e coeffs based on
- *   difference between current temperature and factory calib temperature.
- * Data copied from EEPROM.
- */
-struct iwl4965_eeprom_temperature_corr {
-   u32 Ta;
-   u32 Tb;
-   u32 Tc;
-   u32 Td;
-   u32 Te;
-} __attribute__ ((packed));
-
 /* 4965 has two radio transmitters (and 3 radio receivers) */
 #define EEPROM_TX_POWER_TX_CHAINS  (2)
 
@@ -230,8 +179,6 @@ struct iwl4965_eeprom_temperature_corr {
  * each of 3 target output levels */
 #define EEPROM_TX_POWER_MEASUREMENTS   (3)
 
-#define EEPROM_TX_POWER_VERSION(2)
-
 /* 4965 driver does not work with txpower calibration version  5.
  * Look for this in calib_version member of struct iwl4965_eeprom. */
 #define EEPROM_TX_POWER_VERSION_NEW(5)
@@ -461,10 +408,7 @@ struct iwl4965_eeprom {
 #define EEPROM_CALIB_VERSION_OFFSET(2*0xB6)/* 2 bytes */
u16 calib_version;  /* abs.ofs: 364 */
u8 reserved13[2];
-
-#define EEPROM_SATURATION_POWER_OFFSET (2*0xB8)/* 2 bytes */
-   u16 satruation_power;   /* abs.ofs: 368 */
-   u8 reserved14[94];
+   u8 reserved14[96];  /* abs.ofs: 368 */
 
 /*
  * 4965 Txpower calibration data.
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


mac80211: allow easier multicast/broadcast buffering in hardware

2008-01-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=7d54d0ddd66678ada6635159dac1eb82ccbe34b5
Commit: 7d54d0ddd66678ada6635159dac1eb82ccbe34b5
Parent: 4e20cb293cc0b30f32a53011fd6b38493d9fdcaa
Author: Johannes Berg [EMAIL PROTECTED]
AuthorDate: Wed Dec 19 01:31:25 2007 +0100
Committer:  David S. Miller [EMAIL PROTECTED]
CommitDate: Mon Jan 28 14:59:47 2008 -0800

mac80211: allow easier multicast/broadcast buffering in hardware

There are various decisions influencing the decision whether to buffer
a frame for after the next DTIM beacon. The do we have stations in PS
mode condition cannot be tested by the driver so mac80211 has to do
that. To ease driver writing for hardware that can buffer frames until
after the next DTIM beacon, introduce a new txctl flag telling the
driver to buffer a specific frame.

While at it, restructure and comment the code for multicast buffering
and remove spurious inline directives.

Signed-off-by: Johannes Berg [EMAIL PROTECTED]
Cc: Michael Buesch [EMAIL PROTECTED]
Signed-off-by: John W. Linville [EMAIL PROTECTED]
Signed-off-by: David S. Miller [EMAIL PROTECTED]
---
 include/net/mac80211.h |2 ++
 net/mac80211/tx.c  |   32 +++-
 2 files changed, 25 insertions(+), 9 deletions(-)

diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 2606ca2..5b9e7a2 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -308,6 +308,8 @@ struct ieee80211_tx_control {
  * set_retry_limit configured
  * long retry value */
 #define IEEE80211_TXCTL_EAPOL_FRAME(111) /* internal to mac80211 */
+#define IEEE80211_TXCTL_SEND_AFTER_DTIM(112) /* send this frame 
after DTIM
+* beacon */
u32 flags; /* tx control flags defined
* above */
u8 key_idx; /* keyidx from hw-set_key(), undefined if
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index e177a8d..f7aff2e 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -322,16 +322,27 @@ static void purge_old_ps_buffers(struct ieee80211_local 
*local)
   wiphy_name(local-hw.wiphy), purged);
 }
 
-static inline ieee80211_txrx_result
+static ieee80211_txrx_result
 ieee80211_tx_h_multicast_ps_buf(struct ieee80211_txrx_data *tx)
 {
-   /* broadcast/multicast frame */
-   /* If any of the associated stations is in power save mode,
-* the frame is buffered to be sent after DTIM beacon frame */
-   if ((tx-local-hw.flags  IEEE80211_HW_HOST_BROADCAST_PS_BUFFERING) 
-   tx-sdata-type != IEEE80211_IF_TYPE_WDS 
-   tx-sdata-bss  atomic_read(tx-sdata-bss-num_sta_ps) 
-   !(tx-fc  IEEE80211_FCTL_ORDER)) {
+   /*
+* broadcast/multicast frame
+*
+* If any of the associated stations is in power save mode,
+* the frame is buffered to be sent after DTIM beacon frame.
+* This is done either by the hardware or us.
+*/
+
+   /* not AP/IBSS or ordered frame */
+   if (!tx-sdata-bss || (tx-fc  IEEE80211_FCTL_ORDER))
+   return TXRX_CONTINUE;
+
+   /* no stations in PS mode */
+   if (!atomic_read(tx-sdata-bss-num_sta_ps))
+   return TXRX_CONTINUE;
+
+   /* buffered in mac80211 */
+   if (tx-local-hw.flags  IEEE80211_HW_HOST_BROADCAST_PS_BUFFERING) {
if (tx-local-total_ps_buffered = TOTAL_MAX_TX_BUFFER)
purge_old_ps_buffers(tx-local);
if (skb_queue_len(tx-sdata-bss-ps_bc_buf) =
@@ -348,10 +359,13 @@ ieee80211_tx_h_multicast_ps_buf(struct 
ieee80211_txrx_data *tx)
return TXRX_QUEUED;
}
 
+   /* buffered in hardware */
+   tx-u.tx.control-flags |= IEEE80211_TXCTL_SEND_AFTER_DTIM;
+
return TXRX_CONTINUE;
 }
 
-static inline ieee80211_txrx_result
+static ieee80211_txrx_result
 ieee80211_tx_h_unicast_ps_buf(struct ieee80211_txrx_data *tx)
 {
struct sta_info *sta = tx-sta;
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[NETFILTER] xt_policy.c: kill some bloat

2008-01-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b9aed45507b657abab0b88da2c9b509a9dc462b1
Commit: b9aed45507b657abab0b88da2c9b509a9dc462b1
Parent: c95aaf9af5a1f6dee56d1f2ab4915cd722d608da
Author: Ilpo Järvinen [EMAIL PROTECTED]
AuthorDate: Sat Jan 12 21:26:31 2008 -0800
Committer:  David S. Miller [EMAIL PROTECTED]
CommitDate: Mon Jan 28 15:01:57 2008 -0800

[NETFILTER] xt_policy.c: kill some bloat

net/netfilter/xt_policy.c:
  policy_mt | -906
 1 function changed, 906 bytes removed, diff: -906

net/netfilter/xt_policy.c:
  match_xfrm_state | +427
 1 function changed, 427 bytes added, diff: +427

net/netfilter/xt_policy.o:
 2 functions changed, 427 bytes added, 906 bytes removed, diff: -479

Alternatively, this could be done by combining identical
parts of the match_policy_in/out()

Signed-off-by: Ilpo Järvinen [EMAIL PROTECTED]
Signed-off-by: David S. Miller [EMAIL PROTECTED]
---
 net/netfilter/xt_policy.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/net/netfilter/xt_policy.c b/net/netfilter/xt_policy.c
index 46ee7e8..45731ca 100644
--- a/net/netfilter/xt_policy.c
+++ b/net/netfilter/xt_policy.c
@@ -33,7 +33,7 @@ xt_addr_cmp(const union xt_policy_addr *a1, const union 
xt_policy_addr *m,
return false;
 }
 
-static inline bool
+static bool
 match_xfrm_state(const struct xfrm_state *x, const struct xt_policy_elem *e,
 unsigned short family)
 {
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


rt2x00: Release rt2x00 2.0.13

2008-01-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=5a6012e105ae1664cd2841c33bf59fbdd8d4dbcc
Commit: 5a6012e105ae1664cd2841c33bf59fbdd8d4dbcc
Parent: b3a78b4e2a4ee7a06861e012d95acea513384001
Author: Ivo van Doorn [EMAIL PROTECTED]
AuthorDate: Tue Nov 27 21:52:13 2007 +0100
Committer:  David S. Miller [EMAIL PROTECTED]
CommitDate: Mon Jan 28 15:05:11 2008 -0800

rt2x00: Release rt2x00 2.0.13

Signed-off-by: Ivo van Doorn [EMAIL PROTECTED]
Signed-off-by: John W. Linville [EMAIL PROTECTED]
---
 drivers/net/wireless/rt2x00/rt2x00.h |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/wireless/rt2x00/rt2x00.h 
b/drivers/net/wireless/rt2x00/rt2x00.h
index 218068b..85cfdab 100644
--- a/drivers/net/wireless/rt2x00/rt2x00.h
+++ b/drivers/net/wireless/rt2x00/rt2x00.h
@@ -43,7 +43,7 @@
 /*
  * Module information.
  */
-#define DRV_VERSION2.0.12
+#define DRV_VERSION2.0.13
 #define DRV_PROJECThttp://rt2x00.serialmonkey.com;
 
 /*
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


rt2x00: Move register value/offset files into new folder

2008-01-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=91921a4e9b033b1bf6ab65be7f9b74b60290f41c
Commit: 91921a4e9b033b1bf6ab65be7f9b74b60290f41c
Parent: 49da2605e27935835861a118df0671b5f004bfac
Author: Ivo van Doorn [EMAIL PROTECTED]
AuthorDate: Tue Nov 27 21:48:16 2007 +0100
Committer:  David S. Miller [EMAIL PROTECTED]
CommitDate: Mon Jan 28 15:05:06 2008 -0800

rt2x00: Move register value/offset files into new folder

Cleanup debugfs interface by moving the csr/bbp/rf/eeprom value/offset
entries into the register folder.

Signed-off-by: Ivo van Doorn [EMAIL PROTECTED]
Signed-off-by: John W. Linville [EMAIL PROTECTED]
---
 drivers/net/wireless/rt2x00/rt2x00debug.c |   42 +---
 1 files changed, 25 insertions(+), 17 deletions(-)

diff --git a/drivers/net/wireless/rt2x00/rt2x00debug.c 
b/drivers/net/wireless/rt2x00/rt2x00debug.c
index 6dc9a25..92efc5a 100644
--- a/drivers/net/wireless/rt2x00/rt2x00debug.c
+++ b/drivers/net/wireless/rt2x00/rt2x00debug.c
@@ -50,18 +50,20 @@ struct rt2x00debug_intf {
/*
 * Debugfs entries for:
 * - driver folder
-* - driver file
-* - chipset file
-* - device flags file
-* - register offset/value files
-* - eeprom offset/value files
-* - bbp offset/value files
-* - rf offset/value files
+*   - driver file
+*   - chipset file
+*   - device flags file
+*   - register folder
+* - csr offset/value files
+* - eeprom offset/value files
+* - bbp offset/value files
+* - rf offset/value files
 */
struct dentry *driver_folder;
struct dentry *driver_entry;
struct dentry *chipset_entry;
struct dentry *dev_flags;
+   struct dentry *register_folder;
struct dentry *csr_off_entry;
struct dentry *csr_val_entry;
struct dentry *eeprom_off_entry;
@@ -115,7 +117,7 @@ static ssize_t rt2x00debug_read_##__name(struct file *file, 
\
 size_t length, \
 loff_t *offset)\
 {  \
-   struct rt2x00debug_intf *intf = file-private_data; \
+   struct rt2x00debug_intf *intf = file-private_data; \
const struct rt2x00debug *debug = intf-debug;  \
char line[16];  \
size_t size;\
@@ -145,7 +147,7 @@ static ssize_t rt2x00debug_write_##__name(struct file 
*file,\
  size_t length,\
  loff_t *offset)   \
 {  \
-   struct rt2x00debug_intf *intf = file-private_data; \
+   struct rt2x00debug_intf *intf = file-private_data; \
const struct rt2x00debug *debug = intf-debug;  \
char line[16];  \
size_t size;\
@@ -301,12 +303,17 @@ void rt2x00debug_register(struct rt2x00_dev *rt2x00dev)
if (IS_ERR(intf-dev_flags))
goto exit;
 
-#define RT2X00DEBUGFS_CREATE_ENTRY(__intf, __name) \
+   intf-register_folder =
+   debugfs_create_dir(register, intf-driver_folder);
+   if (IS_ERR(intf-register_folder))
+   goto exit;
+
+#define RT2X00DEBUGFS_CREATE_REGISTER_ENTRY(__intf, __name)\
 ({ \
(__intf)-__name##_off_entry =  \
debugfs_create_u32(__stringify(__name) _offset,   \
   S_IRUGO | S_IWUSR,   \
-  (__intf)-driver_folder, \
+  (__intf)-register_folder,   \
   (__intf)-offset_##__name); \
if (IS_ERR((__intf)-__name##_off_entry))   \
goto exit;  \
@@ -314,18 +321,18 @@ void rt2x00debug_register(struct rt2x00_dev *rt2x00dev)
(__intf)-__name##_val_entry =  \
debugfs_create_file(__stringify(__name) _value,   \
S_IRUGO | S_IWUSR,  \
-   (__intf)-driver_folder,\
+   (__intf)-register_folder,  \
(__intf), rt2x00debug_fop_##__name);\
if (IS_ERR((__intf)-__name##_val_entry))   \
goto exit;  \
 })
 
-   RT2X00DEBUGFS_CREATE_ENTRY(intf, csr);
-   RT2X00DEBUGFS_CREATE_ENTRY(intf, eeprom);
-   

libertas: less eventcause shifts

2008-01-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=0b3c07ff6467e6055ca3dd2239494ada96303274
Commit: 0b3c07ff6467e6055ca3dd2239494ada96303274
Parent: a7d0adae40d0effc1484261a66fb703eb7e840b5
Author: Holger Schurig [EMAIL PROTECTED]
AuthorDate: Wed Nov 28 09:15:11 2007 +0100
Committer:  David S. Miller [EMAIL PROTECTED]
CommitDate: Mon Jan 28 15:04:58 2008 -0800

libertas: less eventcause shifts

* only shift eventcause once

* convert mac events to decimal, as this is what the firmware
  manual uses in section 6.1, too

Signed-off-by: Holger Schurig [EMAIL PROTECTED]
Acked-by: Dan Williams [EMAIL PROTECTED]
Signed-off-by: John W. Linville [EMAIL PROTECTED]
---
 drivers/net/wireless/libertas/cmdresp.c |   11 +++---
 drivers/net/wireless/libertas/host.h|   52 ++-
 2 files changed, 35 insertions(+), 28 deletions(-)

diff --git a/drivers/net/wireless/libertas/cmdresp.c 
b/drivers/net/wireless/libertas/cmdresp.c
index 5165c91..90f1c49 100644
--- a/drivers/net/wireless/libertas/cmdresp.c
+++ b/drivers/net/wireless/libertas/cmdresp.c
@@ -916,12 +916,12 @@ int lbs_process_event(struct lbs_private *priv)
lbs_deb_enter(LBS_DEB_CMD);
 
spin_lock_irq(adapter-driver_lock);
-   eventcause = adapter-eventcause;
+   eventcause = adapter-eventcause  SBI_EVENT_CAUSE_SHIFT;
spin_unlock_irq(adapter-driver_lock);
 
-   lbs_deb_cmd(event cause 0x%x\n, eventcause);
+   lbs_deb_cmd(event cause %d\n, eventcause);
 
-   switch (eventcause  SBI_EVENT_CAUSE_SHIFT) {
+   switch (eventcause) {
case MACREG_INT_CODE_LINK_SENSED:
lbs_deb_cmd(EVENT: MACREG_INT_CODE_LINK_SENSED\n);
break;
@@ -936,7 +936,7 @@ int lbs_process_event(struct lbs_private *priv)
lbs_mac_event_disconnected(priv);
break;
 
-   case MACREG_INT_CODE_LINK_LOSE_NO_SCAN:
+   case MACREG_INT_CODE_LINK_LOST_NO_SCAN:
lbs_deb_cmd(EVENT: link lost\n);
lbs_mac_event_disconnected(priv);
break;
@@ -1030,8 +1030,7 @@ int lbs_process_event(struct lbs_private *priv)
break;
 
default:
-   lbs_pr_alert(EVENT: unknown event id 0x%04x\n,
-  eventcause  SBI_EVENT_CAUSE_SHIFT);
+   lbs_pr_alert(EVENT: unknown event id %d\n, eventcause);
break;
}
 
diff --git a/drivers/net/wireless/libertas/host.h 
b/drivers/net/wireless/libertas/host.h
index 6b8932a..4828bbf 100644
--- a/drivers/net/wireless/libertas/host.h
+++ b/drivers/net/wireless/libertas/host.h
@@ -274,27 +274,35 @@ enum cmd_mesh_access_opts {
 };
 
 /** Card Event definition */
-#define MACREG_INT_CODE_TX_PPA_FREE 0x
-#define MACREG_INT_CODE_TX_DMA_DONE 0x0001
-#define MACREG_INT_CODE_LINK_LOSE_W_SCAN0x0002
-#define MACREG_INT_CODE_LINK_LOSE_NO_SCAN   0x0003
-#define MACREG_INT_CODE_LINK_SENSED 0x0004
-#define MACREG_INT_CODE_CMD_FINISHED0x0005
-#define MACREG_INT_CODE_MIB_CHANGED 0x0006
-#define MACREG_INT_CODE_INIT_DONE   0x0007
-#define MACREG_INT_CODE_DEAUTHENTICATED 0x0008
-#define MACREG_INT_CODE_DISASSOCIATED   0x0009
-#define MACREG_INT_CODE_PS_AWAKE0x000a
-#define MACREG_INT_CODE_PS_SLEEP0x000b
-#define MACREG_INT_CODE_MIC_ERR_MULTICAST   0x000d
-#define MACREG_INT_CODE_MIC_ERR_UNICAST 0x000e
-#define MACREG_INT_CODE_WM_AWAKE0x000f
-#define MACREG_INT_CODE_ADHOC_BCN_LOST  0x0011
-#define MACREG_INT_CODE_RSSI_LOW   0x0019
-#define MACREG_INT_CODE_SNR_LOW0x001a
-#define MACREG_INT_CODE_MAX_FAIL   0x001b
-#define MACREG_INT_CODE_RSSI_HIGH  0x001c
-#define MACREG_INT_CODE_SNR_HIGH   0x001d
-#define MACREG_INT_CODE_MESH_AUTO_STARTED  0x0023
+#define MACREG_INT_CODE_TX_PPA_FREE 0
+#define MACREG_INT_CODE_TX_DMA_DONE 1
+#define MACREG_INT_CODE_LINK_LOST_W_SCAN2
+#define MACREG_INT_CODE_LINK_LOST_NO_SCAN   3
+#define MACREG_INT_CODE_LINK_SENSED 4
+#define MACREG_INT_CODE_CMD_FINISHED5
+#define MACREG_INT_CODE_MIB_CHANGED 6
+#define MACREG_INT_CODE_INIT_DONE   7
+#define MACREG_INT_CODE_DEAUTHENTICATED 8
+#define MACREG_INT_CODE_DISASSOCIATED   9
+#define MACREG_INT_CODE_PS_AWAKE10
+#define MACREG_INT_CODE_PS_SLEEP11
+#define MACREG_INT_CODE_MIC_ERR_MULTICAST   13
+#define MACREG_INT_CODE_MIC_ERR_UNICAST 14
+#define MACREG_INT_CODE_WM_AWAKE15
+#define MACREG_INT_CODE_DEEP_SLEEP_AWAKE16
+#define MACREG_INT_CODE_ADHOC_BCN_LOST  17
+#define 

libertas: mark module_init/exit functions as __init/__exit

2008-01-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=4fb910fd3ada36cd9fbf6e037b87f2a83fd740b7
Commit: 4fb910fd3ada36cd9fbf6e037b87f2a83fd740b7
Parent: 82209adcb157e5861f2105d1658f1f07f75d69f2
Author: Andres Salomon [EMAIL PROTECTED]
AuthorDate: Tue Nov 20 17:43:45 2007 -0500
Committer:  David S. Miller [EMAIL PROTECTED]
CommitDate: Mon Jan 28 15:04:50 2008 -0800

libertas: mark module_init/exit functions as __init/__exit

Signed-off-by: Andres Salomon [EMAIL PROTECTED]
Signed-off-by: Dan Williams [EMAIL PROTECTED]
Signed-off-by: John W. Linville [EMAIL PROTECTED]
---
 drivers/net/wireless/libertas/if_sdio.c |4 ++--
 drivers/net/wireless/libertas/if_usb.c  |4 ++--
 drivers/net/wireless/libertas/main.c|4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/net/wireless/libertas/if_sdio.c 
b/drivers/net/wireless/libertas/if_sdio.c
index 0c762ee..de4ad57 100644
--- a/drivers/net/wireless/libertas/if_sdio.c
+++ b/drivers/net/wireless/libertas/if_sdio.c
@@ -1052,7 +1052,7 @@ static struct sdio_driver if_sdio_driver = {
 /* Module functions*/
 /***/
 
-static int if_sdio_init_module(void)
+static int __init if_sdio_init_module(void)
 {
int ret = 0;
 
@@ -1068,7 +1068,7 @@ static int if_sdio_init_module(void)
return ret;
 }
 
-static void if_sdio_exit_module(void)
+static void __exit if_sdio_exit_module(void)
 {
lbs_deb_enter(LBS_DEB_SDIO);
 
diff --git a/drivers/net/wireless/libertas/if_usb.c 
b/drivers/net/wireless/libertas/if_usb.c
index 6d19d26..f7d2b46 100644
--- a/drivers/net/wireless/libertas/if_usb.c
+++ b/drivers/net/wireless/libertas/if_usb.c
@@ -1020,7 +1020,7 @@ static struct usb_driver if_usb_driver = {
.resume = if_usb_resume,
 };
 
-static int if_usb_init_module(void)
+static int __init if_usb_init_module(void)
 {
int ret = 0;
 
@@ -1032,7 +1032,7 @@ static int if_usb_init_module(void)
return ret;
 }
 
-static void if_usb_exit_module(void)
+static void __exit if_usb_exit_module(void)
 {
struct usb_card_rec *cardp, *cardp_temp;
 
diff --git a/drivers/net/wireless/libertas/main.c 
b/drivers/net/wireless/libertas/main.c
index 825970a..f0da18c 100644
--- a/drivers/net/wireless/libertas/main.c
+++ b/drivers/net/wireless/libertas/main.c
@@ -1510,7 +1510,7 @@ int lbs_reset_device(lbs_private *priv)
 }
 EXPORT_SYMBOL_GPL(lbs_reset_device);
 
-static int lbs_init_module(void)
+static int __init lbs_init_module(void)
 {
lbs_deb_enter(LBS_DEB_MAIN);
lbs_debugfs_init();
@@ -1518,7 +1518,7 @@ static int lbs_init_module(void)
return 0;
 }
 
-static void lbs_exit_module(void)
+static void __exit lbs_exit_module(void)
 {
lbs_deb_enter(LBS_DEB_MAIN);
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


zd1211rw: Add ID for Trendnet TEW-429UB A

2008-01-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=269fca0eddfa37d10c4493ac402be11e866e43fd
Commit: 269fca0eddfa37d10c4493ac402be11e866e43fd
Parent: 459c51ad6e1fc19e91a53798358433d3c08cd09d
Author: Daniel Drake [EMAIL PROTECTED]
AuthorDate: Mon Nov 19 15:29:24 2007 +
Committer:  David S. Miller [EMAIL PROTECTED]
CommitDate: Mon Jan 28 15:04:48 2008 -0800

zd1211rw: Add ID for Trendnet TEW-429UB A

Tested by chloubs on IRC
zd1211 chip 157e:300a v4810 high 00-11-e0 AL7230B_RF pa0 g

Signed-off-by: Daniel Drake [EMAIL PROTECTED]
Signed-off-by: John W. Linville [EMAIL PROTECTED]
---
 drivers/net/wireless/zd1211rw/zd_usb.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/net/wireless/zd1211rw/zd_usb.c 
b/drivers/net/wireless/zd1211rw/zd_usb.c
index 3429576..6fbc4ad 100644
--- a/drivers/net/wireless/zd1211rw/zd_usb.c
+++ b/drivers/net/wireless/zd1211rw/zd_usb.c
@@ -53,6 +53,7 @@ static struct usb_device_id usb_ids[] = {
{ USB_DEVICE(0x13b1, 0x001e), .driver_info = DEVICE_ZD1211 },
{ USB_DEVICE(0x0586, 0x3407), .driver_info = DEVICE_ZD1211 },
{ USB_DEVICE(0x129b, 0x1666), .driver_info = DEVICE_ZD1211 },
+   { USB_DEVICE(0x157e, 0x300a), .driver_info = DEVICE_ZD1211 },
/* ZD1211B */
{ USB_DEVICE(0x0ace, 0x1215), .driver_info = DEVICE_ZD1211B },
{ USB_DEVICE(0x157e, 0x300d), .driver_info = DEVICE_ZD1211B },
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


iwlwifi: remove redundant initialization of final_mode

2008-01-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=9a62f73b1a3bbd35a6f84fcd6636e672b09981ec
Commit: 9a62f73b1a3bbd35a6f84fcd6636e672b09981ec
Parent: d3c319f9c8d9ee2c042c60b8a1bbd909dcc42782
Author: John W. Linville [EMAIL PROTECTED]
AuthorDate: Thu Nov 15 16:27:36 2007 -0500
Committer:  David S. Miller [EMAIL PROTECTED]
CommitDate: Mon Jan 28 15:04:45 2008 -0800

iwlwifi: remove redundant initialization of final_mode

Problem identified by Miguel Botón [EMAIL PROTECTED], alternate
solution suggested by Zhu Yi [EMAIL PROTECTED], patch by me. :-)

Cc: Miguel Botón [EMAIL PROTECTED]
Cc: Zhu Yi [EMAIL PROTECTED]
Signed-off-by: John W. Linville [EMAIL PROTECTED]
---
 drivers/net/wireless/iwlwifi/iwl3945-base.c |2 +-
 drivers/net/wireless/iwlwifi/iwl4965-base.c |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c 
b/drivers/net/wireless/iwlwifi/iwl3945-base.c
index e14e133..76186f8 100644
--- a/drivers/net/wireless/iwlwifi/iwl3945-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c
@@ -2139,7 +2139,7 @@ static int iwl3945_update_power_cmd(struct iwl3945_priv 
*priv,
 
 static int iwl3945_send_power_mode(struct iwl3945_priv *priv, u32 mode)
 {
-   u32 final_mode = mode;
+   u32 uninitialized_var(final_mode);
int rc;
struct iwl3945_powertable_cmd cmd;
 
diff --git a/drivers/net/wireless/iwlwifi/iwl4965-base.c 
b/drivers/net/wireless/iwlwifi/iwl4965-base.c
index 24dc40f..0243393 100644
--- a/drivers/net/wireless/iwlwifi/iwl4965-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl4965-base.c
@@ -2218,7 +2218,7 @@ static int iwl4965_update_power_cmd(struct iwl4965_priv 
*priv,
 
 static int iwl4965_send_power_mode(struct iwl4965_priv *priv, u32 mode)
 {
-   u32 final_mode = mode;
+   u32 uninitialized_var(final_mode);
int rc;
struct iwl4965_powertable_cmd cmd;
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


rt2x00: Move duplicate code into rt2x00pci_txdone()

2008-01-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=3957ccb56e17ca839265ccb292c4c6850dcf5d32
Commit: 3957ccb56e17ca839265ccb292c4c6850dcf5d32
Parent: 797a54c68e0eb551c60e3dc843627f967919a951
Author: Ivo van Doorn [EMAIL PROTECTED]
AuthorDate: Mon Nov 12 15:02:40 2007 +0100
Committer:  David S. Miller [EMAIL PROTECTED]
CommitDate: Mon Jan 28 15:04:40 2008 -0800

rt2x00: Move duplicate code into rt2x00pci_txdone()

rt2400pci, rt2500pci and rt61 require different
txdone handling, but the code that pushes the frame
upstream and cleans up the entry is identical to
all of them.
This will create the function rt2x00pci_txdone()
to remove the duplicate code.

Signed-off-by: Ivo van Doorn [EMAIL PROTECTED]
Signed-off-by: John W. Linville [EMAIL PROTECTED]
---
 drivers/net/wireless/rt2x00/rt2400pci.c |   20 +-
 drivers/net/wireless/rt2x00/rt2500pci.c |   20 +-
 drivers/net/wireless/rt2x00/rt2x00pci.c |   33 ++-
 drivers/net/wireless/rt2x00/rt2x00pci.h |4 ++-
 drivers/net/wireless/rt2x00/rt61pci.c   |   19 +
 5 files changed, 38 insertions(+), 58 deletions(-)

diff --git a/drivers/net/wireless/rt2x00/rt2400pci.c 
b/drivers/net/wireless/rt2x00/rt2400pci.c
index d48b6ca..bdf3edc 100644
--- a/drivers/net/wireless/rt2x00/rt2400pci.c
+++ b/drivers/net/wireless/rt2x00/rt2400pci.c
@@ -1167,26 +1167,8 @@ static void rt2400pci_txdone(struct rt2x00_dev 
*rt2x00dev, const int queue)
tx_status = rt2x00_get_field32(word, TXD_W0_RESULT);
retry = rt2x00_get_field32(word, TXD_W0_RETRY_COUNT);
 
-   rt2x00lib_txdone(entry, tx_status, retry);
-
-   /*
-* Make this entry available for reuse.
-*/
-   entry-flags = 0;
-   rt2x00_set_field32(word, TXD_W0_VALID, 0);
-   rt2x00_desc_write(txd, 0, word);
-   rt2x00_ring_index_done_inc(ring);
+   rt2x00pci_txdone(rt2x00dev, entry, tx_status, retry);
}
-
-   /*
-* If the data ring was full before the txdone handler
-* we must make sure the packet queue in the mac80211 stack
-* is reenabled when the txdone handler has finished.
-*/
-   entry = ring-entry;
-   if (!rt2x00_ring_full(ring))
-   ieee80211_wake_queue(rt2x00dev-hw,
-entry-tx_status.control.queue);
 }
 
 static irqreturn_t rt2400pci_interrupt(int irq, void *dev_instance)
diff --git a/drivers/net/wireless/rt2x00/rt2500pci.c 
b/drivers/net/wireless/rt2x00/rt2500pci.c
index e6a0c37..b6bb964 100644
--- a/drivers/net/wireless/rt2x00/rt2500pci.c
+++ b/drivers/net/wireless/rt2x00/rt2500pci.c
@@ -1298,26 +1298,8 @@ static void rt2500pci_txdone(struct rt2x00_dev 
*rt2x00dev, const int queue)
tx_status = rt2x00_get_field32(word, TXD_W0_RESULT);
retry = rt2x00_get_field32(word, TXD_W0_RETRY_COUNT);
 
-   rt2x00lib_txdone(entry, tx_status, retry);
-
-   /*
-* Make this entry available for reuse.
-*/
-   entry-flags = 0;
-   rt2x00_set_field32(word, TXD_W0_VALID, 0);
-   rt2x00_desc_write(txd, 0, word);
-   rt2x00_ring_index_done_inc(ring);
+   rt2x00pci_txdone(rt2x00dev, entry, tx_status, retry);
}
-
-   /*
-* If the data ring was full before the txdone handler
-* we must make sure the packet queue in the mac80211 stack
-* is reenabled when the txdone handler has finished.
-*/
-   entry = ring-entry;
-   if (!rt2x00_ring_full(ring))
-   ieee80211_wake_queue(rt2x00dev-hw,
-entry-tx_status.control.queue);
 }
 
 static irqreturn_t rt2500pci_interrupt(int irq, void *dev_instance)
diff --git a/drivers/net/wireless/rt2x00/rt2x00pci.c 
b/drivers/net/wireless/rt2x00/rt2x00pci.c
index fa85771..55d0614 100644
--- a/drivers/net/wireless/rt2x00/rt2x00pci.c
+++ b/drivers/net/wireless/rt2x00/rt2x00pci.c
@@ -116,7 +116,7 @@ int rt2x00pci_write_tx_data(struct rt2x00_dev *rt2x00dev,
 EXPORT_SYMBOL_GPL(rt2x00pci_write_tx_data);
 
 /*
- * RX data handlers.
+ * TX/RX data handlers.
  */
 void rt2x00pci_rxdone(struct rt2x00_dev *rt2x00dev)
 {
@@ -177,6 +177,37 @@ void rt2x00pci_rxdone(struct rt2x00_dev *rt2x00dev)
 }
 EXPORT_SYMBOL_GPL(rt2x00pci_rxdone);
 
+void rt2x00pci_txdone(struct rt2x00_dev *rt2x00dev, struct data_entry *entry,
+ const int tx_status, const int retry)
+{
+   u32 word;
+
+   rt2x00lib_txdone(entry, tx_status, retry);
+
+   /*
+* Make this entry available for reuse.
+*/
+   entry-flags = 0;
+
+   rt2x00_desc_read(entry-priv, 0, word);
+   rt2x00_set_field32(word, TXD_ENTRY_OWNER_NIC, 0);
+   rt2x00_set_field32(word, 

  1   2   3   4   5   6   7   8   9   10   >