diff options
author | Linus Torvalds <torvalds@g5.osdl.org> | 2005-09-07 20:22:43 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-09-07 20:22:43 -0400 |
commit | 55faed1e607a24ca7f3453a3eb463ca8987f8139 (patch) | |
tree | 70c1f910576713e799b5b409d9f4c3c56840526e /include | |
parent | 946e91f36e90eea46758dd725b1c3b239f270f68 (diff) | |
parent | 0edd5b44913cd0aba6f23b626b407f70bb3fb018 (diff) |
Merge branch 'upstream' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/pci_ids.h | 1 | ||||
-rw-r--r-- | include/linux/wireless.h | 38 | ||||
-rw-r--r-- | include/net/iw_handler.h | 123 |
3 files changed, 136 insertions, 26 deletions
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index 95c941f8c747..ee0ab7a5f91b 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h | |||
@@ -1612,6 +1612,7 @@ | |||
1612 | #define PCI_DEVICE_ID_TOSHIBA_TC35815CF 0x0030 | 1612 | #define PCI_DEVICE_ID_TOSHIBA_TC35815CF 0x0030 |
1613 | #define PCI_DEVICE_ID_TOSHIBA_TX4927 0x0180 | 1613 | #define PCI_DEVICE_ID_TOSHIBA_TX4927 0x0180 |
1614 | #define PCI_DEVICE_ID_TOSHIBA_TC86C001_MISC 0x0108 | 1614 | #define PCI_DEVICE_ID_TOSHIBA_TC86C001_MISC 0x0108 |
1615 | #define PCI_DEVICE_ID_TOSHIBA_SPIDER_NET 0x01b3 | ||
1615 | 1616 | ||
1616 | #define PCI_VENDOR_ID_RICOH 0x1180 | 1617 | #define PCI_VENDOR_ID_RICOH 0x1180 |
1617 | #define PCI_DEVICE_ID_RICOH_RL5C465 0x0465 | 1618 | #define PCI_DEVICE_ID_RICOH_RL5C465 0x0465 |
diff --git a/include/linux/wireless.h b/include/linux/wireless.h index ae485f9c916e..a555a0f7a7b4 100644 --- a/include/linux/wireless.h +++ b/include/linux/wireless.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * This file define a set of standard wireless extensions | 2 | * This file define a set of standard wireless extensions |
3 | * | 3 | * |
4 | * Version : 18 12.3.05 | 4 | * Version : 19 18.3.05 |
5 | * | 5 | * |
6 | * Authors : Jean Tourrilhes - HPL - <jt@hpl.hp.com> | 6 | * Authors : Jean Tourrilhes - HPL - <jt@hpl.hp.com> |
7 | * Copyright (c) 1997-2005 Jean Tourrilhes, All Rights Reserved. | 7 | * Copyright (c) 1997-2005 Jean Tourrilhes, All Rights Reserved. |
@@ -69,8 +69,6 @@ | |||
69 | 69 | ||
70 | /***************************** INCLUDES *****************************/ | 70 | /***************************** INCLUDES *****************************/ |
71 | 71 | ||
72 | /* To minimise problems in user space, I might remove those headers | ||
73 | * at some point. Jean II */ | ||
74 | #include <linux/types.h> /* for "caddr_t" et al */ | 72 | #include <linux/types.h> /* for "caddr_t" et al */ |
75 | #include <linux/socket.h> /* for "struct sockaddr" et al */ | 73 | #include <linux/socket.h> /* for "struct sockaddr" et al */ |
76 | #include <linux/if.h> /* for IFNAMSIZ and co... */ | 74 | #include <linux/if.h> /* for IFNAMSIZ and co... */ |
@@ -82,7 +80,7 @@ | |||
82 | * (there is some stuff that will be added in the future...) | 80 | * (there is some stuff that will be added in the future...) |
83 | * I just plan to increment with each new version. | 81 | * I just plan to increment with each new version. |
84 | */ | 82 | */ |
85 | #define WIRELESS_EXT 18 | 83 | #define WIRELESS_EXT 19 |
86 | 84 | ||
87 | /* | 85 | /* |
88 | * Changes : | 86 | * Changes : |
@@ -197,6 +195,15 @@ | |||
197 | * related parameters (extensible up to 4096 parameter values) | 195 | * related parameters (extensible up to 4096 parameter values) |
198 | * - Add wireless events: IWEVGENIE, IWEVMICHAELMICFAILURE, | 196 | * - Add wireless events: IWEVGENIE, IWEVMICHAELMICFAILURE, |
199 | * IWEVASSOCREQIE, IWEVASSOCRESPIE, IWEVPMKIDCAND | 197 | * IWEVASSOCREQIE, IWEVASSOCRESPIE, IWEVPMKIDCAND |
198 | * | ||
199 | * V18 to V19 | ||
200 | * ---------- | ||
201 | * - Remove (struct iw_point *)->pointer from events and streams | ||
202 | * - Remove header includes to help user space | ||
203 | * - Increase IW_ENCODING_TOKEN_MAX from 32 to 64 | ||
204 | * - Add IW_QUAL_ALL_UPDATED and IW_QUAL_ALL_INVALID macros | ||
205 | * - Add explicit flag to tell stats are in dBm : IW_QUAL_DBM | ||
206 | * - Add IW_IOCTL_IDX() and IW_EVENT_IDX() macros | ||
200 | */ | 207 | */ |
201 | 208 | ||
202 | /**************************** CONSTANTS ****************************/ | 209 | /**************************** CONSTANTS ****************************/ |
@@ -322,6 +329,7 @@ | |||
322 | /* The first and the last (range) */ | 329 | /* The first and the last (range) */ |
323 | #define SIOCIWFIRST 0x8B00 | 330 | #define SIOCIWFIRST 0x8B00 |
324 | #define SIOCIWLAST SIOCIWLASTPRIV /* 0x8BFF */ | 331 | #define SIOCIWLAST SIOCIWLASTPRIV /* 0x8BFF */ |
332 | #define IW_IOCTL_IDX(cmd) ((cmd) - SIOCIWFIRST) | ||
325 | 333 | ||
326 | /* Even : get (world access), odd : set (root access) */ | 334 | /* Even : get (world access), odd : set (root access) */ |
327 | #define IW_IS_SET(cmd) (!((cmd) & 0x1)) | 335 | #define IW_IS_SET(cmd) (!((cmd) & 0x1)) |
@@ -366,6 +374,7 @@ | |||
366 | * (struct iw_pmkid_cand) */ | 374 | * (struct iw_pmkid_cand) */ |
367 | 375 | ||
368 | #define IWEVFIRST 0x8C00 | 376 | #define IWEVFIRST 0x8C00 |
377 | #define IW_EVENT_IDX(cmd) ((cmd) - IWEVFIRST) | ||
369 | 378 | ||
370 | /* ------------------------- PRIVATE INFO ------------------------- */ | 379 | /* ------------------------- PRIVATE INFO ------------------------- */ |
371 | /* | 380 | /* |
@@ -427,12 +436,15 @@ | |||
427 | #define IW_MODE_MONITOR 6 /* Passive monitor (listen only) */ | 436 | #define IW_MODE_MONITOR 6 /* Passive monitor (listen only) */ |
428 | 437 | ||
429 | /* Statistics flags (bitmask in updated) */ | 438 | /* Statistics flags (bitmask in updated) */ |
430 | #define IW_QUAL_QUAL_UPDATED 0x1 /* Value was updated since last read */ | 439 | #define IW_QUAL_QUAL_UPDATED 0x01 /* Value was updated since last read */ |
431 | #define IW_QUAL_LEVEL_UPDATED 0x2 | 440 | #define IW_QUAL_LEVEL_UPDATED 0x02 |
432 | #define IW_QUAL_NOISE_UPDATED 0x4 | 441 | #define IW_QUAL_NOISE_UPDATED 0x04 |
442 | #define IW_QUAL_ALL_UPDATED 0x07 | ||
443 | #define IW_QUAL_DBM 0x08 /* Level + Noise are dBm */ | ||
433 | #define IW_QUAL_QUAL_INVALID 0x10 /* Driver doesn't provide value */ | 444 | #define IW_QUAL_QUAL_INVALID 0x10 /* Driver doesn't provide value */ |
434 | #define IW_QUAL_LEVEL_INVALID 0x20 | 445 | #define IW_QUAL_LEVEL_INVALID 0x20 |
435 | #define IW_QUAL_NOISE_INVALID 0x40 | 446 | #define IW_QUAL_NOISE_INVALID 0x40 |
447 | #define IW_QUAL_ALL_INVALID 0x70 | ||
436 | 448 | ||
437 | /* Frequency flags */ | 449 | /* Frequency flags */ |
438 | #define IW_FREQ_AUTO 0x00 /* Let the driver decides */ | 450 | #define IW_FREQ_AUTO 0x00 /* Let the driver decides */ |
@@ -443,7 +455,7 @@ | |||
443 | #define IW_MAX_ENCODING_SIZES 8 | 455 | #define IW_MAX_ENCODING_SIZES 8 |
444 | 456 | ||
445 | /* Maximum size of the encoding token in bytes */ | 457 | /* Maximum size of the encoding token in bytes */ |
446 | #define IW_ENCODING_TOKEN_MAX 32 /* 256 bits (for now) */ | 458 | #define IW_ENCODING_TOKEN_MAX 64 /* 512 bits (for now) */ |
447 | 459 | ||
448 | /* Flags for encoding (along with the token) */ | 460 | /* Flags for encoding (along with the token) */ |
449 | #define IW_ENCODE_INDEX 0x00FF /* Token index (if needed) */ | 461 | #define IW_ENCODE_INDEX 0x00FF /* Token index (if needed) */ |
@@ -1039,12 +1051,16 @@ struct iw_event | |||
1039 | #define IW_EV_CHAR_LEN (IW_EV_LCP_LEN + IFNAMSIZ) | 1051 | #define IW_EV_CHAR_LEN (IW_EV_LCP_LEN + IFNAMSIZ) |
1040 | #define IW_EV_UINT_LEN (IW_EV_LCP_LEN + sizeof(__u32)) | 1052 | #define IW_EV_UINT_LEN (IW_EV_LCP_LEN + sizeof(__u32)) |
1041 | #define IW_EV_FREQ_LEN (IW_EV_LCP_LEN + sizeof(struct iw_freq)) | 1053 | #define IW_EV_FREQ_LEN (IW_EV_LCP_LEN + sizeof(struct iw_freq)) |
1042 | #define IW_EV_POINT_LEN (IW_EV_LCP_LEN + sizeof(struct iw_point)) | ||
1043 | #define IW_EV_PARAM_LEN (IW_EV_LCP_LEN + sizeof(struct iw_param)) | 1054 | #define IW_EV_PARAM_LEN (IW_EV_LCP_LEN + sizeof(struct iw_param)) |
1044 | #define IW_EV_ADDR_LEN (IW_EV_LCP_LEN + sizeof(struct sockaddr)) | 1055 | #define IW_EV_ADDR_LEN (IW_EV_LCP_LEN + sizeof(struct sockaddr)) |
1045 | #define IW_EV_QUAL_LEN (IW_EV_LCP_LEN + sizeof(struct iw_quality)) | 1056 | #define IW_EV_QUAL_LEN (IW_EV_LCP_LEN + sizeof(struct iw_quality)) |
1046 | 1057 | ||
1047 | /* Note : in the case of iw_point, the extra data will come at the | 1058 | /* iw_point events are special. First, the payload (extra data) come at |
1048 | * end of the event */ | 1059 | * the end of the event, so they are bigger than IW_EV_POINT_LEN. Second, |
1060 | * we omit the pointer, so start at an offset. */ | ||
1061 | #define IW_EV_POINT_OFF (((char *) &(((struct iw_point *) NULL)->length)) - \ | ||
1062 | (char *) NULL) | ||
1063 | #define IW_EV_POINT_LEN (IW_EV_LCP_LEN + sizeof(struct iw_point) - \ | ||
1064 | IW_EV_POINT_OFF) | ||
1049 | 1065 | ||
1050 | #endif /* _LINUX_WIRELESS_H */ | 1066 | #endif /* _LINUX_WIRELESS_H */ |
diff --git a/include/net/iw_handler.h b/include/net/iw_handler.h index 44edd48f1234..d67c8393a343 100644 --- a/include/net/iw_handler.h +++ b/include/net/iw_handler.h | |||
@@ -1,10 +1,10 @@ | |||
1 | /* | 1 | /* |
2 | * This file define the new driver API for Wireless Extensions | 2 | * This file define the new driver API for Wireless Extensions |
3 | * | 3 | * |
4 | * Version : 6 21.6.04 | 4 | * Version : 7 18.3.05 |
5 | * | 5 | * |
6 | * Authors : Jean Tourrilhes - HPL - <jt@hpl.hp.com> | 6 | * Authors : Jean Tourrilhes - HPL - <jt@hpl.hp.com> |
7 | * Copyright (c) 2001-2004 Jean Tourrilhes, All Rights Reserved. | 7 | * Copyright (c) 2001-2005 Jean Tourrilhes, All Rights Reserved. |
8 | */ | 8 | */ |
9 | 9 | ||
10 | #ifndef _IW_HANDLER_H | 10 | #ifndef _IW_HANDLER_H |
@@ -207,7 +207,7 @@ | |||
207 | * will be needed... | 207 | * will be needed... |
208 | * I just plan to increment with each new version. | 208 | * I just plan to increment with each new version. |
209 | */ | 209 | */ |
210 | #define IW_HANDLER_VERSION 6 | 210 | #define IW_HANDLER_VERSION 7 |
211 | 211 | ||
212 | /* | 212 | /* |
213 | * Changes : | 213 | * Changes : |
@@ -232,6 +232,13 @@ | |||
232 | * - Remove spy #ifdef, they are always on -> cleaner code | 232 | * - Remove spy #ifdef, they are always on -> cleaner code |
233 | * - Add IW_DESCR_FLAG_NOMAX flag for very large requests | 233 | * - Add IW_DESCR_FLAG_NOMAX flag for very large requests |
234 | * - Start migrating get_wireless_stats to struct iw_handler_def | 234 | * - Start migrating get_wireless_stats to struct iw_handler_def |
235 | * | ||
236 | * V6 to V7 | ||
237 | * -------- | ||
238 | * - Add struct ieee80211_device pointer in struct iw_public_data | ||
239 | * - Remove (struct iw_point *)->pointer from events and streams | ||
240 | * - Remove spy_offset from struct iw_handler_def | ||
241 | * - Add "check" version of event macros for ieee802.11 stack | ||
235 | */ | 242 | */ |
236 | 243 | ||
237 | /**************************** CONSTANTS ****************************/ | 244 | /**************************** CONSTANTS ****************************/ |
@@ -334,9 +341,6 @@ struct iw_handler_def | |||
334 | * We will automatically export that to user space... */ | 341 | * We will automatically export that to user space... */ |
335 | const struct iw_priv_args * private_args; | 342 | const struct iw_priv_args * private_args; |
336 | 343 | ||
337 | /* This field will be *removed* in the next version of WE */ | ||
338 | long spy_offset; /* DO NOT USE */ | ||
339 | |||
340 | /* New location of get_wireless_stats, to de-bloat struct net_device. | 344 | /* New location of get_wireless_stats, to de-bloat struct net_device. |
341 | * The old pointer in struct net_device will be gradually phased | 345 | * The old pointer in struct net_device will be gradually phased |
342 | * out, and drivers are encouraged to use this one... */ | 346 | * out, and drivers are encouraged to use this one... */ |
@@ -400,16 +404,21 @@ struct iw_spy_data | |||
400 | /* --------------------- DEVICE WIRELESS DATA --------------------- */ | 404 | /* --------------------- DEVICE WIRELESS DATA --------------------- */ |
401 | /* | 405 | /* |
402 | * This is all the wireless data specific to a device instance that | 406 | * This is all the wireless data specific to a device instance that |
403 | * is managed by the core of Wireless Extensions. | 407 | * is managed by the core of Wireless Extensions or the 802.11 layer. |
404 | * We only keep pointer to those structures, so that a driver is free | 408 | * We only keep pointer to those structures, so that a driver is free |
405 | * to share them between instances. | 409 | * to share them between instances. |
406 | * This structure should be initialised before registering the device. | 410 | * This structure should be initialised before registering the device. |
407 | * Access to this data follow the same rules as any other struct net_device | 411 | * Access to this data follow the same rules as any other struct net_device |
408 | * data (i.e. valid as long as struct net_device exist, same locking rules). | 412 | * data (i.e. valid as long as struct net_device exist, same locking rules). |
409 | */ | 413 | */ |
414 | /* Forward declaration */ | ||
415 | struct ieee80211_device; | ||
416 | /* The struct */ | ||
410 | struct iw_public_data { | 417 | struct iw_public_data { |
411 | /* Driver enhanced spy support */ | 418 | /* Driver enhanced spy support */ |
412 | struct iw_spy_data * spy_data; | 419 | struct iw_spy_data * spy_data; |
420 | /* Structure managed by the in-kernel IEEE 802.11 layer */ | ||
421 | struct ieee80211_device * ieee80211; | ||
413 | }; | 422 | }; |
414 | 423 | ||
415 | /**************************** PROTOTYPES ****************************/ | 424 | /**************************** PROTOTYPES ****************************/ |
@@ -424,7 +433,7 @@ struct iw_public_data { | |||
424 | extern int dev_get_wireless_info(char * buffer, char **start, off_t offset, | 433 | extern int dev_get_wireless_info(char * buffer, char **start, off_t offset, |
425 | int length); | 434 | int length); |
426 | 435 | ||
427 | /* Handle IOCTLs, called in net/code/dev.c */ | 436 | /* Handle IOCTLs, called in net/core/dev.c */ |
428 | extern int wireless_process_ioctl(struct ifreq *ifr, unsigned int cmd); | 437 | extern int wireless_process_ioctl(struct ifreq *ifr, unsigned int cmd); |
429 | 438 | ||
430 | /* Second : functions that may be called by driver modules */ | 439 | /* Second : functions that may be called by driver modules */ |
@@ -479,7 +488,7 @@ iwe_stream_add_event(char * stream, /* Stream of events */ | |||
479 | int event_len) /* Real size of payload */ | 488 | int event_len) /* Real size of payload */ |
480 | { | 489 | { |
481 | /* Check if it's possible */ | 490 | /* Check if it's possible */ |
482 | if((stream + event_len) < ends) { | 491 | if(likely((stream + event_len) < ends)) { |
483 | iwe->len = event_len; | 492 | iwe->len = event_len; |
484 | memcpy(stream, (char *) iwe, event_len); | 493 | memcpy(stream, (char *) iwe, event_len); |
485 | stream += event_len; | 494 | stream += event_len; |
@@ -495,14 +504,17 @@ iwe_stream_add_event(char * stream, /* Stream of events */ | |||
495 | static inline char * | 504 | static inline char * |
496 | iwe_stream_add_point(char * stream, /* Stream of events */ | 505 | iwe_stream_add_point(char * stream, /* Stream of events */ |
497 | char * ends, /* End of stream */ | 506 | char * ends, /* End of stream */ |
498 | struct iw_event *iwe, /* Payload */ | 507 | struct iw_event *iwe, /* Payload length + flags */ |
499 | char * extra) | 508 | char * extra) /* More payload */ |
500 | { | 509 | { |
501 | int event_len = IW_EV_POINT_LEN + iwe->u.data.length; | 510 | int event_len = IW_EV_POINT_LEN + iwe->u.data.length; |
502 | /* Check if it's possible */ | 511 | /* Check if it's possible */ |
503 | if((stream + event_len) < ends) { | 512 | if(likely((stream + event_len) < ends)) { |
504 | iwe->len = event_len; | 513 | iwe->len = event_len; |
505 | memcpy(stream, (char *) iwe, IW_EV_POINT_LEN); | 514 | memcpy(stream, (char *) iwe, IW_EV_LCP_LEN); |
515 | memcpy(stream + IW_EV_LCP_LEN, | ||
516 | ((char *) iwe) + IW_EV_LCP_LEN + IW_EV_POINT_OFF, | ||
517 | IW_EV_POINT_LEN - IW_EV_LCP_LEN); | ||
506 | memcpy(stream + IW_EV_POINT_LEN, extra, iwe->u.data.length); | 518 | memcpy(stream + IW_EV_POINT_LEN, extra, iwe->u.data.length); |
507 | stream += event_len; | 519 | stream += event_len; |
508 | } | 520 | } |
@@ -526,7 +538,7 @@ iwe_stream_add_value(char * event, /* Event in the stream */ | |||
526 | event_len -= IW_EV_LCP_LEN; | 538 | event_len -= IW_EV_LCP_LEN; |
527 | 539 | ||
528 | /* Check if it's possible */ | 540 | /* Check if it's possible */ |
529 | if((value + event_len) < ends) { | 541 | if(likely((value + event_len) < ends)) { |
530 | /* Add new value */ | 542 | /* Add new value */ |
531 | memcpy(value, (char *) iwe + IW_EV_LCP_LEN, event_len); | 543 | memcpy(value, (char *) iwe + IW_EV_LCP_LEN, event_len); |
532 | value += event_len; | 544 | value += event_len; |
@@ -537,4 +549,85 @@ iwe_stream_add_value(char * event, /* Event in the stream */ | |||
537 | return value; | 549 | return value; |
538 | } | 550 | } |
539 | 551 | ||
552 | /*------------------------------------------------------------------*/ | ||
553 | /* | ||
554 | * Wrapper to add an Wireless Event to a stream of events. | ||
555 | * Same as above, with explicit error check... | ||
556 | */ | ||
557 | static inline char * | ||
558 | iwe_stream_check_add_event(char * stream, /* Stream of events */ | ||
559 | char * ends, /* End of stream */ | ||
560 | struct iw_event *iwe, /* Payload */ | ||
561 | int event_len, /* Size of payload */ | ||
562 | int * perr) /* Error report */ | ||
563 | { | ||
564 | /* Check if it's possible, set error if not */ | ||
565 | if(likely((stream + event_len) < ends)) { | ||
566 | iwe->len = event_len; | ||
567 | memcpy(stream, (char *) iwe, event_len); | ||
568 | stream += event_len; | ||
569 | } else | ||
570 | *perr = -E2BIG; | ||
571 | return stream; | ||
572 | } | ||
573 | |||
574 | /*------------------------------------------------------------------*/ | ||
575 | /* | ||
576 | * Wrapper to add an short Wireless Event containing a pointer to a | ||
577 | * stream of events. | ||
578 | * Same as above, with explicit error check... | ||
579 | */ | ||
580 | static inline char * | ||
581 | iwe_stream_check_add_point(char * stream, /* Stream of events */ | ||
582 | char * ends, /* End of stream */ | ||
583 | struct iw_event *iwe, /* Payload length + flags */ | ||
584 | char * extra, /* More payload */ | ||
585 | int * perr) /* Error report */ | ||
586 | { | ||
587 | int event_len = IW_EV_POINT_LEN + iwe->u.data.length; | ||
588 | /* Check if it's possible */ | ||
589 | if(likely((stream + event_len) < ends)) { | ||
590 | iwe->len = event_len; | ||
591 | memcpy(stream, (char *) iwe, IW_EV_LCP_LEN); | ||
592 | memcpy(stream + IW_EV_LCP_LEN, | ||
593 | ((char *) iwe) + IW_EV_LCP_LEN + IW_EV_POINT_OFF, | ||
594 | IW_EV_POINT_LEN - IW_EV_LCP_LEN); | ||
595 | memcpy(stream + IW_EV_POINT_LEN, extra, iwe->u.data.length); | ||
596 | stream += event_len; | ||
597 | } else | ||
598 | *perr = -E2BIG; | ||
599 | return stream; | ||
600 | } | ||
601 | |||
602 | /*------------------------------------------------------------------*/ | ||
603 | /* | ||
604 | * Wrapper to add a value to a Wireless Event in a stream of events. | ||
605 | * Be careful, this one is tricky to use properly : | ||
606 | * At the first run, you need to have (value = event + IW_EV_LCP_LEN). | ||
607 | * Same as above, with explicit error check... | ||
608 | */ | ||
609 | static inline char * | ||
610 | iwe_stream_check_add_value(char * event, /* Event in the stream */ | ||
611 | char * value, /* Value in event */ | ||
612 | char * ends, /* End of stream */ | ||
613 | struct iw_event *iwe, /* Payload */ | ||
614 | int event_len, /* Size of payload */ | ||
615 | int * perr) /* Error report */ | ||
616 | { | ||
617 | /* Don't duplicate LCP */ | ||
618 | event_len -= IW_EV_LCP_LEN; | ||
619 | |||
620 | /* Check if it's possible */ | ||
621 | if(likely((value + event_len) < ends)) { | ||
622 | /* Add new value */ | ||
623 | memcpy(value, (char *) iwe + IW_EV_LCP_LEN, event_len); | ||
624 | value += event_len; | ||
625 | /* Patch LCP */ | ||
626 | iwe->len = value - event; | ||
627 | memcpy(event, (char *) iwe, IW_EV_LCP_LEN); | ||
628 | } else | ||
629 | *perr = -E2BIG; | ||
630 | return value; | ||
631 | } | ||
632 | |||
540 | #endif /* _IW_HANDLER_H */ | 633 | #endif /* _IW_HANDLER_H */ |