22 #include <linux/module.h>
23 #include <linux/kernel.h>
25 #include <linux/netdevice.h>
30 #define FT1000_PROC_DIR "ft1000"
33 #define PUTM_TO_PAGE(len,page,args...) \
34 len += snprintf(page+len, PAGE_SIZE - len, args)
36 #define PUTX_TO_PAGE(len,page,message,size,var) \
37 len += snprintf(page+len, PAGE_SIZE - len, message); \
38 for (i = 0; i < (size - 1); i++) {\
39 len += snprintf(page+len, PAGE_SIZE - len, "%02x:", var[i]); \
41 len += snprintf(page+len, PAGE_SIZE - len, "%02x\n", var[i])
43 #define PUTD_TO_PAGE(len,page,message,size,var) \
44 len += snprintf(page+len, PAGE_SIZE - len, message); \
45 for (i = 0; i < (size - 1); i++) {\
46 len += snprintf(page+len, PAGE_SIZE - len, "%d.", var[i]); \
48 len += snprintf(page+len, PAGE_SIZE - len, "%d\n", var[i])
51 #define FTNET_PROC init_net.proc_net
65 unsigned short ledStat;
66 unsigned short conStat;
81 char *signal[] = {
"",
"*",
"**",
"***",
"****" };
88 info = netdev_priv(dev);
105 delta = (tv.tv_sec - info->
ConTm);
129 i = (info->
LedStat >> 8) & 0xf;
148 PUTM_TO_PAGE(len, page,
"Connection Time: %02ld:%02ld:%02ld\n",
149 ((delta / 3600) % 24), ((delta / 60) % 60), (delta % 60));
150 PUTM_TO_PAGE(len, page,
"Connection Time[s]: %ld\n", delta);
166 status[((info->
ConStat) & 0x7)]);
171 PUTM_TO_PAGE(len, page,
"Signal Strength: %s\n", signal[strength]);
172 PUTM_TO_PAGE(len, page,
"Signal Quality: %s\n", signal[quality]);
184 info = netdev_priv(dev);
189 ft1000_proc_file = create_proc_read_entry(dev->
name, 0644,
191 ft1000ReadProc, dev);
200 .notifier_call = ft1000NotifyProc,
210 info = netdev_priv(dev);
221 create_proc_read_entry(dev->
name, 0644,
224 if (ft1000_proc_file ==
NULL) {