diff options
author | Karsten Keil <kkeil@suse.de> | 2008-07-30 12:26:58 -0400 |
---|---|---|
committer | Karsten Keil <kkeil@suse.de> | 2008-08-02 10:28:50 -0400 |
commit | ff4cc1de2401ad44ae084c3f5a9e898af0879520 (patch) | |
tree | 24e0e3d1b8a35559546910a0ca0cd1f9f63f1576 /include | |
parent | 780aefed1e179b23dcfbd6cfcb627ec3bd0a164c (diff) |
mISDN cleanup user interface
The channelmap should have the same size on 32 and 64 bit systems
and should not depend on endianess.
Thanks to David Woodhouse for spotting this.
Signed-off-by: Karsten Keil <kkeil@suse.de>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/mISDNif.h | 32 |
1 files changed, 27 insertions, 5 deletions
diff --git a/include/linux/mISDNif.h b/include/linux/mISDNif.h index 5c948f337817..8f2d60da04e7 100644 --- a/include/linux/mISDNif.h +++ b/include/linux/mISDNif.h | |||
@@ -37,7 +37,7 @@ | |||
37 | */ | 37 | */ |
38 | #define MISDN_MAJOR_VERSION 1 | 38 | #define MISDN_MAJOR_VERSION 1 |
39 | #define MISDN_MINOR_VERSION 0 | 39 | #define MISDN_MINOR_VERSION 0 |
40 | #define MISDN_RELEASE 18 | 40 | #define MISDN_RELEASE 19 |
41 | 41 | ||
42 | /* primitives for information exchange | 42 | /* primitives for information exchange |
43 | * generell format | 43 | * generell format |
@@ -242,7 +242,8 @@ struct mISDNhead { | |||
242 | #define TEI_SAPI 63 | 242 | #define TEI_SAPI 63 |
243 | #define CTRL_SAPI 0 | 243 | #define CTRL_SAPI 0 |
244 | 244 | ||
245 | #define MISDN_CHMAP_SIZE 4 | 245 | #define MISDN_MAX_CHANNEL 127 |
246 | #define MISDN_CHMAP_SIZE ((MISDN_MAX_CHANNEL + 1) >> 3) | ||
246 | 247 | ||
247 | #define SOL_MISDN 0 | 248 | #define SOL_MISDN 0 |
248 | 249 | ||
@@ -275,11 +276,32 @@ struct mISDN_devinfo { | |||
275 | u_int Dprotocols; | 276 | u_int Dprotocols; |
276 | u_int Bprotocols; | 277 | u_int Bprotocols; |
277 | u_int protocol; | 278 | u_int protocol; |
278 | u_long channelmap[MISDN_CHMAP_SIZE]; | 279 | u_char channelmap[MISDN_CHMAP_SIZE]; |
279 | u_int nrbchan; | 280 | u_int nrbchan; |
280 | char name[MISDN_MAX_IDLEN]; | 281 | char name[MISDN_MAX_IDLEN]; |
281 | }; | 282 | }; |
282 | 283 | ||
284 | static inline int | ||
285 | test_channelmap(u_int nr, u_char *map) | ||
286 | { | ||
287 | if (nr <= MISDN_MAX_CHANNEL) | ||
288 | return map[nr >> 3] & (1 << (nr & 7)); | ||
289 | else | ||
290 | return 0; | ||
291 | } | ||
292 | |||
293 | static inline void | ||
294 | set_channelmap(u_int nr, u_char *map) | ||
295 | { | ||
296 | map[nr >> 3] |= (1 << (nr & 7)); | ||
297 | } | ||
298 | |||
299 | static inline void | ||
300 | clear_channelmap(u_int nr, u_char *map) | ||
301 | { | ||
302 | map[nr >> 3] &= ~(1 << (nr & 7)); | ||
303 | } | ||
304 | |||
283 | /* CONTROL_CHANNEL parameters */ | 305 | /* CONTROL_CHANNEL parameters */ |
284 | #define MISDN_CTRL_GETOP 0x0000 | 306 | #define MISDN_CTRL_GETOP 0x0000 |
285 | #define MISDN_CTRL_LOOP 0x0001 | 307 | #define MISDN_CTRL_LOOP 0x0001 |
@@ -405,7 +427,7 @@ struct mISDNdevice { | |||
405 | u_int Dprotocols; | 427 | u_int Dprotocols; |
406 | u_int Bprotocols; | 428 | u_int Bprotocols; |
407 | u_int nrbchan; | 429 | u_int nrbchan; |
408 | u_long channelmap[MISDN_CHMAP_SIZE]; | 430 | u_char channelmap[MISDN_CHMAP_SIZE]; |
409 | struct list_head bchannels; | 431 | struct list_head bchannels; |
410 | struct mISDNchannel *teimgr; | 432 | struct mISDNchannel *teimgr; |
411 | struct device dev; | 433 | struct device dev; |
@@ -430,7 +452,7 @@ struct mISDNstack { | |||
430 | #endif | 452 | #endif |
431 | }; | 453 | }; |
432 | 454 | ||
433 | /* global alloc/queue dunctions */ | 455 | /* global alloc/queue functions */ |
434 | 456 | ||
435 | static inline struct sk_buff * | 457 | static inline struct sk_buff * |
436 | mI_alloc_skb(unsigned int len, gfp_t gfp_mask) | 458 | mI_alloc_skb(unsigned int len, gfp_t gfp_mask) |