diff options
author | David S. Miller <davem@davemloft.net> | 2008-06-29 01:57:58 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-06-29 01:57:58 -0400 |
commit | 28f49d8fec19833672a6a813bfde0068fee50bc9 (patch) | |
tree | 6905c5cabc063e44b891ae0af5b5d7cce69e6e71 /include | |
parent | 332e4af80d1214fbf0e263e1408fc7c5b64ecdd6 (diff) | |
parent | ff28bd94e307c67abb1bccda5d3a9018bd798e08 (diff) |
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/linville/wireless-next-2.6
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/ieee80211.h | 64 | ||||
-rw-r--r-- | include/linux/nl80211.h | 5 | ||||
-rw-r--r-- | include/linux/rfkill.h | 46 | ||||
-rw-r--r-- | include/linux/ssb/ssb.h | 143 | ||||
-rw-r--r-- | include/linux/wireless.h | 28 | ||||
-rw-r--r-- | include/net/iw_handler.h | 151 | ||||
-rw-r--r-- | include/net/mac80211.h | 14 | ||||
-rw-r--r-- | include/net/wext.h | 7 |
8 files changed, 342 insertions, 116 deletions
diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h index 2998e3b5f166..cffd6d0094f9 100644 --- a/include/linux/ieee80211.h +++ b/include/linux/ieee80211.h | |||
@@ -469,6 +469,40 @@ struct ieee80211s_hdr { | |||
469 | u8 eaddr3[6]; | 469 | u8 eaddr3[6]; |
470 | } __attribute__ ((packed)); | 470 | } __attribute__ ((packed)); |
471 | 471 | ||
472 | /** | ||
473 | * struct ieee80211_quiet_ie | ||
474 | * | ||
475 | * This structure refers to "Quiet information element" | ||
476 | */ | ||
477 | struct ieee80211_quiet_ie { | ||
478 | u8 count; | ||
479 | u8 period; | ||
480 | __le16 duration; | ||
481 | __le16 offset; | ||
482 | } __attribute__ ((packed)); | ||
483 | |||
484 | /** | ||
485 | * struct ieee80211_msrment_ie | ||
486 | * | ||
487 | * This structure refers to "Measurement Request/Report information element" | ||
488 | */ | ||
489 | struct ieee80211_msrment_ie { | ||
490 | u8 token; | ||
491 | u8 mode; | ||
492 | u8 type; | ||
493 | u8 request[0]; | ||
494 | } __attribute__ ((packed)); | ||
495 | |||
496 | /** | ||
497 | * struct ieee80211_channel_sw_ie | ||
498 | * | ||
499 | * This structure refers to "Channel Switch Announcement information element" | ||
500 | */ | ||
501 | struct ieee80211_channel_sw_ie { | ||
502 | u8 mode; | ||
503 | u8 new_ch_num; | ||
504 | u8 count; | ||
505 | } __attribute__ ((packed)); | ||
472 | 506 | ||
473 | struct ieee80211_mgmt { | 507 | struct ieee80211_mgmt { |
474 | __le16 frame_control; | 508 | __le16 frame_control; |
@@ -544,13 +578,18 @@ struct ieee80211_mgmt { | |||
544 | u8 action_code; | 578 | u8 action_code; |
545 | u8 element_id; | 579 | u8 element_id; |
546 | u8 length; | 580 | u8 length; |
547 | u8 switch_mode; | 581 | struct ieee80211_channel_sw_ie sw_elem; |
548 | u8 new_chan; | ||
549 | u8 switch_count; | ||
550 | } __attribute__((packed)) chan_switch; | 582 | } __attribute__((packed)) chan_switch; |
551 | struct{ | 583 | struct{ |
552 | u8 action_code; | 584 | u8 action_code; |
553 | u8 dialog_token; | 585 | u8 dialog_token; |
586 | u8 element_id; | ||
587 | u8 length; | ||
588 | struct ieee80211_msrment_ie msr_elem; | ||
589 | } __attribute__((packed)) measurement; | ||
590 | struct{ | ||
591 | u8 action_code; | ||
592 | u8 dialog_token; | ||
554 | __le16 capab; | 593 | __le16 capab; |
555 | __le16 timeout; | 594 | __le16 timeout; |
556 | __le16 start_seq_num; | 595 | __le16 start_seq_num; |
@@ -700,11 +739,21 @@ struct ieee80211_ht_addt_info { | |||
700 | #define WLAN_CAPABILITY_SHORT_PREAMBLE (1<<5) | 739 | #define WLAN_CAPABILITY_SHORT_PREAMBLE (1<<5) |
701 | #define WLAN_CAPABILITY_PBCC (1<<6) | 740 | #define WLAN_CAPABILITY_PBCC (1<<6) |
702 | #define WLAN_CAPABILITY_CHANNEL_AGILITY (1<<7) | 741 | #define WLAN_CAPABILITY_CHANNEL_AGILITY (1<<7) |
742 | |||
703 | /* 802.11h */ | 743 | /* 802.11h */ |
704 | #define WLAN_CAPABILITY_SPECTRUM_MGMT (1<<8) | 744 | #define WLAN_CAPABILITY_SPECTRUM_MGMT (1<<8) |
705 | #define WLAN_CAPABILITY_QOS (1<<9) | 745 | #define WLAN_CAPABILITY_QOS (1<<9) |
706 | #define WLAN_CAPABILITY_SHORT_SLOT_TIME (1<<10) | 746 | #define WLAN_CAPABILITY_SHORT_SLOT_TIME (1<<10) |
707 | #define WLAN_CAPABILITY_DSSS_OFDM (1<<13) | 747 | #define WLAN_CAPABILITY_DSSS_OFDM (1<<13) |
748 | /* measurement */ | ||
749 | #define IEEE80211_SPCT_MSR_RPRT_MODE_LATE (1<<0) | ||
750 | #define IEEE80211_SPCT_MSR_RPRT_MODE_INCAPABLE (1<<1) | ||
751 | #define IEEE80211_SPCT_MSR_RPRT_MODE_REFUSED (1<<2) | ||
752 | |||
753 | #define IEEE80211_SPCT_MSR_RPRT_TYPE_BASIC 0 | ||
754 | #define IEEE80211_SPCT_MSR_RPRT_TYPE_CCA 1 | ||
755 | #define IEEE80211_SPCT_MSR_RPRT_TYPE_RPI 2 | ||
756 | |||
708 | 757 | ||
709 | /* 802.11g ERP information element */ | 758 | /* 802.11g ERP information element */ |
710 | #define WLAN_ERP_NON_ERP_PRESENT (1<<0) | 759 | #define WLAN_ERP_NON_ERP_PRESENT (1<<0) |
@@ -875,6 +924,15 @@ enum ieee80211_category { | |||
875 | WLAN_CATEGORY_WMM = 17, | 924 | WLAN_CATEGORY_WMM = 17, |
876 | }; | 925 | }; |
877 | 926 | ||
927 | /* SPECTRUM_MGMT action code */ | ||
928 | enum ieee80211_spectrum_mgmt_actioncode { | ||
929 | WLAN_ACTION_SPCT_MSR_REQ = 0, | ||
930 | WLAN_ACTION_SPCT_MSR_RPRT = 1, | ||
931 | WLAN_ACTION_SPCT_TPC_REQ = 2, | ||
932 | WLAN_ACTION_SPCT_TPC_RPRT = 3, | ||
933 | WLAN_ACTION_SPCT_CHL_SWITCH = 4, | ||
934 | }; | ||
935 | |||
878 | /* BACK action code */ | 936 | /* BACK action code */ |
879 | enum ieee80211_back_actioncode { | 937 | enum ieee80211_back_actioncode { |
880 | WLAN_ACTION_ADDBA_REQ = 0, | 938 | WLAN_ACTION_ADDBA_REQ = 0, |
diff --git a/include/linux/nl80211.h b/include/linux/nl80211.h index aa8411e2a160..2be7c63bc0f2 100644 --- a/include/linux/nl80211.h +++ b/include/linux/nl80211.h | |||
@@ -241,7 +241,10 @@ enum nl80211_attrs { | |||
241 | NL80211_ATTR_MAX = __NL80211_ATTR_AFTER_LAST - 1 | 241 | NL80211_ATTR_MAX = __NL80211_ATTR_AFTER_LAST - 1 |
242 | }; | 242 | }; |
243 | 243 | ||
244 | #define NL80211_MAX_SUPP_RATES 32 | 244 | #define NL80211_MAX_SUPP_RATES 32 |
245 | #define NL80211_TKIP_DATA_OFFSET_ENCR_KEY 0 | ||
246 | #define NL80211_TKIP_DATA_OFFSET_TX_MIC_KEY 16 | ||
247 | #define NL80211_TKIP_DATA_OFFSET_RX_MIC_KEY 24 | ||
245 | 248 | ||
246 | /** | 249 | /** |
247 | * enum nl80211_iftype - (virtual) interface types | 250 | * enum nl80211_iftype - (virtual) interface types |
diff --git a/include/linux/rfkill.h b/include/linux/rfkill.h index e3ab21d7fc7f..c5f6e54ec6ae 100644 --- a/include/linux/rfkill.h +++ b/include/linux/rfkill.h | |||
@@ -34,26 +34,37 @@ | |||
34 | * RFKILL_TYPE_BLUETOOTH: switch is on a bluetooth device. | 34 | * RFKILL_TYPE_BLUETOOTH: switch is on a bluetooth device. |
35 | * RFKILL_TYPE_UWB: switch is on a ultra wideband device. | 35 | * RFKILL_TYPE_UWB: switch is on a ultra wideband device. |
36 | * RFKILL_TYPE_WIMAX: switch is on a WiMAX device. | 36 | * RFKILL_TYPE_WIMAX: switch is on a WiMAX device. |
37 | * RFKILL_TYPE_WWAN: switch is on a wireless WAN device. | ||
37 | */ | 38 | */ |
38 | enum rfkill_type { | 39 | enum rfkill_type { |
39 | RFKILL_TYPE_WLAN , | 40 | RFKILL_TYPE_WLAN , |
40 | RFKILL_TYPE_BLUETOOTH, | 41 | RFKILL_TYPE_BLUETOOTH, |
41 | RFKILL_TYPE_UWB, | 42 | RFKILL_TYPE_UWB, |
42 | RFKILL_TYPE_WIMAX, | 43 | RFKILL_TYPE_WIMAX, |
44 | RFKILL_TYPE_WWAN, | ||
43 | RFKILL_TYPE_MAX, | 45 | RFKILL_TYPE_MAX, |
44 | }; | 46 | }; |
45 | 47 | ||
46 | enum rfkill_state { | 48 | enum rfkill_state { |
47 | RFKILL_STATE_OFF = 0, | 49 | RFKILL_STATE_SOFT_BLOCKED = 0, /* Radio output blocked */ |
48 | RFKILL_STATE_ON = 1, | 50 | RFKILL_STATE_UNBLOCKED = 1, /* Radio output allowed */ |
51 | RFKILL_STATE_HARD_BLOCKED = 2, /* Output blocked, non-overrideable */ | ||
49 | }; | 52 | }; |
50 | 53 | ||
54 | /* | ||
55 | * These are DEPRECATED, drivers using them should be verified to | ||
56 | * comply with the rfkill usage guidelines in Documentation/rfkill.txt | ||
57 | * and then converted to use the new names for rfkill_state | ||
58 | */ | ||
59 | #define RFKILL_STATE_OFF RFKILL_STATE_SOFT_BLOCKED | ||
60 | #define RFKILL_STATE_ON RFKILL_STATE_UNBLOCKED | ||
61 | |||
51 | /** | 62 | /** |
52 | * struct rfkill - rfkill control structure. | 63 | * struct rfkill - rfkill control structure. |
53 | * @name: Name of the switch. | 64 | * @name: Name of the switch. |
54 | * @type: Radio type which the button controls, the value stored | 65 | * @type: Radio type which the button controls, the value stored |
55 | * here should be a value from enum rfkill_type. | 66 | * here should be a value from enum rfkill_type. |
56 | * @state: State of the switch (on/off). | 67 | * @state: State of the switch, "UNBLOCKED" means radio can operate. |
57 | * @user_claim_unsupported: Whether the hardware supports exclusive | 68 | * @user_claim_unsupported: Whether the hardware supports exclusive |
58 | * RF-kill control by userspace. Set this before registering. | 69 | * RF-kill control by userspace. Set this before registering. |
59 | * @user_claim: Set when the switch is controlled exlusively by userspace. | 70 | * @user_claim: Set when the switch is controlled exlusively by userspace. |
@@ -61,6 +72,12 @@ enum rfkill_state { | |||
61 | * @data: Pointer to the RF button drivers private data which will be | 72 | * @data: Pointer to the RF button drivers private data which will be |
62 | * passed along when toggling radio state. | 73 | * passed along when toggling radio state. |
63 | * @toggle_radio(): Mandatory handler to control state of the radio. | 74 | * @toggle_radio(): Mandatory handler to control state of the radio. |
75 | * only RFKILL_STATE_SOFT_BLOCKED and RFKILL_STATE_UNBLOCKED are | ||
76 | * valid parameters. | ||
77 | * @get_state(): handler to read current radio state from hardware, | ||
78 | * may be called from atomic context, should return 0 on success. | ||
79 | * Either this handler OR judicious use of rfkill_force_state() is | ||
80 | * MANDATORY for any driver capable of RFKILL_STATE_HARD_BLOCKED. | ||
64 | * @led_trigger: A LED trigger for this button's LED. | 81 | * @led_trigger: A LED trigger for this button's LED. |
65 | * @dev: Device structure integrating the switch into device tree. | 82 | * @dev: Device structure integrating the switch into device tree. |
66 | * @node: Used to place switch into list of all switches known to the | 83 | * @node: Used to place switch into list of all switches known to the |
@@ -80,6 +97,7 @@ struct rfkill { | |||
80 | 97 | ||
81 | void *data; | 98 | void *data; |
82 | int (*toggle_radio)(void *data, enum rfkill_state state); | 99 | int (*toggle_radio)(void *data, enum rfkill_state state); |
100 | int (*get_state)(void *data, enum rfkill_state *state); | ||
83 | 101 | ||
84 | #ifdef CONFIG_RFKILL_LEDS | 102 | #ifdef CONFIG_RFKILL_LEDS |
85 | struct led_trigger led_trigger; | 103 | struct led_trigger led_trigger; |
@@ -95,6 +113,21 @@ void rfkill_free(struct rfkill *rfkill); | |||
95 | int rfkill_register(struct rfkill *rfkill); | 113 | int rfkill_register(struct rfkill *rfkill); |
96 | void rfkill_unregister(struct rfkill *rfkill); | 114 | void rfkill_unregister(struct rfkill *rfkill); |
97 | 115 | ||
116 | int rfkill_force_state(struct rfkill *rfkill, enum rfkill_state state); | ||
117 | |||
118 | /** | ||
119 | * rfkill_state_complement - return complementar state | ||
120 | * @state: state to return the complement of | ||
121 | * | ||
122 | * Returns RFKILL_STATE_SOFT_BLOCKED if @state is RFKILL_STATE_UNBLOCKED, | ||
123 | * returns RFKILL_STATE_UNBLOCKED otherwise. | ||
124 | */ | ||
125 | static inline enum rfkill_state rfkill_state_complement(enum rfkill_state state) | ||
126 | { | ||
127 | return (state == RFKILL_STATE_UNBLOCKED) ? | ||
128 | RFKILL_STATE_SOFT_BLOCKED : RFKILL_STATE_UNBLOCKED; | ||
129 | } | ||
130 | |||
98 | /** | 131 | /** |
99 | * rfkill_get_led_name - Get the LED trigger name for the button's LED. | 132 | * rfkill_get_led_name - Get the LED trigger name for the button's LED. |
100 | * This function might return a NULL pointer if registering of the | 133 | * This function might return a NULL pointer if registering of the |
@@ -110,4 +143,11 @@ static inline char *rfkill_get_led_name(struct rfkill *rfkill) | |||
110 | #endif | 143 | #endif |
111 | } | 144 | } |
112 | 145 | ||
146 | /* rfkill notification chain */ | ||
147 | #define RFKILL_STATE_CHANGED 0x0001 /* state of a normal rfkill | ||
148 | switch has changed */ | ||
149 | |||
150 | int register_rfkill_notifier(struct notifier_block *nb); | ||
151 | int unregister_rfkill_notifier(struct notifier_block *nb); | ||
152 | |||
113 | #endif /* RFKILL_H */ | 153 | #endif /* RFKILL_H */ |
diff --git a/include/linux/ssb/ssb.h b/include/linux/ssb/ssb.h index 50dfd0dc4093..0fe5a0ded3ea 100644 --- a/include/linux/ssb/ssb.h +++ b/include/linux/ssb/ssb.h | |||
@@ -137,9 +137,6 @@ struct ssb_device { | |||
137 | const struct ssb_bus_ops *ops; | 137 | const struct ssb_bus_ops *ops; |
138 | 138 | ||
139 | struct device *dev; | 139 | struct device *dev; |
140 | /* Pointer to the device that has to be used for | ||
141 | * any DMA related operation. */ | ||
142 | struct device *dma_dev; | ||
143 | 140 | ||
144 | struct ssb_bus *bus; | 141 | struct ssb_bus *bus; |
145 | struct ssb_device_id id; | 142 | struct ssb_device_id id; |
@@ -399,13 +396,151 @@ static inline void ssb_block_write(struct ssb_device *dev, const void *buffer, | |||
399 | #endif /* CONFIG_SSB_BLOCKIO */ | 396 | #endif /* CONFIG_SSB_BLOCKIO */ |
400 | 397 | ||
401 | 398 | ||
399 | /* The SSB DMA API. Use this API for any DMA operation on the device. | ||
400 | * This API basically is a wrapper that calls the correct DMA API for | ||
401 | * the host device type the SSB device is attached to. */ | ||
402 | |||
402 | /* Translation (routing) bits that need to be ORed to DMA | 403 | /* Translation (routing) bits that need to be ORed to DMA |
403 | * addresses before they are given to a device. */ | 404 | * addresses before they are given to a device. */ |
404 | extern u32 ssb_dma_translation(struct ssb_device *dev); | 405 | extern u32 ssb_dma_translation(struct ssb_device *dev); |
405 | #define SSB_DMA_TRANSLATION_MASK 0xC0000000 | 406 | #define SSB_DMA_TRANSLATION_MASK 0xC0000000 |
406 | #define SSB_DMA_TRANSLATION_SHIFT 30 | 407 | #define SSB_DMA_TRANSLATION_SHIFT 30 |
407 | 408 | ||
408 | extern int ssb_dma_set_mask(struct ssb_device *ssb_dev, u64 mask); | 409 | extern int ssb_dma_set_mask(struct ssb_device *dev, u64 mask); |
410 | |||
411 | extern void * ssb_dma_alloc_consistent(struct ssb_device *dev, size_t size, | ||
412 | dma_addr_t *dma_handle, gfp_t gfp_flags); | ||
413 | extern void ssb_dma_free_consistent(struct ssb_device *dev, size_t size, | ||
414 | void *vaddr, dma_addr_t dma_handle, | ||
415 | gfp_t gfp_flags); | ||
416 | |||
417 | static inline void __cold __ssb_dma_not_implemented(struct ssb_device *dev) | ||
418 | { | ||
419 | #ifdef CONFIG_SSB_DEBUG | ||
420 | printk(KERN_ERR "SSB: BUG! Calling DMA API for " | ||
421 | "unsupported bustype %d\n", dev->bus->bustype); | ||
422 | #endif /* DEBUG */ | ||
423 | } | ||
424 | |||
425 | static inline int ssb_dma_mapping_error(struct ssb_device *dev, dma_addr_t addr) | ||
426 | { | ||
427 | switch (dev->bus->bustype) { | ||
428 | case SSB_BUSTYPE_PCI: | ||
429 | return pci_dma_mapping_error(addr); | ||
430 | case SSB_BUSTYPE_SSB: | ||
431 | return dma_mapping_error(addr); | ||
432 | default: | ||
433 | __ssb_dma_not_implemented(dev); | ||
434 | } | ||
435 | return -ENOSYS; | ||
436 | } | ||
437 | |||
438 | static inline dma_addr_t ssb_dma_map_single(struct ssb_device *dev, void *p, | ||
439 | size_t size, enum dma_data_direction dir) | ||
440 | { | ||
441 | switch (dev->bus->bustype) { | ||
442 | case SSB_BUSTYPE_PCI: | ||
443 | return pci_map_single(dev->bus->host_pci, p, size, dir); | ||
444 | case SSB_BUSTYPE_SSB: | ||
445 | return dma_map_single(dev->dev, p, size, dir); | ||
446 | default: | ||
447 | __ssb_dma_not_implemented(dev); | ||
448 | } | ||
449 | return 0; | ||
450 | } | ||
451 | |||
452 | static inline void ssb_dma_unmap_single(struct ssb_device *dev, dma_addr_t dma_addr, | ||
453 | size_t size, enum dma_data_direction dir) | ||
454 | { | ||
455 | switch (dev->bus->bustype) { | ||
456 | case SSB_BUSTYPE_PCI: | ||
457 | pci_unmap_single(dev->bus->host_pci, dma_addr, size, dir); | ||
458 | return; | ||
459 | case SSB_BUSTYPE_SSB: | ||
460 | dma_unmap_single(dev->dev, dma_addr, size, dir); | ||
461 | return; | ||
462 | default: | ||
463 | __ssb_dma_not_implemented(dev); | ||
464 | } | ||
465 | } | ||
466 | |||
467 | static inline void ssb_dma_sync_single_for_cpu(struct ssb_device *dev, | ||
468 | dma_addr_t dma_addr, | ||
469 | size_t size, | ||
470 | enum dma_data_direction dir) | ||
471 | { | ||
472 | switch (dev->bus->bustype) { | ||
473 | case SSB_BUSTYPE_PCI: | ||
474 | pci_dma_sync_single_for_cpu(dev->bus->host_pci, dma_addr, | ||
475 | size, dir); | ||
476 | return; | ||
477 | case SSB_BUSTYPE_SSB: | ||
478 | dma_sync_single_for_cpu(dev->dev, dma_addr, size, dir); | ||
479 | return; | ||
480 | default: | ||
481 | __ssb_dma_not_implemented(dev); | ||
482 | } | ||
483 | } | ||
484 | |||
485 | static inline void ssb_dma_sync_single_for_device(struct ssb_device *dev, | ||
486 | dma_addr_t dma_addr, | ||
487 | size_t size, | ||
488 | enum dma_data_direction dir) | ||
489 | { | ||
490 | switch (dev->bus->bustype) { | ||
491 | case SSB_BUSTYPE_PCI: | ||
492 | pci_dma_sync_single_for_device(dev->bus->host_pci, dma_addr, | ||
493 | size, dir); | ||
494 | return; | ||
495 | case SSB_BUSTYPE_SSB: | ||
496 | dma_sync_single_for_device(dev->dev, dma_addr, size, dir); | ||
497 | return; | ||
498 | default: | ||
499 | __ssb_dma_not_implemented(dev); | ||
500 | } | ||
501 | } | ||
502 | |||
503 | static inline void ssb_dma_sync_single_range_for_cpu(struct ssb_device *dev, | ||
504 | dma_addr_t dma_addr, | ||
505 | unsigned long offset, | ||
506 | size_t size, | ||
507 | enum dma_data_direction dir) | ||
508 | { | ||
509 | switch (dev->bus->bustype) { | ||
510 | case SSB_BUSTYPE_PCI: | ||
511 | /* Just sync everything. That's all the PCI API can do. */ | ||
512 | pci_dma_sync_single_for_cpu(dev->bus->host_pci, dma_addr, | ||
513 | offset + size, dir); | ||
514 | return; | ||
515 | case SSB_BUSTYPE_SSB: | ||
516 | dma_sync_single_range_for_cpu(dev->dev, dma_addr, offset, | ||
517 | size, dir); | ||
518 | return; | ||
519 | default: | ||
520 | __ssb_dma_not_implemented(dev); | ||
521 | } | ||
522 | } | ||
523 | |||
524 | static inline void ssb_dma_sync_single_range_for_device(struct ssb_device *dev, | ||
525 | dma_addr_t dma_addr, | ||
526 | unsigned long offset, | ||
527 | size_t size, | ||
528 | enum dma_data_direction dir) | ||
529 | { | ||
530 | switch (dev->bus->bustype) { | ||
531 | case SSB_BUSTYPE_PCI: | ||
532 | /* Just sync everything. That's all the PCI API can do. */ | ||
533 | pci_dma_sync_single_for_device(dev->bus->host_pci, dma_addr, | ||
534 | offset + size, dir); | ||
535 | return; | ||
536 | case SSB_BUSTYPE_SSB: | ||
537 | dma_sync_single_range_for_device(dev->dev, dma_addr, offset, | ||
538 | size, dir); | ||
539 | return; | ||
540 | default: | ||
541 | __ssb_dma_not_implemented(dev); | ||
542 | } | ||
543 | } | ||
409 | 544 | ||
410 | 545 | ||
411 | #ifdef CONFIG_SSB_PCIHOST | 546 | #ifdef CONFIG_SSB_PCIHOST |
diff --git a/include/linux/wireless.h b/include/linux/wireless.h index 4a95a0e5eeca..d7958f9b52cb 100644 --- a/include/linux/wireless.h +++ b/include/linux/wireless.h | |||
@@ -677,6 +677,19 @@ struct iw_point | |||
677 | __u16 flags; /* Optional params */ | 677 | __u16 flags; /* Optional params */ |
678 | }; | 678 | }; |
679 | 679 | ||
680 | #ifdef __KERNEL__ | ||
681 | #ifdef CONFIG_COMPAT | ||
682 | |||
683 | #include <linux/compat.h> | ||
684 | |||
685 | struct compat_iw_point { | ||
686 | compat_caddr_t pointer; | ||
687 | __u16 length; | ||
688 | __u16 flags; | ||
689 | }; | ||
690 | #endif | ||
691 | #endif | ||
692 | |||
680 | /* | 693 | /* |
681 | * A frequency | 694 | * A frequency |
682 | * For numbers lower than 10^9, we encode the number in 'm' and | 695 | * For numbers lower than 10^9, we encode the number in 'm' and |
@@ -1100,6 +1113,21 @@ struct iw_event | |||
1100 | #define IW_EV_POINT_LEN (IW_EV_LCP_LEN + sizeof(struct iw_point) - \ | 1113 | #define IW_EV_POINT_LEN (IW_EV_LCP_LEN + sizeof(struct iw_point) - \ |
1101 | IW_EV_POINT_OFF) | 1114 | IW_EV_POINT_OFF) |
1102 | 1115 | ||
1116 | #ifdef __KERNEL__ | ||
1117 | #ifdef CONFIG_COMPAT | ||
1118 | struct __compat_iw_event { | ||
1119 | __u16 len; /* Real length of this stuff */ | ||
1120 | __u16 cmd; /* Wireless IOCTL */ | ||
1121 | compat_caddr_t pointer; | ||
1122 | }; | ||
1123 | #define IW_EV_COMPAT_LCP_LEN offsetof(struct __compat_iw_event, pointer) | ||
1124 | #define IW_EV_COMPAT_POINT_OFF offsetof(struct compat_iw_point, length) | ||
1125 | #define IW_EV_COMPAT_POINT_LEN \ | ||
1126 | (IW_EV_COMPAT_LCP_LEN + sizeof(struct compat_iw_point) - \ | ||
1127 | IW_EV_COMPAT_POINT_OFF) | ||
1128 | #endif | ||
1129 | #endif | ||
1130 | |||
1103 | /* Size of the Event prefix when packed in stream */ | 1131 | /* Size of the Event prefix when packed in stream */ |
1104 | #define IW_EV_LCP_PK_LEN (4) | 1132 | #define IW_EV_LCP_PK_LEN (4) |
1105 | /* Size of the various events when packed in stream */ | 1133 | /* Size of the various events when packed in stream */ |
diff --git a/include/net/iw_handler.h b/include/net/iw_handler.h index 369d50e08b99..51b9a37de991 100644 --- a/include/net/iw_handler.h +++ b/include/net/iw_handler.h | |||
@@ -256,7 +256,7 @@ | |||
256 | #define EIWCOMMIT EINPROGRESS | 256 | #define EIWCOMMIT EINPROGRESS |
257 | 257 | ||
258 | /* Flags available in struct iw_request_info */ | 258 | /* Flags available in struct iw_request_info */ |
259 | #define IW_REQUEST_FLAG_NONE 0x0000 /* No flag so far */ | 259 | #define IW_REQUEST_FLAG_COMPAT 0x0001 /* Compat ioctl call */ |
260 | 260 | ||
261 | /* Type of headers we know about (basically union iwreq_data) */ | 261 | /* Type of headers we know about (basically union iwreq_data) */ |
262 | #define IW_HEADER_TYPE_NULL 0 /* Not available */ | 262 | #define IW_HEADER_TYPE_NULL 0 /* Not available */ |
@@ -478,105 +478,58 @@ extern void wireless_spy_update(struct net_device * dev, | |||
478 | * Function that are so simple that it's more efficient inlining them | 478 | * Function that are so simple that it's more efficient inlining them |
479 | */ | 479 | */ |
480 | 480 | ||
481 | /*------------------------------------------------------------------*/ | 481 | static inline int iwe_stream_lcp_len(struct iw_request_info *info) |
482 | /* | ||
483 | * Wrapper to add an Wireless Event to a stream of events. | ||
484 | */ | ||
485 | static inline char * | ||
486 | iwe_stream_add_event(char * stream, /* Stream of events */ | ||
487 | char * ends, /* End of stream */ | ||
488 | struct iw_event *iwe, /* Payload */ | ||
489 | int event_len) /* Real size of payload */ | ||
490 | { | 482 | { |
491 | /* Check if it's possible */ | 483 | #ifdef CONFIG_COMPAT |
492 | if(likely((stream + event_len) < ends)) { | 484 | if (info->flags & IW_REQUEST_FLAG_COMPAT) |
493 | iwe->len = event_len; | 485 | return IW_EV_COMPAT_LCP_LEN; |
494 | /* Beware of alignement issues on 64 bits */ | 486 | #endif |
495 | memcpy(stream, (char *) iwe, IW_EV_LCP_PK_LEN); | 487 | return IW_EV_LCP_LEN; |
496 | memcpy(stream + IW_EV_LCP_LEN, | ||
497 | ((char *) iwe) + IW_EV_LCP_LEN, | ||
498 | event_len - IW_EV_LCP_LEN); | ||
499 | stream += event_len; | ||
500 | } | ||
501 | return stream; | ||
502 | } | 488 | } |
503 | 489 | ||
504 | /*------------------------------------------------------------------*/ | 490 | static inline int iwe_stream_point_len(struct iw_request_info *info) |
505 | /* | ||
506 | * Wrapper to add an short Wireless Event containing a pointer to a | ||
507 | * stream of events. | ||
508 | */ | ||
509 | static inline char * | ||
510 | iwe_stream_add_point(char * stream, /* Stream of events */ | ||
511 | char * ends, /* End of stream */ | ||
512 | struct iw_event *iwe, /* Payload length + flags */ | ||
513 | char * extra) /* More payload */ | ||
514 | { | 491 | { |
515 | int event_len = IW_EV_POINT_LEN + iwe->u.data.length; | 492 | #ifdef CONFIG_COMPAT |
516 | /* Check if it's possible */ | 493 | if (info->flags & IW_REQUEST_FLAG_COMPAT) |
517 | if(likely((stream + event_len) < ends)) { | 494 | return IW_EV_COMPAT_POINT_LEN; |
518 | iwe->len = event_len; | 495 | #endif |
519 | memcpy(stream, (char *) iwe, IW_EV_LCP_PK_LEN); | 496 | return IW_EV_POINT_LEN; |
520 | memcpy(stream + IW_EV_LCP_LEN, | ||
521 | ((char *) iwe) + IW_EV_LCP_LEN + IW_EV_POINT_OFF, | ||
522 | IW_EV_POINT_PK_LEN - IW_EV_LCP_PK_LEN); | ||
523 | memcpy(stream + IW_EV_POINT_LEN, extra, iwe->u.data.length); | ||
524 | stream += event_len; | ||
525 | } | ||
526 | return stream; | ||
527 | } | 497 | } |
528 | 498 | ||
529 | /*------------------------------------------------------------------*/ | 499 | static inline int iwe_stream_event_len_adjust(struct iw_request_info *info, |
530 | /* | 500 | int event_len) |
531 | * Wrapper to add a value to a Wireless Event in a stream of events. | ||
532 | * Be careful, this one is tricky to use properly : | ||
533 | * At the first run, you need to have (value = event + IW_EV_LCP_LEN). | ||
534 | */ | ||
535 | static inline char * | ||
536 | iwe_stream_add_value(char * event, /* Event in the stream */ | ||
537 | char * value, /* Value in event */ | ||
538 | char * ends, /* End of stream */ | ||
539 | struct iw_event *iwe, /* Payload */ | ||
540 | int event_len) /* Real size of payload */ | ||
541 | { | 501 | { |
542 | /* Don't duplicate LCP */ | 502 | #ifdef CONFIG_COMPAT |
543 | event_len -= IW_EV_LCP_LEN; | 503 | if (info->flags & IW_REQUEST_FLAG_COMPAT) { |
544 | 504 | event_len -= IW_EV_LCP_LEN; | |
545 | /* Check if it's possible */ | 505 | event_len += IW_EV_COMPAT_LCP_LEN; |
546 | if(likely((value + event_len) < ends)) { | ||
547 | /* Add new value */ | ||
548 | memcpy(value, (char *) iwe + IW_EV_LCP_LEN, event_len); | ||
549 | value += event_len; | ||
550 | /* Patch LCP */ | ||
551 | iwe->len = value - event; | ||
552 | memcpy(event, (char *) iwe, IW_EV_LCP_LEN); | ||
553 | } | 506 | } |
554 | return value; | 507 | #endif |
508 | |||
509 | return event_len; | ||
555 | } | 510 | } |
556 | 511 | ||
557 | /*------------------------------------------------------------------*/ | 512 | /*------------------------------------------------------------------*/ |
558 | /* | 513 | /* |
559 | * Wrapper to add an Wireless Event to a stream of events. | 514 | * Wrapper to add an Wireless Event to a stream of events. |
560 | * Same as above, with explicit error check... | ||
561 | */ | 515 | */ |
562 | static inline char * | 516 | static inline char * |
563 | iwe_stream_check_add_event(char * stream, /* Stream of events */ | 517 | iwe_stream_add_event(struct iw_request_info *info, char *stream, char *ends, |
564 | char * ends, /* End of stream */ | 518 | struct iw_event *iwe, int event_len) |
565 | struct iw_event *iwe, /* Payload */ | ||
566 | int event_len, /* Size of payload */ | ||
567 | int * perr) /* Error report */ | ||
568 | { | 519 | { |
569 | /* Check if it's possible, set error if not */ | 520 | int lcp_len = iwe_stream_lcp_len(info); |
521 | |||
522 | event_len = iwe_stream_event_len_adjust(info, event_len); | ||
523 | |||
524 | /* Check if it's possible */ | ||
570 | if(likely((stream + event_len) < ends)) { | 525 | if(likely((stream + event_len) < ends)) { |
571 | iwe->len = event_len; | 526 | iwe->len = event_len; |
572 | /* Beware of alignement issues on 64 bits */ | 527 | /* Beware of alignement issues on 64 bits */ |
573 | memcpy(stream, (char *) iwe, IW_EV_LCP_PK_LEN); | 528 | memcpy(stream, (char *) iwe, IW_EV_LCP_PK_LEN); |
574 | memcpy(stream + IW_EV_LCP_LEN, | 529 | memcpy(stream + lcp_len, &iwe->u, |
575 | ((char *) iwe) + IW_EV_LCP_LEN, | 530 | event_len - lcp_len); |
576 | event_len - IW_EV_LCP_LEN); | ||
577 | stream += event_len; | 531 | stream += event_len; |
578 | } else | 532 | } |
579 | *perr = -E2BIG; | ||
580 | return stream; | 533 | return stream; |
581 | } | 534 | } |
582 | 535 | ||
@@ -584,27 +537,25 @@ iwe_stream_check_add_event(char * stream, /* Stream of events */ | |||
584 | /* | 537 | /* |
585 | * Wrapper to add an short Wireless Event containing a pointer to a | 538 | * Wrapper to add an short Wireless Event containing a pointer to a |
586 | * stream of events. | 539 | * stream of events. |
587 | * Same as above, with explicit error check... | ||
588 | */ | 540 | */ |
589 | static inline char * | 541 | static inline char * |
590 | iwe_stream_check_add_point(char * stream, /* Stream of events */ | 542 | iwe_stream_add_point(struct iw_request_info *info, char *stream, char *ends, |
591 | char * ends, /* End of stream */ | 543 | struct iw_event *iwe, char *extra) |
592 | struct iw_event *iwe, /* Payload length + flags */ | ||
593 | char * extra, /* More payload */ | ||
594 | int * perr) /* Error report */ | ||
595 | { | 544 | { |
596 | int event_len = IW_EV_POINT_LEN + iwe->u.data.length; | 545 | int event_len = iwe_stream_point_len(info) + iwe->u.data.length; |
546 | int point_len = iwe_stream_point_len(info); | ||
547 | int lcp_len = iwe_stream_lcp_len(info); | ||
548 | |||
597 | /* Check if it's possible */ | 549 | /* Check if it's possible */ |
598 | if(likely((stream + event_len) < ends)) { | 550 | if(likely((stream + event_len) < ends)) { |
599 | iwe->len = event_len; | 551 | iwe->len = event_len; |
600 | memcpy(stream, (char *) iwe, IW_EV_LCP_PK_LEN); | 552 | memcpy(stream, (char *) iwe, IW_EV_LCP_PK_LEN); |
601 | memcpy(stream + IW_EV_LCP_LEN, | 553 | memcpy(stream + lcp_len, |
602 | ((char *) iwe) + IW_EV_LCP_LEN + IW_EV_POINT_OFF, | 554 | ((char *) &iwe->u) + IW_EV_POINT_OFF, |
603 | IW_EV_POINT_PK_LEN - IW_EV_LCP_PK_LEN); | 555 | IW_EV_POINT_PK_LEN - IW_EV_LCP_PK_LEN); |
604 | memcpy(stream + IW_EV_POINT_LEN, extra, iwe->u.data.length); | 556 | memcpy(stream + point_len, extra, iwe->u.data.length); |
605 | stream += event_len; | 557 | stream += event_len; |
606 | } else | 558 | } |
607 | *perr = -E2BIG; | ||
608 | return stream; | 559 | return stream; |
609 | } | 560 | } |
610 | 561 | ||
@@ -613,29 +564,25 @@ iwe_stream_check_add_point(char * stream, /* Stream of events */ | |||
613 | * Wrapper to add a value to a Wireless Event in a stream of events. | 564 | * Wrapper to add a value to a Wireless Event in a stream of events. |
614 | * Be careful, this one is tricky to use properly : | 565 | * Be careful, this one is tricky to use properly : |
615 | * At the first run, you need to have (value = event + IW_EV_LCP_LEN). | 566 | * At the first run, you need to have (value = event + IW_EV_LCP_LEN). |
616 | * Same as above, with explicit error check... | ||
617 | */ | 567 | */ |
618 | static inline char * | 568 | static inline char * |
619 | iwe_stream_check_add_value(char * event, /* Event in the stream */ | 569 | iwe_stream_add_value(struct iw_request_info *info, char *event, char *value, |
620 | char * value, /* Value in event */ | 570 | char *ends, struct iw_event *iwe, int event_len) |
621 | char * ends, /* End of stream */ | ||
622 | struct iw_event *iwe, /* Payload */ | ||
623 | int event_len, /* Size of payload */ | ||
624 | int * perr) /* Error report */ | ||
625 | { | 571 | { |
572 | int lcp_len = iwe_stream_lcp_len(info); | ||
573 | |||
626 | /* Don't duplicate LCP */ | 574 | /* Don't duplicate LCP */ |
627 | event_len -= IW_EV_LCP_LEN; | 575 | event_len -= IW_EV_LCP_LEN; |
628 | 576 | ||
629 | /* Check if it's possible */ | 577 | /* Check if it's possible */ |
630 | if(likely((value + event_len) < ends)) { | 578 | if(likely((value + event_len) < ends)) { |
631 | /* Add new value */ | 579 | /* Add new value */ |
632 | memcpy(value, (char *) iwe + IW_EV_LCP_LEN, event_len); | 580 | memcpy(value, &iwe->u, event_len); |
633 | value += event_len; | 581 | value += event_len; |
634 | /* Patch LCP */ | 582 | /* Patch LCP */ |
635 | iwe->len = value - event; | 583 | iwe->len = value - event; |
636 | memcpy(event, (char *) iwe, IW_EV_LCP_LEN); | 584 | memcpy(event, (char *) iwe, lcp_len); |
637 | } else | 585 | } |
638 | *perr = -E2BIG; | ||
639 | return value; | 586 | return value; |
640 | } | 587 | } |
641 | 588 | ||
diff --git a/include/net/mac80211.h b/include/net/mac80211.h index 7ab4ff6159a2..02c79e6b309e 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h | |||
@@ -595,7 +595,12 @@ enum ieee80211_key_flags { | |||
595 | * @flags: key flags, see &enum ieee80211_key_flags. | 595 | * @flags: key flags, see &enum ieee80211_key_flags. |
596 | * @keyidx: the key index (0-3) | 596 | * @keyidx: the key index (0-3) |
597 | * @keylen: key material length | 597 | * @keylen: key material length |
598 | * @key: key material | 598 | * @key: key material. For ALG_TKIP the key is encoded as a 256-bit (32 byte) |
599 | * data block: | ||
600 | * - Temporal Encryption Key (128 bits) | ||
601 | * - Temporal Authenticator Tx MIC Key (64 bits) | ||
602 | * - Temporal Authenticator Rx MIC Key (64 bits) | ||
603 | * | ||
599 | */ | 604 | */ |
600 | struct ieee80211_key_conf { | 605 | struct ieee80211_key_conf { |
601 | enum ieee80211_key_alg alg; | 606 | enum ieee80211_key_alg alg; |
@@ -733,8 +738,11 @@ enum ieee80211_hw_flags { | |||
733 | * @conf: &struct ieee80211_conf, device configuration, don't use. | 738 | * @conf: &struct ieee80211_conf, device configuration, don't use. |
734 | * | 739 | * |
735 | * @workqueue: single threaded workqueue available for driver use, | 740 | * @workqueue: single threaded workqueue available for driver use, |
736 | * allocated by mac80211 on registration and flushed on | 741 | * allocated by mac80211 on registration and flushed when an |
737 | * unregistration. | 742 | * interface is removed. |
743 | * NOTICE: All work performed on this workqueue should NEVER | ||
744 | * acquire the RTNL lock (i.e. Don't use the function | ||
745 | * ieee80211_iterate_active_interfaces()) | ||
738 | * | 746 | * |
739 | * @priv: pointer to private area that was allocated for driver use | 747 | * @priv: pointer to private area that was allocated for driver use |
740 | * along with this structure. | 748 | * along with this structure. |
diff --git a/include/net/wext.h b/include/net/wext.h index 80b31d826b7a..6d76a39a9c5b 100644 --- a/include/net/wext.h +++ b/include/net/wext.h | |||
@@ -12,6 +12,8 @@ extern int wext_proc_init(struct net *net); | |||
12 | extern void wext_proc_exit(struct net *net); | 12 | extern void wext_proc_exit(struct net *net); |
13 | extern int wext_handle_ioctl(struct net *net, struct ifreq *ifr, unsigned int cmd, | 13 | extern int wext_handle_ioctl(struct net *net, struct ifreq *ifr, unsigned int cmd, |
14 | void __user *arg); | 14 | void __user *arg); |
15 | extern int compat_wext_handle_ioctl(struct net *net, unsigned int cmd, | ||
16 | unsigned long arg); | ||
15 | #else | 17 | #else |
16 | static inline int wext_proc_init(struct net *net) | 18 | static inline int wext_proc_init(struct net *net) |
17 | { | 19 | { |
@@ -26,6 +28,11 @@ static inline int wext_handle_ioctl(struct net *net, struct ifreq *ifr, unsigned | |||
26 | { | 28 | { |
27 | return -EINVAL; | 29 | return -EINVAL; |
28 | } | 30 | } |
31 | static inline int compat_wext_handle_ioctl(struct net *net, unsigned int cmd, | ||
32 | unsigned long arg) | ||
33 | { | ||
34 | return -EINVAL; | ||
35 | } | ||
29 | #endif | 36 | #endif |
30 | 37 | ||
31 | #endif /* __NET_WEXT_H */ | 38 | #endif /* __NET_WEXT_H */ |