diff options
author | Frank Seidel <fseidel@suse.de> | 2008-01-25 15:13:24 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2008-02-02 18:14:48 -0500 |
commit | e9ed537a3ab0b066eaa4d042c0547d7034f3181b (patch) | |
tree | d90f0611f3fdd9f5261138b0d447f21d331bfef0 /drivers/char | |
parent | 996a3eb87fa989018aecc80f3a96d2a077dd90f1 (diff) |
nozomi driver update
Minor cleanups and removal of in-file changelog:
- Correction of misspellings and wrong encoded Name
- changed 'unsigned' to 'unsigned int' for better readability
- use of generic devicefile access macro
- fixed/added explanatory comment to ntty_put_char
Signed-off-by: Frank Seidel <fseidel@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/char')
-rw-r--r-- | drivers/char/nozomi.c | 122 |
1 files changed, 36 insertions, 86 deletions
diff --git a/drivers/char/nozomi.c b/drivers/char/nozomi.c index 6076e662886a..86ded7ed4500 100644 --- a/drivers/char/nozomi.c +++ b/drivers/char/nozomi.c | |||
@@ -2,7 +2,7 @@ | |||
2 | * nozomi.c -- HSDPA driver Broadband Wireless Data Card - Globe Trotter | 2 | * nozomi.c -- HSDPA driver Broadband Wireless Data Card - Globe Trotter |
3 | * | 3 | * |
4 | * Written by: Ulf Jakobsson, | 4 | * Written by: Ulf Jakobsson, |
5 | * Jan �erfeldt, | 5 | * Jan Åkerfeldt, |
6 | * Stefan Thomasson, | 6 | * Stefan Thomasson, |
7 | * | 7 | * |
8 | * Maintained by: Paul Hardwick (p.hardwick@option.com) | 8 | * Maintained by: Paul Hardwick (p.hardwick@option.com) |
@@ -38,60 +38,6 @@ | |||
38 | * -------------------------------------------------------------------------- | 38 | * -------------------------------------------------------------------------- |
39 | */ | 39 | */ |
40 | 40 | ||
41 | /* | ||
42 | * CHANGELOG | ||
43 | * Version 2.1d | ||
44 | * 11-November-2007 Jiri Slaby, Frank Seidel | ||
45 | * - Big rework of multicard support by Jiri | ||
46 | * - Major cleanups (semaphore to mutex, endianess, no major reservation) | ||
47 | * - Optimizations | ||
48 | * | ||
49 | * Version 2.1c | ||
50 | * 30-October-2007 Frank Seidel | ||
51 | * - Completed multicard support | ||
52 | * - Minor cleanups | ||
53 | * | ||
54 | * Version 2.1b | ||
55 | * 07-August-2007 Frank Seidel | ||
56 | * - Minor cleanups | ||
57 | * - theoretical multicard support | ||
58 | * | ||
59 | * Version 2.1 | ||
60 | * 03-July-2006 Paul Hardwick | ||
61 | * | ||
62 | * - Stability Improvements. Incorporated spinlock wraps patch. | ||
63 | * - Updated for newer 2.6.14+ kernels (tty_buffer_request_room) | ||
64 | * - using __devexit macro for tty | ||
65 | * | ||
66 | * | ||
67 | * Version 2.0 | ||
68 | * 08-feb-2006 15:34:10:Ulf | ||
69 | * | ||
70 | * -Fixed issue when not waking up line disipine layer, could probably result | ||
71 | * in better uplink performance for 2.4. | ||
72 | * | ||
73 | * -Fixed issue with big endian during initalization, now proper toggle flags | ||
74 | * are handled between preloader and maincode. | ||
75 | * | ||
76 | * -Fixed flow control issue. | ||
77 | * | ||
78 | * -Added support for setting DTR. | ||
79 | * | ||
80 | * -For 2.4 kernels, removing temporary buffer that's not needed. | ||
81 | * | ||
82 | * -Reading CTS only for modem port (only port that supports it). | ||
83 | * | ||
84 | * -Return 0 in write_room instead of netative value, it's not handled in | ||
85 | * upper layer. | ||
86 | * | ||
87 | * -------------------------------------------------------------------------- | ||
88 | * Version 1.0 | ||
89 | * | ||
90 | * First version of driver, only tested with card of type F32_2. | ||
91 | * Works fine with 2.4 and 2.6 kernels. | ||
92 | * Driver also support big endian architecture. | ||
93 | */ | ||
94 | |||
95 | /* Enable this to have a lot of debug printouts */ | 41 | /* Enable this to have a lot of debug printouts */ |
96 | #define DEBUG | 42 | #define DEBUG |
97 | 43 | ||
@@ -143,8 +89,9 @@ do { \ | |||
143 | /* Do we need this settable at runtime? */ | 89 | /* Do we need this settable at runtime? */ |
144 | static int debug = NOZOMI_DEBUG_LEVEL; | 90 | static int debug = NOZOMI_DEBUG_LEVEL; |
145 | 91 | ||
146 | #define D(lvl, args...) do {if (lvl & debug) NFO(KERN_DEBUG, ##args); } \ | 92 | #define D(lvl, args...) do \ |
147 | while (0) | 93 | {if (lvl & debug) NFO(KERN_DEBUG, ##args); } \ |
94 | while (0) | ||
148 | #define D_(lvl, args...) D(lvl, ##args) | 95 | #define D_(lvl, args...) D(lvl, ##args) |
149 | 96 | ||
150 | /* These printouts are always printed */ | 97 | /* These printouts are always printed */ |
@@ -273,13 +220,13 @@ enum port_type { | |||
273 | /* Big endian */ | 220 | /* Big endian */ |
274 | 221 | ||
275 | struct toggles { | 222 | struct toggles { |
276 | unsigned enabled:5; /* | 223 | unsigned int enabled:5; /* |
277 | * Toggle fields are valid if enabled is 0, | 224 | * Toggle fields are valid if enabled is 0, |
278 | * else A-channels must always be used. | 225 | * else A-channels must always be used. |
279 | */ | 226 | */ |
280 | unsigned diag_dl:1; | 227 | unsigned int diag_dl:1; |
281 | unsigned mdm_dl:1; | 228 | unsigned int mdm_dl:1; |
282 | unsigned mdm_ul:1; | 229 | unsigned int mdm_ul:1; |
283 | } __attribute__ ((packed)); | 230 | } __attribute__ ((packed)); |
284 | 231 | ||
285 | /* Configuration table to read at startup of card */ | 232 | /* Configuration table to read at startup of card */ |
@@ -320,19 +267,19 @@ struct config_table { | |||
320 | /* This stores all control downlink flags */ | 267 | /* This stores all control downlink flags */ |
321 | struct ctrl_dl { | 268 | struct ctrl_dl { |
322 | u8 port; | 269 | u8 port; |
323 | unsigned reserved:4; | 270 | unsigned int reserved:4; |
324 | unsigned CTS:1; | 271 | unsigned int CTS:1; |
325 | unsigned RI:1; | 272 | unsigned int RI:1; |
326 | unsigned DCD:1; | 273 | unsigned int DCD:1; |
327 | unsigned DSR:1; | 274 | unsigned int DSR:1; |
328 | } __attribute__ ((packed)); | 275 | } __attribute__ ((packed)); |
329 | 276 | ||
330 | /* This stores all control uplink flags */ | 277 | /* This stores all control uplink flags */ |
331 | struct ctrl_ul { | 278 | struct ctrl_ul { |
332 | u8 port; | 279 | u8 port; |
333 | unsigned reserved:6; | 280 | unsigned int reserved:6; |
334 | unsigned RTS:1; | 281 | unsigned int RTS:1; |
335 | unsigned DTR:1; | 282 | unsigned int DTR:1; |
336 | } __attribute__ ((packed)); | 283 | } __attribute__ ((packed)); |
337 | 284 | ||
338 | #else | 285 | #else |
@@ -340,10 +287,10 @@ struct ctrl_ul { | |||
340 | 287 | ||
341 | /* This represents the toggle information */ | 288 | /* This represents the toggle information */ |
342 | struct toggles { | 289 | struct toggles { |
343 | unsigned mdm_ul:1; | 290 | unsigned int mdm_ul:1; |
344 | unsigned mdm_dl:1; | 291 | unsigned int mdm_dl:1; |
345 | unsigned diag_dl:1; | 292 | unsigned int diag_dl:1; |
346 | unsigned enabled:5; /* | 293 | unsigned int enabled:5; /* |
347 | * Toggle fields are valid if enabled is 0, | 294 | * Toggle fields are valid if enabled is 0, |
348 | * else A-channels must always be used. | 295 | * else A-channels must always be used. |
349 | */ | 296 | */ |
@@ -379,19 +326,19 @@ struct config_table { | |||
379 | 326 | ||
380 | /* This stores all control downlink flags */ | 327 | /* This stores all control downlink flags */ |
381 | struct ctrl_dl { | 328 | struct ctrl_dl { |
382 | unsigned DSR:1; | 329 | unsigned int DSR:1; |
383 | unsigned DCD:1; | 330 | unsigned int DCD:1; |
384 | unsigned RI:1; | 331 | unsigned int RI:1; |
385 | unsigned CTS:1; | 332 | unsigned int CTS:1; |
386 | unsigned reserverd:4; | 333 | unsigned int reserverd:4; |
387 | u8 port; | 334 | u8 port; |
388 | } __attribute__ ((packed)); | 335 | } __attribute__ ((packed)); |
389 | 336 | ||
390 | /* This stores all control uplink flags */ | 337 | /* This stores all control uplink flags */ |
391 | struct ctrl_ul { | 338 | struct ctrl_ul { |
392 | unsigned DTR:1; | 339 | unsigned int DTR:1; |
393 | unsigned RTS:1; | 340 | unsigned int RTS:1; |
394 | unsigned reserved:6; | 341 | unsigned int reserved:6; |
395 | u8 port; | 342 | u8 port; |
396 | } __attribute__ ((packed)); | 343 | } __attribute__ ((packed)); |
397 | #endif | 344 | #endif |
@@ -694,7 +641,7 @@ static void dump_table(const struct nozomi *dc) | |||
694 | dc->config_table.ul_ctrl_len); | 641 | dc->config_table.ul_ctrl_len); |
695 | } | 642 | } |
696 | #else | 643 | #else |
697 | static __inline__ void dump_table(const struct nozomi *dc) { } | 644 | static inline void dump_table(const struct nozomi *dc) { } |
698 | #endif | 645 | #endif |
699 | 646 | ||
700 | /* | 647 | /* |
@@ -1102,7 +1049,7 @@ static int send_flow_control(struct nozomi *dc) | |||
1102 | } | 1049 | } |
1103 | 1050 | ||
1104 | /* | 1051 | /* |
1105 | * Handle donlink data, ports that are handled are modem and diagnostics | 1052 | * Handle downlink data, ports that are handled are modem and diagnostics |
1106 | * Return 1 - ok | 1053 | * Return 1 - ok |
1107 | * Return 0 - toggle fields are out of sync | 1054 | * Return 0 - toggle fields are out of sync |
1108 | */ | 1055 | */ |
@@ -1363,7 +1310,7 @@ static ssize_t card_type_show(struct device *dev, struct device_attribute *attr, | |||
1363 | 1310 | ||
1364 | return sprintf(buf, "%d\n", dc->card_type); | 1311 | return sprintf(buf, "%d\n", dc->card_type); |
1365 | } | 1312 | } |
1366 | static DEVICE_ATTR(card_type, 0444, card_type_show, NULL); | 1313 | static DEVICE_ATTR(card_type, S_IRUGO, card_type_show, NULL); |
1367 | 1314 | ||
1368 | static ssize_t open_ttys_show(struct device *dev, struct device_attribute *attr, | 1315 | static ssize_t open_ttys_show(struct device *dev, struct device_attribute *attr, |
1369 | char *buf) | 1316 | char *buf) |
@@ -1372,7 +1319,7 @@ static ssize_t open_ttys_show(struct device *dev, struct device_attribute *attr, | |||
1372 | 1319 | ||
1373 | return sprintf(buf, "%u\n", dc->open_ttys); | 1320 | return sprintf(buf, "%u\n", dc->open_ttys); |
1374 | } | 1321 | } |
1375 | static DEVICE_ATTR(open_ttys, 0444, open_ttys_show, NULL); | 1322 | static DEVICE_ATTR(open_ttys, S_IRUGO, open_ttys_show, NULL); |
1376 | 1323 | ||
1377 | static void make_sysfs_files(struct nozomi *dc) | 1324 | static void make_sysfs_files(struct nozomi *dc) |
1378 | { | 1325 | { |
@@ -1882,7 +1829,10 @@ static void ntty_throttle(struct tty_struct *tty) | |||
1882 | /* just to discard single character writes */ | 1829 | /* just to discard single character writes */ |
1883 | static void ntty_put_char(struct tty_struct *tty, unsigned char c) | 1830 | static void ntty_put_char(struct tty_struct *tty, unsigned char c) |
1884 | { | 1831 | { |
1885 | /* FIXME !!! */ | 1832 | /* |
1833 | * card does not react correct when we write single chars | ||
1834 | * to the card, so we discard them | ||
1835 | */ | ||
1886 | DBG2("PUT CHAR Function: %c", c); | 1836 | DBG2("PUT CHAR Function: %c", c); |
1887 | } | 1837 | } |
1888 | 1838 | ||