aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorInaky Perez-Gonzalez <inaky@linux.intel.com>2009-03-30 20:51:54 -0400
committerInaky Perez-Gonzalez <inaky@linux.intel.com>2009-05-28 21:01:35 -0400
commit44b849d11bf6801a642dd1aa9a70e470d046d273 (patch)
tree2e2e3f03f65868d94930ad4995da8db7494f33bb
parentfe442683853a2c0863b700acc4328b4d73090206 (diff)
wimax/i2400m: trace commands sent from user space on the "echo" pipe
When commands are sent from user space, trace both the command sent and the answer received over the "echo" pipe instead of over the "trace" pipe when command tracing is enabled. As well, when the device sends a reports/indications, send it over the "echo" pipe. The "trace" pipe is used by the device to send firmware traces; gets confusing. Another named pipe makes it easier to split debug information. Signed-off-by: Inaky Perez-Gonzalez <inaky@linux.intel.com>
-rw-r--r--drivers/net/wimax/i2400m/driver.c13
-rw-r--r--drivers/net/wimax/i2400m/rx.c3
2 files changed, 13 insertions, 3 deletions
diff --git a/drivers/net/wimax/i2400m/driver.c b/drivers/net/wimax/i2400m/driver.c
index a21318b34bf2..d33389fd7bd3 100644
--- a/drivers/net/wimax/i2400m/driver.c
+++ b/drivers/net/wimax/i2400m/driver.c
@@ -231,13 +231,20 @@ int i2400m_op_msg_from_user(struct wimax_dev *wimax_dev,
231 d_fnstart(4, dev, "(wimax_dev %p [i2400m %p] msg_buf %p " 231 d_fnstart(4, dev, "(wimax_dev %p [i2400m %p] msg_buf %p "
232 "msg_len %zu genl_info %p)\n", wimax_dev, i2400m, 232 "msg_len %zu genl_info %p)\n", wimax_dev, i2400m,
233 msg_buf, msg_len, genl_info); 233 msg_buf, msg_len, genl_info);
234 if (unlikely(i2400m->trace_msg_from_user))
235 wimax_msg(&i2400m->wimax_dev, "echo",
236 msg_buf, msg_len, GFP_KERNEL);
234 ack_skb = i2400m_msg_to_dev(i2400m, msg_buf, msg_len); 237 ack_skb = i2400m_msg_to_dev(i2400m, msg_buf, msg_len);
235 result = PTR_ERR(ack_skb); 238 result = PTR_ERR(ack_skb);
236 if (IS_ERR(ack_skb)) 239 if (IS_ERR(ack_skb))
237 goto error_msg_to_dev; 240 goto error_msg_to_dev;
238 if (unlikely(i2400m->trace_msg_from_user)) 241 if (unlikely(i2400m->trace_msg_from_user)) {
239 wimax_msg(&i2400m->wimax_dev, "trace", 242 const void *ack_data;
240 msg_buf, msg_len, GFP_KERNEL); 243 size_t ack_len;
244 ack_data = wimax_msg_data_len(ack_skb, &ack_len);
245 wimax_msg(&i2400m->wimax_dev, "echo",
246 ack_data, ack_len, GFP_KERNEL);
247 }
241 result = wimax_msg_send(&i2400m->wimax_dev, ack_skb); 248 result = wimax_msg_send(&i2400m->wimax_dev, ack_skb);
242error_msg_to_dev: 249error_msg_to_dev:
243 d_fnend(4, dev, "(wimax_dev %p [i2400m %p] msg_buf %p msg_len %zu " 250 d_fnend(4, dev, "(wimax_dev %p [i2400m %p] msg_buf %p msg_len %zu "
diff --git a/drivers/net/wimax/i2400m/rx.c b/drivers/net/wimax/i2400m/rx.c
index f9fc38902322..a4adc78102fb 100644
--- a/drivers/net/wimax/i2400m/rx.c
+++ b/drivers/net/wimax/i2400m/rx.c
@@ -309,6 +309,9 @@ void i2400m_rx_ctl(struct i2400m *i2400m, struct sk_buff *skb_rx,
309 skb_get(skb_rx); 309 skb_get(skb_rx);
310 i2400m_queue_work(i2400m, i2400m_report_hook_work, 310 i2400m_queue_work(i2400m, i2400m_report_hook_work,
311 GFP_KERNEL, &args, sizeof(args)); 311 GFP_KERNEL, &args, sizeof(args));
312 if (unlikely(i2400m->trace_msg_from_user))
313 wimax_msg(&i2400m->wimax_dev, "echo",
314 l3l4_hdr, size, GFP_KERNEL);
312 result = wimax_msg(&i2400m->wimax_dev, NULL, l3l4_hdr, size, 315 result = wimax_msg(&i2400m->wimax_dev, NULL, l3l4_hdr, size,
313 GFP_KERNEL); 316 GFP_KERNEL);
314 if (result < 0) 317 if (result < 0)