diff options
Diffstat (limited to 'include/net/iw_handler.h')
-rw-r--r-- | include/net/iw_handler.h | 51 |
1 files changed, 22 insertions, 29 deletions
diff --git a/include/net/iw_handler.h b/include/net/iw_handler.h index 10559e937d27..f23d07ca7c59 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 : 7 18.3.05 | 4 | * Version : 8 16.3.07 |
5 | * | 5 | * |
6 | * Authors : Jean Tourrilhes - HPL - <jt@hpl.hp.com> | 6 | * Authors : Jean Tourrilhes - HPL - <jt@hpl.hp.com> |
7 | * Copyright (c) 2001-2006 Jean Tourrilhes, All Rights Reserved. | 7 | * Copyright (c) 2001-2007 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 7 | 210 | #define IW_HANDLER_VERSION 8 |
211 | 211 | ||
212 | /* | 212 | /* |
213 | * Changes : | 213 | * Changes : |
@@ -239,6 +239,10 @@ | |||
239 | * - Remove (struct iw_point *)->pointer from events and streams | 239 | * - Remove (struct iw_point *)->pointer from events and streams |
240 | * - Remove spy_offset from struct iw_handler_def | 240 | * - Remove spy_offset from struct iw_handler_def |
241 | * - Add "check" version of event macros for ieee802.11 stack | 241 | * - Add "check" version of event macros for ieee802.11 stack |
242 | * | ||
243 | * V7 to V8 | ||
244 | * ---------- | ||
245 | * - Prevent leaking of kernel space in stream on 64 bits. | ||
242 | */ | 246 | */ |
243 | 247 | ||
244 | /**************************** CONSTANTS ****************************/ | 248 | /**************************** CONSTANTS ****************************/ |
@@ -427,26 +431,7 @@ struct iw_public_data { | |||
427 | * Those may be called only within the kernel. | 431 | * Those may be called only within the kernel. |
428 | */ | 432 | */ |
429 | 433 | ||
430 | /* First : function strictly used inside the kernel */ | 434 | /* functions that may be called by driver modules */ |
431 | |||
432 | /* Handle /proc/net/wireless, called in net/code/dev.c */ | ||
433 | extern int dev_get_wireless_info(char * buffer, char **start, off_t offset, | ||
434 | int length); | ||
435 | |||
436 | /* Handle IOCTLs, called in net/core/dev.c */ | ||
437 | extern int wireless_process_ioctl(struct ifreq *ifr, unsigned int cmd); | ||
438 | |||
439 | /* Handle RtNetlink requests, called in net/core/rtnetlink.c */ | ||
440 | extern int wireless_rtnetlink_set(struct net_device * dev, | ||
441 | char * data, | ||
442 | int len); | ||
443 | extern int wireless_rtnetlink_get(struct net_device * dev, | ||
444 | char * data, | ||
445 | int len, | ||
446 | char ** p_buf, | ||
447 | int * p_len); | ||
448 | |||
449 | /* Second : functions that may be called by driver modules */ | ||
450 | 435 | ||
451 | /* Send a single event to user space */ | 436 | /* Send a single event to user space */ |
452 | extern void wireless_send_event(struct net_device * dev, | 437 | extern void wireless_send_event(struct net_device * dev, |
@@ -500,7 +485,11 @@ iwe_stream_add_event(char * stream, /* Stream of events */ | |||
500 | /* Check if it's possible */ | 485 | /* Check if it's possible */ |
501 | if(likely((stream + event_len) < ends)) { | 486 | if(likely((stream + event_len) < ends)) { |
502 | iwe->len = event_len; | 487 | iwe->len = event_len; |
503 | memcpy(stream, (char *) iwe, event_len); | 488 | /* Beware of alignement issues on 64 bits */ |
489 | memcpy(stream, (char *) iwe, IW_EV_LCP_PK_LEN); | ||
490 | memcpy(stream + IW_EV_LCP_LEN, | ||
491 | ((char *) iwe) + IW_EV_LCP_LEN, | ||
492 | event_len - IW_EV_LCP_LEN); | ||
504 | stream += event_len; | 493 | stream += event_len; |
505 | } | 494 | } |
506 | return stream; | 495 | return stream; |
@@ -521,10 +510,10 @@ iwe_stream_add_point(char * stream, /* Stream of events */ | |||
521 | /* Check if it's possible */ | 510 | /* Check if it's possible */ |
522 | if(likely((stream + event_len) < ends)) { | 511 | if(likely((stream + event_len) < ends)) { |
523 | iwe->len = event_len; | 512 | iwe->len = event_len; |
524 | memcpy(stream, (char *) iwe, IW_EV_LCP_LEN); | 513 | memcpy(stream, (char *) iwe, IW_EV_LCP_PK_LEN); |
525 | memcpy(stream + IW_EV_LCP_LEN, | 514 | memcpy(stream + IW_EV_LCP_LEN, |
526 | ((char *) iwe) + IW_EV_LCP_LEN + IW_EV_POINT_OFF, | 515 | ((char *) iwe) + IW_EV_LCP_LEN + IW_EV_POINT_OFF, |
527 | IW_EV_POINT_LEN - IW_EV_LCP_LEN); | 516 | IW_EV_POINT_PK_LEN - IW_EV_LCP_PK_LEN); |
528 | memcpy(stream + IW_EV_POINT_LEN, extra, iwe->u.data.length); | 517 | memcpy(stream + IW_EV_POINT_LEN, extra, iwe->u.data.length); |
529 | stream += event_len; | 518 | stream += event_len; |
530 | } | 519 | } |
@@ -574,7 +563,11 @@ iwe_stream_check_add_event(char * stream, /* Stream of events */ | |||
574 | /* Check if it's possible, set error if not */ | 563 | /* Check if it's possible, set error if not */ |
575 | if(likely((stream + event_len) < ends)) { | 564 | if(likely((stream + event_len) < ends)) { |
576 | iwe->len = event_len; | 565 | iwe->len = event_len; |
577 | memcpy(stream, (char *) iwe, event_len); | 566 | /* Beware of alignement issues on 64 bits */ |
567 | memcpy(stream, (char *) iwe, IW_EV_LCP_PK_LEN); | ||
568 | memcpy(stream + IW_EV_LCP_LEN, | ||
569 | ((char *) iwe) + IW_EV_LCP_LEN, | ||
570 | event_len - IW_EV_LCP_LEN); | ||
578 | stream += event_len; | 571 | stream += event_len; |
579 | } else | 572 | } else |
580 | *perr = -E2BIG; | 573 | *perr = -E2BIG; |
@@ -598,10 +591,10 @@ iwe_stream_check_add_point(char * stream, /* Stream of events */ | |||
598 | /* Check if it's possible */ | 591 | /* Check if it's possible */ |
599 | if(likely((stream + event_len) < ends)) { | 592 | if(likely((stream + event_len) < ends)) { |
600 | iwe->len = event_len; | 593 | iwe->len = event_len; |
601 | memcpy(stream, (char *) iwe, IW_EV_LCP_LEN); | 594 | memcpy(stream, (char *) iwe, IW_EV_LCP_PK_LEN); |
602 | memcpy(stream + IW_EV_LCP_LEN, | 595 | memcpy(stream + IW_EV_LCP_LEN, |
603 | ((char *) iwe) + IW_EV_LCP_LEN + IW_EV_POINT_OFF, | 596 | ((char *) iwe) + IW_EV_LCP_LEN + IW_EV_POINT_OFF, |
604 | IW_EV_POINT_LEN - IW_EV_LCP_LEN); | 597 | IW_EV_POINT_PK_LEN - IW_EV_LCP_PK_LEN); |
605 | memcpy(stream + IW_EV_POINT_LEN, extra, iwe->u.data.length); | 598 | memcpy(stream + IW_EV_POINT_LEN, extra, iwe->u.data.length); |
606 | stream += event_len; | 599 | stream += event_len; |
607 | } else | 600 | } else |