Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 66338
b: refs/heads/master
c: 50339a6
h: refs/heads/master
v: v3
  • Loading branch information
Johannes Berg authored and David S. Miller committed Oct 10, 2007
1 parent a63303f commit 32be612
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2a8a9a88fc1b18f5c45244d0ef8a5352f6cf761f
refs/heads/master: 50339a67e2d4386d8919195989371579cab8649d
12 changes: 10 additions & 2 deletions trunk/net/mac80211/debugfs_key.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,17 @@ static ssize_t key_tx_spec_read(struct file *file, char __user *userbuf,
switch (key->alg) {
case ALG_WEP:
len = scnprintf(buf, sizeof(buf), "\n");
break;
case ALG_TKIP:
len = scnprintf(buf, sizeof(buf), "%08x %04x\n",
key->u.tkip.iv32,
key->u.tkip.iv16);
break;
case ALG_CCMP:
tpn = key->u.ccmp.tx_pn;
len = scnprintf(buf, sizeof(buf), "%02x%02x%02x%02x%02x%02x\n",
tpn[0], tpn[1], tpn[2], tpn[3], tpn[4], tpn[5]);
break;
default:
return 0;
}
Expand All @@ -103,13 +106,15 @@ static ssize_t key_rx_spec_read(struct file *file, char __user *userbuf,
switch (key->alg) {
case ALG_WEP:
len = scnprintf(buf, sizeof(buf), "\n");
break;
case ALG_TKIP:
for (i = 0; i < NUM_RX_DATA_QUEUES; i++)
p += scnprintf(p, sizeof(buf)+buf-p,
"%08x %04x\n",
key->u.tkip.iv32_rx[i],
key->u.tkip.iv16_rx[i]);
len = p - buf;
break;
case ALG_CCMP:
for (i = 0; i < NUM_RX_DATA_QUEUES; i++) {
rpn = key->u.ccmp.rx_pn[i];
Expand All @@ -119,6 +124,7 @@ static ssize_t key_rx_spec_read(struct file *file, char __user *userbuf,
rpn[3], rpn[4], rpn[5]);
}
len = p - buf;
break;
default:
return 0;
}
Expand Down Expand Up @@ -164,12 +170,14 @@ KEY_OPS(key);
void ieee80211_debugfs_key_add(struct ieee80211_local *local,
struct ieee80211_key *key)
{
static int keycount;
char buf[20];

if (!local->debugfs.keys)
return;

sprintf(buf, "%d", key->keyidx);
sprintf(buf, "%d", keycount);
keycount++;
key->debugfs.dir = debugfs_create_dir(buf,
local->debugfs.keys);

Expand Down Expand Up @@ -239,7 +247,7 @@ void ieee80211_debugfs_key_sta_link(struct ieee80211_key *key,
if (!key->debugfs.dir)
return;

sprintf(buf, "../sta/" MAC_FMT, MAC_ARG(sta->addr));
sprintf(buf, "../../stations/" MAC_FMT, MAC_ARG(sta->addr));
key->debugfs.stalink =
debugfs_create_symlink("station", key->debugfs.dir, buf);
}
Expand Down

0 comments on commit 32be612

Please sign in to comment.