diff options
author | Andrea Bastoni <bastoni@cs.unc.edu> | 2010-05-30 19:16:45 -0400 |
---|---|---|
committer | Andrea Bastoni <bastoni@cs.unc.edu> | 2010-05-30 19:16:45 -0400 |
commit | ada47b5fe13d89735805b566185f4885f5a3f750 (patch) | |
tree | 644b88f8a71896307d71438e9b3af49126ffb22b /include/linux/wimax | |
parent | 43e98717ad40a4ae64545b5ba047c7b86aa44f4f (diff) | |
parent | 3280f21d43ee541f97f8cda5792150d2dbec20d5 (diff) |
Merge branch 'wip-2.6.34' into old-private-masterarchived-private-master
Diffstat (limited to 'include/linux/wimax')
-rw-r--r-- | include/linux/wimax/debug.h | 73 | ||||
-rw-r--r-- | include/linux/wimax/i2400m.h | 13 |
2 files changed, 75 insertions, 11 deletions
diff --git a/include/linux/wimax/debug.h b/include/linux/wimax/debug.h index c703e0340423..57031b4d12f2 100644 --- a/include/linux/wimax/debug.h +++ b/include/linux/wimax/debug.h | |||
@@ -155,6 +155,7 @@ | |||
155 | 155 | ||
156 | #include <linux/types.h> | 156 | #include <linux/types.h> |
157 | #include <linux/device.h> | 157 | #include <linux/device.h> |
158 | #include <linux/slab.h> | ||
158 | 159 | ||
159 | 160 | ||
160 | /* Backend stuff */ | 161 | /* Backend stuff */ |
@@ -450,4 +451,76 @@ do { \ | |||
450 | }) | 451 | }) |
451 | 452 | ||
452 | 453 | ||
454 | static inline | ||
455 | void d_submodule_set(struct d_level *d_level, size_t d_level_size, | ||
456 | const char *submodule, u8 level, const char *tag) | ||
457 | { | ||
458 | struct d_level *itr, *top; | ||
459 | int index = -1; | ||
460 | |||
461 | for (itr = d_level, top = itr + d_level_size; itr < top; itr++) { | ||
462 | index++; | ||
463 | if (itr->name == NULL) { | ||
464 | printk(KERN_ERR "%s: itr->name NULL?? (%p, #%d)\n", | ||
465 | tag, itr, index); | ||
466 | continue; | ||
467 | } | ||
468 | if (!strcmp(itr->name, submodule)) { | ||
469 | itr->level = level; | ||
470 | return; | ||
471 | } | ||
472 | } | ||
473 | printk(KERN_ERR "%s: unknown submodule %s\n", tag, submodule); | ||
474 | } | ||
475 | |||
476 | |||
477 | /** | ||
478 | * d_parse_params - Parse a string with debug parameters from the | ||
479 | * command line | ||
480 | * | ||
481 | * @d_level: level structure (D_LEVEL) | ||
482 | * @d_level_size: number of items in the level structure | ||
483 | * (D_LEVEL_SIZE). | ||
484 | * @_params: string with the parameters; this is a space (not tab!) | ||
485 | * separated list of NAME:VALUE, where value is the debug level | ||
486 | * and NAME is the name of the submodule. | ||
487 | * @tag: string for error messages (example: MODULE.ARGNAME). | ||
488 | */ | ||
489 | static inline | ||
490 | void d_parse_params(struct d_level *d_level, size_t d_level_size, | ||
491 | const char *_params, const char *tag) | ||
492 | { | ||
493 | char submodule[130], *params, *params_orig, *token, *colon; | ||
494 | unsigned level, tokens; | ||
495 | |||
496 | if (_params == NULL) | ||
497 | return; | ||
498 | params_orig = kstrdup(_params, GFP_KERNEL); | ||
499 | params = params_orig; | ||
500 | while (1) { | ||
501 | token = strsep(¶ms, " "); | ||
502 | if (token == NULL) | ||
503 | break; | ||
504 | if (*token == '\0') /* eat joint spaces */ | ||
505 | continue; | ||
506 | /* kernel's sscanf %s eats until whitespace, so we | ||
507 | * replace : by \n so it doesn't get eaten later by | ||
508 | * strsep */ | ||
509 | colon = strchr(token, ':'); | ||
510 | if (colon != NULL) | ||
511 | *colon = '\n'; | ||
512 | tokens = sscanf(token, "%s\n%u", submodule, &level); | ||
513 | if (colon != NULL) | ||
514 | *colon = ':'; /* set back, for error messages */ | ||
515 | if (tokens == 2) | ||
516 | d_submodule_set(d_level, d_level_size, | ||
517 | submodule, level, tag); | ||
518 | else | ||
519 | printk(KERN_ERR "%s: can't parse '%s' as a " | ||
520 | "SUBMODULE:LEVEL (%d tokens)\n", | ||
521 | tag, token, tokens); | ||
522 | } | ||
523 | kfree(params_orig); | ||
524 | } | ||
525 | |||
453 | #endif /* #ifndef __debug__h__ */ | 526 | #endif /* #ifndef __debug__h__ */ |
diff --git a/include/linux/wimax/i2400m.h b/include/linux/wimax/i2400m.h index 433693ef2bb0..62d356153565 100644 --- a/include/linux/wimax/i2400m.h +++ b/include/linux/wimax/i2400m.h | |||
@@ -138,7 +138,7 @@ struct i2400m_bcf_hdr { | |||
138 | __le32 module_id; | 138 | __le32 module_id; |
139 | __le32 module_vendor; | 139 | __le32 module_vendor; |
140 | __le32 date; /* BCD YYYMMDD */ | 140 | __le32 date; /* BCD YYYMMDD */ |
141 | __le32 size; | 141 | __le32 size; /* in dwords */ |
142 | __le32 key_size; /* in dwords */ | 142 | __le32 key_size; /* in dwords */ |
143 | __le32 modulus_size; /* in dwords */ | 143 | __le32 modulus_size; /* in dwords */ |
144 | __le32 exponent_size; /* in dwords */ | 144 | __le32 exponent_size; /* in dwords */ |
@@ -168,16 +168,6 @@ enum i2400m_brh { | |||
168 | }; | 168 | }; |
169 | 169 | ||
170 | 170 | ||
171 | /* Constants for bcf->module_id */ | ||
172 | enum i2400m_bcf_mod_id { | ||
173 | /* Firmware file carries its own pokes -- pokes are a set of | ||
174 | * magical values that have to be written in certain memory | ||
175 | * addresses to get the device up and ready for firmware | ||
176 | * download when it is in non-signed boot mode. */ | ||
177 | I2400M_BCF_MOD_ID_POKES = 0x000000001, | ||
178 | }; | ||
179 | |||
180 | |||
181 | /** | 171 | /** |
182 | * i2400m_bootrom_header - Header for a boot-mode command | 172 | * i2400m_bootrom_header - Header for a boot-mode command |
183 | * | 173 | * |
@@ -276,6 +266,7 @@ enum { | |||
276 | I2400M_WARM_RESET_BARKER = 0x50f750f7, | 266 | I2400M_WARM_RESET_BARKER = 0x50f750f7, |
277 | I2400M_NBOOT_BARKER = 0xdeadbeef, | 267 | I2400M_NBOOT_BARKER = 0xdeadbeef, |
278 | I2400M_SBOOT_BARKER = 0x0ff1c1a1, | 268 | I2400M_SBOOT_BARKER = 0x0ff1c1a1, |
269 | I2400M_SBOOT_BARKER_6050 = 0x80000001, | ||
279 | I2400M_ACK_BARKER = 0xfeedbabe, | 270 | I2400M_ACK_BARKER = 0xfeedbabe, |
280 | I2400M_D2H_MSG_BARKER = 0xbeefbabe, | 271 | I2400M_D2H_MSG_BARKER = 0xbeefbabe, |
281 | }; | 272 | }; |