aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Schurig <hs4233@mail.mn-solutions.de>2009-10-22 09:30:59 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-10-27 16:49:58 -0400
commitfef0640e1e5d5f79c48d1de1f54ed285429b4a6c (patch)
treee14580411b287bd5db9d6b481b94a76c8cee20ca
parente93156e7c4c3e2be355cac27c58664e4385c58fd (diff)
libertas: remove some references to IW_MODE_abc
... in pursue to quaff the wide-spread references to WEXT constants. When setting SNMP_MIB_OID_BSS_TYPE, wext.c can directly calculate the value the firmware wants. Reading of SNMP_MIB_OID_BSS_TYPE doesn't happen anywhere, so no need to convert the firmware value into WEXT values anyway. Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/libertas/assoc.c3
-rw-r--r--drivers/net/wireless/libertas/cmd.c10
2 files changed, 4 insertions, 9 deletions
diff --git a/drivers/net/wireless/libertas/assoc.c b/drivers/net/wireless/libertas/assoc.c
index 4ce554ac900f..751067369ba8 100644
--- a/drivers/net/wireless/libertas/assoc.c
+++ b/drivers/net/wireless/libertas/assoc.c
@@ -1567,7 +1567,8 @@ static int assoc_helper_mode(struct lbs_private *priv,
1567 } 1567 }
1568 1568
1569 priv->mode = assoc_req->mode; 1569 priv->mode = assoc_req->mode;
1570 ret = lbs_set_snmp_mib(priv, SNMP_MIB_OID_BSS_TYPE, assoc_req->mode); 1570 ret = lbs_set_snmp_mib(priv, SNMP_MIB_OID_BSS_TYPE,
1571 assoc_req->mode == IW_MODE_ADHOC ? 2 : 1);
1571 1572
1572done: 1573done:
1573 lbs_deb_leave_args(LBS_DEB_ASSOC, "ret %d", ret); 1574 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 65fd50d31764..1065ce29cd08 100644
--- a/drivers/net/wireless/libertas/cmd.c
+++ b/drivers/net/wireless/libertas/cmd.c
@@ -390,7 +390,7 @@ int lbs_set_snmp_mib(struct lbs_private *priv, u32 oid, u16 val)
390 switch (oid) { 390 switch (oid) {
391 case SNMP_MIB_OID_BSS_TYPE: 391 case SNMP_MIB_OID_BSS_TYPE:
392 cmd.bufsize = cpu_to_le16(sizeof(u8)); 392 cmd.bufsize = cpu_to_le16(sizeof(u8));
393 cmd.value[0] = (val == IW_MODE_ADHOC) ? 2 : 1; 393 cmd.value[0] = val;
394 break; 394 break;
395 case SNMP_MIB_OID_11D_ENABLE: 395 case SNMP_MIB_OID_11D_ENABLE:
396 case SNMP_MIB_OID_FRAG_THRESHOLD: 396 case SNMP_MIB_OID_FRAG_THRESHOLD:
@@ -443,13 +443,7 @@ int lbs_get_snmp_mib(struct lbs_private *priv, u32 oid, u16 *out_val)
443 443
444 switch (le16_to_cpu(cmd.bufsize)) { 444 switch (le16_to_cpu(cmd.bufsize)) {
445 case sizeof(u8): 445 case sizeof(u8):
446 if (oid == SNMP_MIB_OID_BSS_TYPE) { 446 *out_val = cmd.value[0];
447 if (cmd.value[0] == 2)
448 *out_val = IW_MODE_ADHOC;
449 else
450 *out_val = IW_MODE_INFRA;
451 } else
452 *out_val = cmd.value[0];
453 break; 447 break;
454 case sizeof(u16): 448 case sizeof(u16):
455 *out_val = le16_to_cpu(*((__le16 *)(&cmd.value))); 449 *out_val = le16_to_cpu(*((__le16 *)(&cmd.value)));
n class="hl opt">) < entry_num, "vs-9010: entry number is too big %d (%d)", entry_num, I_ENTRY_COUNT(ih)); if (search_res == POSITION_FOUND || entry_num < I_ENTRY_COUNT(ih)) { /* go through all entries in the directory item beginning from the entry, that has been found */ struct reiserfs_de_head *deh = B_I_DEH(bh, ih) + entry_num; for (; entry_num < I_ENTRY_COUNT(ih); entry_num++, deh++) { int d_reclen; char *d_name; ino_t d_ino; if (!de_visible(deh)) /* it is hidden entry */ continue; d_reclen = entry_length(bh, ih, entry_num); d_name = B_I_DEH_ENTRY_FILE_NAME(bh, ih, deh); if (d_reclen <= 0 || d_name + d_reclen > bh->b_data + bh->b_size) { /* There is corrupted data in entry, * We'd better stop here */ pathrelse(&path_to_entry); ret = -EIO; goto out; } if (!d_name[d_reclen - 1]) d_reclen = strlen(d_name); if (d_reclen > REISERFS_MAX_NAME(inode->i_sb-> s_blocksize)) { /* too big to send back to VFS */ continue; } /* Ignore the .reiserfs_priv entry */ if (is_privroot_deh(inode, deh)) continue; ctx->pos = deh_offset(deh); d_ino = deh_objectid(deh); if (d_reclen <= 32) { local_buf = small_buf; } else { local_buf = kmalloc(d_reclen, GFP_NOFS); if (!local_buf) { pathrelse(&path_to_entry); ret = -ENOMEM; goto out; } if (item_moved(&tmp_ih, &path_to_entry)) { kfree(local_buf); goto research; } } // Note, that we copy name to user space via temporary // buffer (local_buf) because filldir will block if // user space buffer is swapped out. At that time // entry can move to somewhere else memcpy(local_buf, d_name, d_reclen); /* * Since filldir might sleep, we can release * the write lock here for other waiters */ depth = reiserfs_write_unlock_nested(inode->i_sb); if (!dir_emit (ctx, local_buf, d_reclen, d_ino, DT_UNKNOWN)) { reiserfs_write_lock_nested(inode->i_sb, depth); if (local_buf != small_buf) { kfree(local_buf); } goto end; } reiserfs_write_lock_nested(inode->i_sb, depth); if (local_buf != small_buf) { kfree(local_buf); } // next entry should be looked for with such offset next_pos = deh_offset(deh) + 1; if (item_moved(&tmp_ih, &path_to_entry)) { set_cpu_key_k_offset(&pos_key, next_pos); goto research; } } /* for */ } if (item_num != B_NR_ITEMS(bh) - 1) // end of directory has been reached goto end; /* item we went through is last item of node. Using right delimiting key check is it directory end */ rkey = get_rkey(&path_to_entry, inode->i_sb); if (!comp_le_keys(rkey, &MIN_KEY)) { /* set pos_key to key, that is the smallest and greater that key of the last entry in the item */ set_cpu_key_k_offset(&pos_key, next_pos); continue; } if (COMP_SHORT_KEYS(rkey, &pos_key)) { // end of directory has been reached goto end; } /* directory continues in the right neighboring block */ set_cpu_key_k_offset(&pos_key, le_key_k_offset(KEY_FORMAT_3_5, rkey)); } /* while */ end: ctx->pos = next_pos; pathrelse(&path_to_entry); reiserfs_check_path(&path_to_entry); out: reiserfs_write_unlock(inode->i_sb); return ret; } static int reiserfs_readdir(struct file *file, struct dir_context *ctx) { return reiserfs_readdir_inode(file_inode(file), ctx); } /* compose directory item containing "." and ".." entries (entries are not aligned to 4 byte boundary) */ /* the last four params are LE */ void make_empty_dir_item_v1(char *body, __le32 dirid, __le32 objid, __le32 par_dirid, __le32 par_objid) { struct reiserfs_de_head *deh; memset(body, 0, EMPTY_DIR_SIZE_V1); deh = (struct reiserfs_de_head *)body; /* direntry header of "." */ put_deh_offset(&(deh[0]), DOT_OFFSET); /* these two are from make_le_item_head, and are are LE */ deh[0].deh_dir_id = dirid; deh[0].deh_objectid = objid; deh[0].deh_state = 0; /* Endian safe if 0 */ put_deh_location(&(deh[0]), EMPTY_DIR_SIZE_V1 - strlen(".")); mark_de_visible(&(deh[0])); /* direntry header of ".." */ put_deh_offset(&(deh[1]), DOT_DOT_OFFSET); /* key of ".." for the root directory */ /* these two are from the inode, and are are LE */ deh[1].deh_dir_id = par_dirid; deh[1].deh_objectid = par_objid; deh[1].deh_state = 0; /* Endian safe if 0 */ put_deh_location(&(deh[1]), deh_location(&(deh[0])) - strlen("..")); mark_de_visible(&(deh[1])); /* copy ".." and "." */ memcpy(body + deh_location(&(deh[0])), ".", 1); memcpy(body + deh_location(&(deh[1])), "..", 2); } /* compose directory item containing "." and ".." entries */ void make_empty_dir_item(char *body, __le32 dirid, __le32 objid, __le32 par_dirid, __le32 par_objid) { struct reiserfs_de_head *deh; memset(body, 0, EMPTY_DIR_SIZE); deh = (struct reiserfs_de_head *)body; /* direntry header of "." */ put_deh_offset(&(deh[0]), DOT_OFFSET); /* these two are from make_le_item_head, and are are LE */ deh[0].deh_dir_id = dirid; deh[0].deh_objectid = objid; deh[0].deh_state = 0; /* Endian safe if 0 */ put_deh_location(&(deh[0]), EMPTY_DIR_SIZE - ROUND_UP(strlen("."))); mark_de_visible(&(deh[0])); /* direntry header of ".." */ put_deh_offset(&(deh[1]), DOT_DOT_OFFSET); /* key of ".." for the root directory */ /* these two are from the inode, and are are LE */ deh[1].deh_dir_id = par_dirid; deh[1].deh_objectid = par_objid; deh[1].deh_state = 0; /* Endian safe if 0 */ put_deh_location(&(deh[1]),