diff options
Diffstat (limited to 'include/net')
-rw-r--r-- | include/net/atmclip.h | 1 | ||||
-rw-r--r-- | include/net/cfg80211.h | 238 | ||||
-rw-r--r-- | include/net/inet_ecn.h | 4 | ||||
-rw-r--r-- | include/net/inet_hashtables.h | 4 | ||||
-rw-r--r-- | include/net/ip.h | 1 | ||||
-rw-r--r-- | include/net/ip_vs.h | 4 | ||||
-rw-r--r-- | include/net/ipv6.h | 4 | ||||
-rw-r--r-- | include/net/ipx.h | 2 | ||||
-rw-r--r-- | include/net/mac80211.h | 234 | ||||
-rw-r--r-- | include/net/net_namespace.h | 27 | ||||
-rw-r--r-- | include/net/netns/ipv4.h | 13 | ||||
-rw-r--r-- | include/net/netrom.h | 4 | ||||
-rw-r--r-- | include/net/phonet/phonet.h | 1 | ||||
-rw-r--r-- | include/net/phonet/pn_dev.h | 5 | ||||
-rw-r--r-- | include/net/pkt_sched.h | 1 | ||||
-rw-r--r-- | include/net/sch_generic.h | 7 | ||||
-rw-r--r-- | include/net/sctp/checksum.h | 14 | ||||
-rw-r--r-- | include/net/sctp/sctp.h | 2 | ||||
-rw-r--r-- | include/net/sctp/structs.h | 7 | ||||
-rw-r--r-- | include/net/sock.h | 49 | ||||
-rw-r--r-- | include/net/transp_v6.h | 2 | ||||
-rw-r--r-- | include/net/wireless.h | 71 |
22 files changed, 595 insertions, 100 deletions
diff --git a/include/net/atmclip.h b/include/net/atmclip.h index b5a51a7bb364..467c531b8a7e 100644 --- a/include/net/atmclip.h +++ b/include/net/atmclip.h | |||
@@ -50,7 +50,6 @@ struct atmarp_entry { | |||
50 | struct clip_priv { | 50 | struct clip_priv { |
51 | int number; /* for convenience ... */ | 51 | int number; /* for convenience ... */ |
52 | spinlock_t xoff_lock; /* ensures that pop is atomic (SMP) */ | 52 | spinlock_t xoff_lock; /* ensures that pop is atomic (SMP) */ |
53 | struct net_device_stats stats; | ||
54 | struct net_device *next; /* next CLIP interface */ | 53 | struct net_device *next; /* next CLIP interface */ |
55 | }; | 54 | }; |
56 | 55 | ||
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index 23c0ab74ded6..c0d1f5b708c5 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h | |||
@@ -4,6 +4,10 @@ | |||
4 | #include <linux/netlink.h> | 4 | #include <linux/netlink.h> |
5 | #include <linux/skbuff.h> | 5 | #include <linux/skbuff.h> |
6 | #include <linux/nl80211.h> | 6 | #include <linux/nl80211.h> |
7 | #include <linux/if_ether.h> | ||
8 | #include <linux/ieee80211.h> | ||
9 | #include <linux/wireless.h> | ||
10 | #include <net/iw_handler.h> | ||
7 | #include <net/genetlink.h> | 11 | #include <net/genetlink.h> |
8 | /* remove once we remove the wext stuff */ | 12 | /* remove once we remove the wext stuff */ |
9 | #include <net/iw_handler.h> | 13 | #include <net/iw_handler.h> |
@@ -112,12 +116,14 @@ struct beacon_parameters { | |||
112 | * @STATION_FLAG_SHORT_PREAMBLE: station is capable of receiving frames | 116 | * @STATION_FLAG_SHORT_PREAMBLE: station is capable of receiving frames |
113 | * with short preambles | 117 | * with short preambles |
114 | * @STATION_FLAG_WME: station is WME/QoS capable | 118 | * @STATION_FLAG_WME: station is WME/QoS capable |
119 | * @STATION_FLAG_MFP: station uses management frame protection | ||
115 | */ | 120 | */ |
116 | enum station_flags { | 121 | enum station_flags { |
117 | STATION_FLAG_CHANGED = 1<<0, | 122 | STATION_FLAG_CHANGED = 1<<0, |
118 | STATION_FLAG_AUTHORIZED = 1<<NL80211_STA_FLAG_AUTHORIZED, | 123 | STATION_FLAG_AUTHORIZED = 1<<NL80211_STA_FLAG_AUTHORIZED, |
119 | STATION_FLAG_SHORT_PREAMBLE = 1<<NL80211_STA_FLAG_SHORT_PREAMBLE, | 124 | STATION_FLAG_SHORT_PREAMBLE = 1<<NL80211_STA_FLAG_SHORT_PREAMBLE, |
120 | STATION_FLAG_WME = 1<<NL80211_STA_FLAG_WME, | 125 | STATION_FLAG_WME = 1<<NL80211_STA_FLAG_WME, |
126 | STATION_FLAG_MFP = 1<<NL80211_STA_FLAG_MFP, | ||
121 | }; | 127 | }; |
122 | 128 | ||
123 | /** | 129 | /** |
@@ -355,6 +361,51 @@ enum reg_set_by { | |||
355 | REGDOM_SET_BY_COUNTRY_IE, | 361 | REGDOM_SET_BY_COUNTRY_IE, |
356 | }; | 362 | }; |
357 | 363 | ||
364 | /** | ||
365 | * enum environment_cap - Environment parsed from country IE | ||
366 | * @ENVIRON_ANY: indicates country IE applies to both indoor and | ||
367 | * outdoor operation. | ||
368 | * @ENVIRON_INDOOR: indicates country IE applies only to indoor operation | ||
369 | * @ENVIRON_OUTDOOR: indicates country IE applies only to outdoor operation | ||
370 | */ | ||
371 | enum environment_cap { | ||
372 | ENVIRON_ANY, | ||
373 | ENVIRON_INDOOR, | ||
374 | ENVIRON_OUTDOOR, | ||
375 | }; | ||
376 | |||
377 | /** | ||
378 | * struct regulatory_request - receipt of last regulatory request | ||
379 | * | ||
380 | * @wiphy: this is set if this request's initiator is | ||
381 | * %REGDOM_SET_BY_COUNTRY_IE or %REGDOM_SET_BY_DRIVER. This | ||
382 | * can be used by the wireless core to deal with conflicts | ||
383 | * and potentially inform users of which devices specifically | ||
384 | * cased the conflicts. | ||
385 | * @initiator: indicates who sent this request, could be any of | ||
386 | * of those set in reg_set_by, %REGDOM_SET_BY_* | ||
387 | * @alpha2: the ISO / IEC 3166 alpha2 country code of the requested | ||
388 | * regulatory domain. We have a few special codes: | ||
389 | * 00 - World regulatory domain | ||
390 | * 99 - built by driver but a specific alpha2 cannot be determined | ||
391 | * 98 - result of an intersection between two regulatory domains | ||
392 | * @intersect: indicates whether the wireless core should intersect | ||
393 | * the requested regulatory domain with the presently set regulatory | ||
394 | * domain. | ||
395 | * @country_ie_checksum: checksum of the last processed and accepted | ||
396 | * country IE | ||
397 | * @country_ie_env: lets us know if the AP is telling us we are outdoor, | ||
398 | * indoor, or if it doesn't matter | ||
399 | */ | ||
400 | struct regulatory_request { | ||
401 | struct wiphy *wiphy; | ||
402 | enum reg_set_by initiator; | ||
403 | char alpha2[2]; | ||
404 | bool intersect; | ||
405 | u32 country_ie_checksum; | ||
406 | enum environment_cap country_ie_env; | ||
407 | }; | ||
408 | |||
358 | struct ieee80211_freq_range { | 409 | struct ieee80211_freq_range { |
359 | u32 start_freq_khz; | 410 | u32 start_freq_khz; |
360 | u32 end_freq_khz; | 411 | u32 end_freq_khz; |
@@ -431,6 +482,26 @@ struct ieee80211_txq_params { | |||
431 | u8 aifs; | 482 | u8 aifs; |
432 | }; | 483 | }; |
433 | 484 | ||
485 | /** | ||
486 | * struct mgmt_extra_ie_params - Extra management frame IE parameters | ||
487 | * | ||
488 | * Used to add extra IE(s) into management frames. If the driver cannot add the | ||
489 | * requested data into all management frames of the specified subtype that are | ||
490 | * generated in kernel or firmware/hardware, it must reject the configuration | ||
491 | * call. The IE data buffer is added to the end of the specified management | ||
492 | * frame body after all other IEs. This addition is not applied to frames that | ||
493 | * are injected through a monitor interface. | ||
494 | * | ||
495 | * @subtype: Management frame subtype | ||
496 | * @ies: IE data buffer or %NULL to remove previous data | ||
497 | * @ies_len: Length of @ies in octets | ||
498 | */ | ||
499 | struct mgmt_extra_ie_params { | ||
500 | u8 subtype; | ||
501 | u8 *ies; | ||
502 | int ies_len; | ||
503 | }; | ||
504 | |||
434 | /* from net/wireless.h */ | 505 | /* from net/wireless.h */ |
435 | struct wiphy; | 506 | struct wiphy; |
436 | 507 | ||
@@ -438,6 +509,85 @@ struct wiphy; | |||
438 | struct ieee80211_channel; | 509 | struct ieee80211_channel; |
439 | 510 | ||
440 | /** | 511 | /** |
512 | * struct cfg80211_ssid - SSID description | ||
513 | * @ssid: the SSID | ||
514 | * @ssid_len: length of the ssid | ||
515 | */ | ||
516 | struct cfg80211_ssid { | ||
517 | u8 ssid[IEEE80211_MAX_SSID_LEN]; | ||
518 | u8 ssid_len; | ||
519 | }; | ||
520 | |||
521 | /** | ||
522 | * struct cfg80211_scan_request - scan request description | ||
523 | * | ||
524 | * @ssids: SSIDs to scan for (active scan only) | ||
525 | * @n_ssids: number of SSIDs | ||
526 | * @channels: channels to scan on. | ||
527 | * @n_channels: number of channels for each band | ||
528 | * @wiphy: the wiphy this was for | ||
529 | * @ifidx: the interface index | ||
530 | */ | ||
531 | struct cfg80211_scan_request { | ||
532 | struct cfg80211_ssid *ssids; | ||
533 | int n_ssids; | ||
534 | struct ieee80211_channel **channels; | ||
535 | u32 n_channels; | ||
536 | |||
537 | /* internal */ | ||
538 | struct wiphy *wiphy; | ||
539 | int ifidx; | ||
540 | }; | ||
541 | |||
542 | /** | ||
543 | * enum cfg80211_signal_type - signal type | ||
544 | * | ||
545 | * @CFG80211_SIGNAL_TYPE_NONE: no signal strength information available | ||
546 | * @CFG80211_SIGNAL_TYPE_MBM: signal strength in mBm (100*dBm) | ||
547 | * @CFG80211_SIGNAL_TYPE_UNSPEC: signal strength, increasing from 0 through 100 | ||
548 | */ | ||
549 | enum cfg80211_signal_type { | ||
550 | CFG80211_SIGNAL_TYPE_NONE, | ||
551 | CFG80211_SIGNAL_TYPE_MBM, | ||
552 | CFG80211_SIGNAL_TYPE_UNSPEC, | ||
553 | }; | ||
554 | |||
555 | /** | ||
556 | * struct cfg80211_bss - BSS description | ||
557 | * | ||
558 | * This structure describes a BSS (which may also be a mesh network) | ||
559 | * for use in scan results and similar. | ||
560 | * | ||
561 | * @bssid: BSSID of the BSS | ||
562 | * @tsf: timestamp of last received update | ||
563 | * @beacon_interval: the beacon interval as from the frame | ||
564 | * @capability: the capability field in host byte order | ||
565 | * @information_elements: the information elements (Note that there | ||
566 | * is no guarantee that these are well-formed!) | ||
567 | * @len_information_elements: total length of the information elements | ||
568 | * @signal: signal strength value | ||
569 | * @signal_type: signal type | ||
570 | * @free_priv: function pointer to free private data | ||
571 | * @priv: private area for driver use, has at least wiphy->bss_priv_size bytes | ||
572 | */ | ||
573 | struct cfg80211_bss { | ||
574 | struct ieee80211_channel *channel; | ||
575 | |||
576 | u8 bssid[ETH_ALEN]; | ||
577 | u64 tsf; | ||
578 | u16 beacon_interval; | ||
579 | u16 capability; | ||
580 | u8 *information_elements; | ||
581 | size_t len_information_elements; | ||
582 | |||
583 | s32 signal; | ||
584 | enum cfg80211_signal_type signal_type; | ||
585 | |||
586 | void (*free_priv)(struct cfg80211_bss *bss); | ||
587 | u8 priv[0] __attribute__((__aligned__(sizeof(void *)))); | ||
588 | }; | ||
589 | |||
590 | /** | ||
441 | * struct cfg80211_ops - backend description for wireless configuration | 591 | * struct cfg80211_ops - backend description for wireless configuration |
442 | * | 592 | * |
443 | * This struct is registered by fullmac card drivers and/or wireless stacks | 593 | * This struct is registered by fullmac card drivers and/or wireless stacks |
@@ -450,6 +600,9 @@ struct ieee80211_channel; | |||
450 | * wireless extensions but this is subject to reevaluation as soon as this | 600 | * wireless extensions but this is subject to reevaluation as soon as this |
451 | * code is used more widely and we have a first user without wext. | 601 | * code is used more widely and we have a first user without wext. |
452 | * | 602 | * |
603 | * @suspend: wiphy device needs to be suspended | ||
604 | * @resume: wiphy device needs to be resumed | ||
605 | * | ||
453 | * @add_virtual_intf: create a new virtual interface with the given name, | 606 | * @add_virtual_intf: create a new virtual interface with the given name, |
454 | * must set the struct wireless_dev's iftype. | 607 | * must set the struct wireless_dev's iftype. |
455 | * | 608 | * |
@@ -471,6 +624,8 @@ struct ieee80211_channel; | |||
471 | * | 624 | * |
472 | * @set_default_key: set the default key on an interface | 625 | * @set_default_key: set the default key on an interface |
473 | * | 626 | * |
627 | * @set_default_mgmt_key: set the default management frame key on an interface | ||
628 | * | ||
474 | * @add_beacon: Add a beacon with given parameters, @head, @interval | 629 | * @add_beacon: Add a beacon with given parameters, @head, @interval |
475 | * and @dtim_period will be valid, @tail is optional. | 630 | * and @dtim_period will be valid, @tail is optional. |
476 | * @set_beacon: Change the beacon parameters for an access point mode | 631 | * @set_beacon: Change the beacon parameters for an access point mode |
@@ -497,8 +652,18 @@ struct ieee80211_channel; | |||
497 | * @set_txq_params: Set TX queue parameters | 652 | * @set_txq_params: Set TX queue parameters |
498 | * | 653 | * |
499 | * @set_channel: Set channel | 654 | * @set_channel: Set channel |
655 | * | ||
656 | * @set_mgmt_extra_ie: Set extra IE data for management frames | ||
657 | * | ||
658 | * @scan: Request to do a scan. If returning zero, the scan request is given | ||
659 | * the driver, and will be valid until passed to cfg80211_scan_done(). | ||
660 | * For scan results, call cfg80211_inform_bss(); you can call this outside | ||
661 | * the scan/scan_done bracket too. | ||
500 | */ | 662 | */ |
501 | struct cfg80211_ops { | 663 | struct cfg80211_ops { |
664 | int (*suspend)(struct wiphy *wiphy); | ||
665 | int (*resume)(struct wiphy *wiphy); | ||
666 | |||
502 | int (*add_virtual_intf)(struct wiphy *wiphy, char *name, | 667 | int (*add_virtual_intf)(struct wiphy *wiphy, char *name, |
503 | enum nl80211_iftype type, u32 *flags, | 668 | enum nl80211_iftype type, u32 *flags, |
504 | struct vif_params *params); | 669 | struct vif_params *params); |
@@ -518,6 +683,9 @@ struct cfg80211_ops { | |||
518 | int (*set_default_key)(struct wiphy *wiphy, | 683 | int (*set_default_key)(struct wiphy *wiphy, |
519 | struct net_device *netdev, | 684 | struct net_device *netdev, |
520 | u8 key_index); | 685 | u8 key_index); |
686 | int (*set_default_mgmt_key)(struct wiphy *wiphy, | ||
687 | struct net_device *netdev, | ||
688 | u8 key_index); | ||
521 | 689 | ||
522 | int (*add_beacon)(struct wiphy *wiphy, struct net_device *dev, | 690 | int (*add_beacon)(struct wiphy *wiphy, struct net_device *dev, |
523 | struct beacon_parameters *info); | 691 | struct beacon_parameters *info); |
@@ -564,6 +732,13 @@ struct cfg80211_ops { | |||
564 | int (*set_channel)(struct wiphy *wiphy, | 732 | int (*set_channel)(struct wiphy *wiphy, |
565 | struct ieee80211_channel *chan, | 733 | struct ieee80211_channel *chan, |
566 | enum nl80211_channel_type channel_type); | 734 | enum nl80211_channel_type channel_type); |
735 | |||
736 | int (*set_mgmt_extra_ie)(struct wiphy *wiphy, | ||
737 | struct net_device *dev, | ||
738 | struct mgmt_extra_ie_params *params); | ||
739 | |||
740 | int (*scan)(struct wiphy *wiphy, struct net_device *dev, | ||
741 | struct cfg80211_scan_request *request); | ||
567 | }; | 742 | }; |
568 | 743 | ||
569 | /* temporary wext handlers */ | 744 | /* temporary wext handlers */ |
@@ -574,5 +749,68 @@ int cfg80211_wext_siwmode(struct net_device *dev, struct iw_request_info *info, | |||
574 | u32 *mode, char *extra); | 749 | u32 *mode, char *extra); |
575 | int cfg80211_wext_giwmode(struct net_device *dev, struct iw_request_info *info, | 750 | int cfg80211_wext_giwmode(struct net_device *dev, struct iw_request_info *info, |
576 | u32 *mode, char *extra); | 751 | u32 *mode, char *extra); |
752 | int cfg80211_wext_siwscan(struct net_device *dev, | ||
753 | struct iw_request_info *info, | ||
754 | union iwreq_data *wrqu, char *extra); | ||
755 | int cfg80211_wext_giwscan(struct net_device *dev, | ||
756 | struct iw_request_info *info, | ||
757 | struct iw_point *data, char *extra); | ||
758 | |||
759 | /** | ||
760 | * cfg80211_scan_done - notify that scan finished | ||
761 | * | ||
762 | * @request: the corresponding scan request | ||
763 | * @aborted: set to true if the scan was aborted for any reason, | ||
764 | * userspace will be notified of that | ||
765 | */ | ||
766 | void cfg80211_scan_done(struct cfg80211_scan_request *request, bool aborted); | ||
767 | |||
768 | /** | ||
769 | * cfg80211_inform_bss - inform cfg80211 of a new BSS | ||
770 | * | ||
771 | * @wiphy: the wiphy reporting the BSS | ||
772 | * @bss: the found BSS | ||
773 | * @gfp: context flags | ||
774 | * | ||
775 | * This informs cfg80211 that BSS information was found and | ||
776 | * the BSS should be updated/added. | ||
777 | */ | ||
778 | struct cfg80211_bss* | ||
779 | cfg80211_inform_bss_frame(struct wiphy *wiphy, | ||
780 | struct ieee80211_channel *channel, | ||
781 | struct ieee80211_mgmt *mgmt, size_t len, | ||
782 | s32 signal, enum cfg80211_signal_type sigtype, | ||
783 | gfp_t gfp); | ||
784 | |||
785 | struct cfg80211_bss *cfg80211_get_bss(struct wiphy *wiphy, | ||
786 | struct ieee80211_channel *channel, | ||
787 | const u8 *bssid, | ||
788 | const u8 *ssid, size_t ssid_len, | ||
789 | u16 capa_mask, u16 capa_val); | ||
790 | static inline struct cfg80211_bss * | ||
791 | cfg80211_get_ibss(struct wiphy *wiphy, | ||
792 | struct ieee80211_channel *channel, | ||
793 | const u8 *ssid, size_t ssid_len) | ||
794 | { | ||
795 | return cfg80211_get_bss(wiphy, channel, NULL, ssid, ssid_len, | ||
796 | WLAN_CAPABILITY_IBSS, WLAN_CAPABILITY_IBSS); | ||
797 | } | ||
798 | |||
799 | struct cfg80211_bss *cfg80211_get_mesh(struct wiphy *wiphy, | ||
800 | struct ieee80211_channel *channel, | ||
801 | const u8 *meshid, size_t meshidlen, | ||
802 | const u8 *meshcfg); | ||
803 | void cfg80211_put_bss(struct cfg80211_bss *bss); | ||
804 | /** | ||
805 | * cfg80211_unlink_bss - unlink BSS from internal data structures | ||
806 | * @wiphy: the wiphy | ||
807 | * @bss: the bss to remove | ||
808 | * | ||
809 | * This function removes the given BSS from the internal data structures | ||
810 | * thereby making it no longer show up in scan results etc. Use this | ||
811 | * function when you detect a BSS is gone. Normally BSSes will also time | ||
812 | * out, so it is not necessary to use this function at all. | ||
813 | */ | ||
814 | void cfg80211_unlink_bss(struct wiphy *wiphy, struct cfg80211_bss *bss); | ||
577 | 815 | ||
578 | #endif /* __NET_CFG80211_H */ | 816 | #endif /* __NET_CFG80211_H */ |
diff --git a/include/net/inet_ecn.h b/include/net/inet_ecn.h index 7040a782c656..9b5d08f4f6e8 100644 --- a/include/net/inet_ecn.h +++ b/include/net/inet_ecn.h | |||
@@ -113,12 +113,12 @@ static inline void ipv6_copy_dscp(unsigned int dscp, struct ipv6hdr *inner) | |||
113 | static inline int INET_ECN_set_ce(struct sk_buff *skb) | 113 | static inline int INET_ECN_set_ce(struct sk_buff *skb) |
114 | { | 114 | { |
115 | switch (skb->protocol) { | 115 | switch (skb->protocol) { |
116 | case __constant_htons(ETH_P_IP): | 116 | case cpu_to_be16(ETH_P_IP): |
117 | if (skb->network_header + sizeof(struct iphdr) <= skb->tail) | 117 | if (skb->network_header + sizeof(struct iphdr) <= skb->tail) |
118 | return IP_ECN_set_ce(ip_hdr(skb)); | 118 | return IP_ECN_set_ce(ip_hdr(skb)); |
119 | break; | 119 | break; |
120 | 120 | ||
121 | case __constant_htons(ETH_P_IPV6): | 121 | case cpu_to_be16(ETH_P_IPV6): |
122 | if (skb->network_header + sizeof(struct ipv6hdr) <= skb->tail) | 122 | if (skb->network_header + sizeof(struct ipv6hdr) <= skb->tail) |
123 | return IP6_ECN_set_ce(ipv6_hdr(skb)); | 123 | return IP6_ECN_set_ce(ipv6_hdr(skb)); |
124 | break; | 124 | break; |
diff --git a/include/net/inet_hashtables.h b/include/net/inet_hashtables.h index d0a043153cc6..a44e2248b2ef 100644 --- a/include/net/inet_hashtables.h +++ b/include/net/inet_hashtables.h | |||
@@ -82,6 +82,7 @@ struct inet_bind_bucket { | |||
82 | #endif | 82 | #endif |
83 | unsigned short port; | 83 | unsigned short port; |
84 | signed short fastreuse; | 84 | signed short fastreuse; |
85 | int num_owners; | ||
85 | struct hlist_node node; | 86 | struct hlist_node node; |
86 | struct hlist_head owners; | 87 | struct hlist_head owners; |
87 | }; | 88 | }; |
@@ -133,7 +134,7 @@ struct inet_hashinfo { | |||
133 | struct inet_bind_hashbucket *bhash; | 134 | struct inet_bind_hashbucket *bhash; |
134 | 135 | ||
135 | unsigned int bhash_size; | 136 | unsigned int bhash_size; |
136 | /* Note : 4 bytes padding on 64 bit arches */ | 137 | /* 4 bytes hole on 64 bit */ |
137 | 138 | ||
138 | struct kmem_cache *bind_bucket_cachep; | 139 | struct kmem_cache *bind_bucket_cachep; |
139 | 140 | ||
@@ -150,6 +151,7 @@ struct inet_hashinfo { | |||
150 | struct inet_listen_hashbucket listening_hash[INET_LHTABLE_SIZE] | 151 | struct inet_listen_hashbucket listening_hash[INET_LHTABLE_SIZE] |
151 | ____cacheline_aligned_in_smp; | 152 | ____cacheline_aligned_in_smp; |
152 | 153 | ||
154 | atomic_t bsockets; | ||
153 | }; | 155 | }; |
154 | 156 | ||
155 | static inline struct inet_ehash_bucket *inet_ehash_bucket( | 157 | static inline struct inet_ehash_bucket *inet_ehash_bucket( |
diff --git a/include/net/ip.h b/include/net/ip.h index 10868139e656..4ac7577f98d0 100644 --- a/include/net/ip.h +++ b/include/net/ip.h | |||
@@ -55,6 +55,7 @@ struct ipcm_cookie | |||
55 | __be32 addr; | 55 | __be32 addr; |
56 | int oif; | 56 | int oif; |
57 | struct ip_options *opt; | 57 | struct ip_options *opt; |
58 | union skb_shared_tx shtx; | ||
58 | }; | 59 | }; |
59 | 60 | ||
60 | #define IPCB(skb) ((struct inet_skb_parm*)((skb)->cb)) | 61 | #define IPCB(skb) ((struct inet_skb_parm*)((skb)->cb)) |
diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h index ab9b003ab671..bbae1e87efcd 100644 --- a/include/net/ip_vs.h +++ b/include/net/ip_vs.h | |||
@@ -184,8 +184,8 @@ static inline const char *ip_vs_dbg_addr(int af, char *buf, size_t buf_len, | |||
184 | /* | 184 | /* |
185 | * The port number of FTP service (in network order). | 185 | * The port number of FTP service (in network order). |
186 | */ | 186 | */ |
187 | #define FTPPORT __constant_htons(21) | 187 | #define FTPPORT cpu_to_be16(21) |
188 | #define FTPDATA __constant_htons(20) | 188 | #define FTPDATA cpu_to_be16(20) |
189 | 189 | ||
190 | /* | 190 | /* |
191 | * TCP State Values | 191 | * TCP State Values |
diff --git a/include/net/ipv6.h b/include/net/ipv6.h index 6d5b58a1c743..c1f16fc49ade 100644 --- a/include/net/ipv6.h +++ b/include/net/ipv6.h | |||
@@ -196,8 +196,8 @@ struct ip6_flowlabel | |||
196 | struct net *fl_net; | 196 | struct net *fl_net; |
197 | }; | 197 | }; |
198 | 198 | ||
199 | #define IPV6_FLOWINFO_MASK __constant_htonl(0x0FFFFFFF) | 199 | #define IPV6_FLOWINFO_MASK cpu_to_be32(0x0FFFFFFF) |
200 | #define IPV6_FLOWLABEL_MASK __constant_htonl(0x000FFFFF) | 200 | #define IPV6_FLOWLABEL_MASK cpu_to_be32(0x000FFFFF) |
201 | 201 | ||
202 | struct ipv6_fl_socklist | 202 | struct ipv6_fl_socklist |
203 | { | 203 | { |
diff --git a/include/net/ipx.h b/include/net/ipx.h index 4cc0b4eca948..a14121dd1932 100644 --- a/include/net/ipx.h +++ b/include/net/ipx.h | |||
@@ -27,7 +27,7 @@ struct ipx_address { | |||
27 | 27 | ||
28 | struct ipxhdr { | 28 | struct ipxhdr { |
29 | __be16 ipx_checksum __attribute__ ((packed)); | 29 | __be16 ipx_checksum __attribute__ ((packed)); |
30 | #define IPX_NO_CHECKSUM __constant_htons(0xFFFF) | 30 | #define IPX_NO_CHECKSUM cpu_to_be16(0xFFFF) |
31 | __be16 ipx_pktsize __attribute__ ((packed)); | 31 | __be16 ipx_pktsize __attribute__ ((packed)); |
32 | __u8 ipx_tctrl; | 32 | __u8 ipx_tctrl; |
33 | __u8 ipx_type; | 33 | __u8 ipx_type; |
diff --git a/include/net/mac80211.h b/include/net/mac80211.h index 559422fc0943..88fa3e03e3e9 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h | |||
@@ -207,7 +207,7 @@ struct ieee80211_bss_conf { | |||
207 | u16 beacon_int; | 207 | u16 beacon_int; |
208 | u16 assoc_capability; | 208 | u16 assoc_capability; |
209 | u64 timestamp; | 209 | u64 timestamp; |
210 | u64 basic_rates; | 210 | u32 basic_rates; |
211 | struct ieee80211_bss_ht_conf ht; | 211 | struct ieee80211_bss_ht_conf ht; |
212 | }; | 212 | }; |
213 | 213 | ||
@@ -262,6 +262,26 @@ enum mac80211_tx_control_flags { | |||
262 | IEEE80211_TX_CTL_RATE_CTRL_PROBE = BIT(12), | 262 | IEEE80211_TX_CTL_RATE_CTRL_PROBE = BIT(12), |
263 | }; | 263 | }; |
264 | 264 | ||
265 | /** | ||
266 | * enum mac80211_rate_control_flags - per-rate flags set by the | ||
267 | * Rate Control algorithm. | ||
268 | * | ||
269 | * These flags are set by the Rate control algorithm for each rate during tx, | ||
270 | * in the @flags member of struct ieee80211_tx_rate. | ||
271 | * | ||
272 | * @IEEE80211_TX_RC_USE_RTS_CTS: Use RTS/CTS exchange for this rate. | ||
273 | * @IEEE80211_TX_RC_USE_CTS_PROTECT: CTS-to-self protection is required. | ||
274 | * This is set if the current BSS requires ERP protection. | ||
275 | * @IEEE80211_TX_RC_USE_SHORT_PREAMBLE: Use short preamble. | ||
276 | * @IEEE80211_TX_RC_MCS: HT rate. | ||
277 | * @IEEE80211_TX_RC_GREEN_FIELD: Indicates whether this rate should be used in | ||
278 | * Greenfield mode. | ||
279 | * @IEEE80211_TX_RC_40_MHZ_WIDTH: Indicates if the Channel Width should be 40 MHz. | ||
280 | * @IEEE80211_TX_RC_DUP_DATA: The frame should be transmitted on both of the | ||
281 | * adjacent 20 MHz channels, if the current channel type is | ||
282 | * NL80211_CHAN_HT40MINUS or NL80211_CHAN_HT40PLUS. | ||
283 | * @IEEE80211_TX_RC_SHORT_GI: Short Guard interval should be used for this rate. | ||
284 | */ | ||
265 | enum mac80211_rate_control_flags { | 285 | enum mac80211_rate_control_flags { |
266 | IEEE80211_TX_RC_USE_RTS_CTS = BIT(0), | 286 | IEEE80211_TX_RC_USE_RTS_CTS = BIT(0), |
267 | IEEE80211_TX_RC_USE_CTS_PROTECT = BIT(1), | 287 | IEEE80211_TX_RC_USE_CTS_PROTECT = BIT(1), |
@@ -507,11 +527,6 @@ static inline int __deprecated __IEEE80211_CONF_SHORT_SLOT_TIME(void) | |||
507 | } | 527 | } |
508 | #define IEEE80211_CONF_SHORT_SLOT_TIME (__IEEE80211_CONF_SHORT_SLOT_TIME()) | 528 | #define IEEE80211_CONF_SHORT_SLOT_TIME (__IEEE80211_CONF_SHORT_SLOT_TIME()) |
509 | 529 | ||
510 | struct ieee80211_ht_conf { | ||
511 | bool enabled; | ||
512 | enum nl80211_channel_type channel_type; | ||
513 | }; | ||
514 | |||
515 | /** | 530 | /** |
516 | * enum ieee80211_conf_changed - denotes which configuration changed | 531 | * enum ieee80211_conf_changed - denotes which configuration changed |
517 | * | 532 | * |
@@ -520,10 +535,10 @@ struct ieee80211_ht_conf { | |||
520 | * @IEEE80211_CONF_CHANGE_LISTEN_INTERVAL: the listen interval changed | 535 | * @IEEE80211_CONF_CHANGE_LISTEN_INTERVAL: the listen interval changed |
521 | * @IEEE80211_CONF_CHANGE_RADIOTAP: the radiotap flag changed | 536 | * @IEEE80211_CONF_CHANGE_RADIOTAP: the radiotap flag changed |
522 | * @IEEE80211_CONF_CHANGE_PS: the PS flag changed | 537 | * @IEEE80211_CONF_CHANGE_PS: the PS flag changed |
538 | * @IEEE80211_CONF_CHANGE_DYNPS_TIMEOUT: the dynamic PS timeout changed | ||
523 | * @IEEE80211_CONF_CHANGE_POWER: the TX power changed | 539 | * @IEEE80211_CONF_CHANGE_POWER: the TX power changed |
524 | * @IEEE80211_CONF_CHANGE_CHANNEL: the channel changed | 540 | * @IEEE80211_CONF_CHANGE_CHANNEL: the channel/channel_type changed |
525 | * @IEEE80211_CONF_CHANGE_RETRY_LIMITS: retry limits changed | 541 | * @IEEE80211_CONF_CHANGE_RETRY_LIMITS: retry limits changed |
526 | * @IEEE80211_CONF_CHANGE_HT: HT configuration changed | ||
527 | */ | 542 | */ |
528 | enum ieee80211_conf_changed { | 543 | enum ieee80211_conf_changed { |
529 | IEEE80211_CONF_CHANGE_RADIO_ENABLED = BIT(0), | 544 | IEEE80211_CONF_CHANGE_RADIO_ENABLED = BIT(0), |
@@ -531,10 +546,10 @@ enum ieee80211_conf_changed { | |||
531 | IEEE80211_CONF_CHANGE_LISTEN_INTERVAL = BIT(2), | 546 | IEEE80211_CONF_CHANGE_LISTEN_INTERVAL = BIT(2), |
532 | IEEE80211_CONF_CHANGE_RADIOTAP = BIT(3), | 547 | IEEE80211_CONF_CHANGE_RADIOTAP = BIT(3), |
533 | IEEE80211_CONF_CHANGE_PS = BIT(4), | 548 | IEEE80211_CONF_CHANGE_PS = BIT(4), |
534 | IEEE80211_CONF_CHANGE_POWER = BIT(5), | 549 | IEEE80211_CONF_CHANGE_DYNPS_TIMEOUT = BIT(5), |
535 | IEEE80211_CONF_CHANGE_CHANNEL = BIT(6), | 550 | IEEE80211_CONF_CHANGE_POWER = BIT(6), |
536 | IEEE80211_CONF_CHANGE_RETRY_LIMITS = BIT(7), | 551 | IEEE80211_CONF_CHANGE_CHANNEL = BIT(7), |
537 | IEEE80211_CONF_CHANGE_HT = BIT(8), | 552 | IEEE80211_CONF_CHANGE_RETRY_LIMITS = BIT(8), |
538 | }; | 553 | }; |
539 | 554 | ||
540 | /** | 555 | /** |
@@ -547,8 +562,9 @@ enum ieee80211_conf_changed { | |||
547 | * @listen_interval: listen interval in units of beacon interval | 562 | * @listen_interval: listen interval in units of beacon interval |
548 | * @flags: configuration flags defined above | 563 | * @flags: configuration flags defined above |
549 | * @power_level: requested transmit power (in dBm) | 564 | * @power_level: requested transmit power (in dBm) |
565 | * @dynamic_ps_timeout: dynamic powersave timeout (in ms) | ||
550 | * @channel: the channel to tune to | 566 | * @channel: the channel to tune to |
551 | * @ht: the HT configuration for the device | 567 | * @channel_type: the channel (HT) type |
552 | * @long_frame_max_tx_count: Maximum number of transmissions for a "long" frame | 568 | * @long_frame_max_tx_count: Maximum number of transmissions for a "long" frame |
553 | * (a frame not RTS protected), called "dot11LongRetryLimit" in 802.11, | 569 | * (a frame not RTS protected), called "dot11LongRetryLimit" in 802.11, |
554 | * but actually means the number of transmissions not the number of retries | 570 | * but actually means the number of transmissions not the number of retries |
@@ -559,7 +575,7 @@ enum ieee80211_conf_changed { | |||
559 | struct ieee80211_conf { | 575 | struct ieee80211_conf { |
560 | int beacon_int; | 576 | int beacon_int; |
561 | u32 flags; | 577 | u32 flags; |
562 | int power_level; | 578 | int power_level, dynamic_ps_timeout; |
563 | 579 | ||
564 | u16 listen_interval; | 580 | u16 listen_interval; |
565 | bool radio_enabled; | 581 | bool radio_enabled; |
@@ -567,7 +583,7 @@ struct ieee80211_conf { | |||
567 | u8 long_frame_max_tx_count, short_frame_max_tx_count; | 583 | u8 long_frame_max_tx_count, short_frame_max_tx_count; |
568 | 584 | ||
569 | struct ieee80211_channel *channel; | 585 | struct ieee80211_channel *channel; |
570 | struct ieee80211_ht_conf ht; | 586 | enum nl80211_channel_type channel_type; |
571 | }; | 587 | }; |
572 | 588 | ||
573 | /** | 589 | /** |
@@ -630,10 +646,12 @@ struct ieee80211_if_init_conf { | |||
630 | * @IEEE80211_IFCC_BSSID: The BSSID changed. | 646 | * @IEEE80211_IFCC_BSSID: The BSSID changed. |
631 | * @IEEE80211_IFCC_BEACON: The beacon for this interface changed | 647 | * @IEEE80211_IFCC_BEACON: The beacon for this interface changed |
632 | * (currently AP and MESH only), use ieee80211_beacon_get(). | 648 | * (currently AP and MESH only), use ieee80211_beacon_get(). |
649 | * @IEEE80211_IFCC_BEACON_ENABLED: The enable_beacon value changed. | ||
633 | */ | 650 | */ |
634 | enum ieee80211_if_conf_change { | 651 | enum ieee80211_if_conf_change { |
635 | IEEE80211_IFCC_BSSID = BIT(0), | 652 | IEEE80211_IFCC_BSSID = BIT(0), |
636 | IEEE80211_IFCC_BEACON = BIT(1), | 653 | IEEE80211_IFCC_BEACON = BIT(1), |
654 | IEEE80211_IFCC_BEACON_ENABLED = BIT(2), | ||
637 | }; | 655 | }; |
638 | 656 | ||
639 | /** | 657 | /** |
@@ -641,13 +659,16 @@ enum ieee80211_if_conf_change { | |||
641 | * | 659 | * |
642 | * @changed: parameters that have changed, see &enum ieee80211_if_conf_change. | 660 | * @changed: parameters that have changed, see &enum ieee80211_if_conf_change. |
643 | * @bssid: BSSID of the network we are associated to/creating. | 661 | * @bssid: BSSID of the network we are associated to/creating. |
662 | * @enable_beacon: Indicates whether beacons can be sent. | ||
663 | * This is valid only for AP/IBSS/MESH modes. | ||
644 | * | 664 | * |
645 | * This structure is passed to the config_interface() callback of | 665 | * This structure is passed to the config_interface() callback of |
646 | * &struct ieee80211_hw. | 666 | * &struct ieee80211_hw. |
647 | */ | 667 | */ |
648 | struct ieee80211_if_conf { | 668 | struct ieee80211_if_conf { |
649 | u32 changed; | 669 | u32 changed; |
650 | u8 *bssid; | 670 | const u8 *bssid; |
671 | bool enable_beacon; | ||
651 | }; | 672 | }; |
652 | 673 | ||
653 | /** | 674 | /** |
@@ -655,11 +676,13 @@ struct ieee80211_if_conf { | |||
655 | * @ALG_WEP: WEP40 or WEP104 | 676 | * @ALG_WEP: WEP40 or WEP104 |
656 | * @ALG_TKIP: TKIP | 677 | * @ALG_TKIP: TKIP |
657 | * @ALG_CCMP: CCMP (AES) | 678 | * @ALG_CCMP: CCMP (AES) |
679 | * @ALG_AES_CMAC: AES-128-CMAC | ||
658 | */ | 680 | */ |
659 | enum ieee80211_key_alg { | 681 | enum ieee80211_key_alg { |
660 | ALG_WEP, | 682 | ALG_WEP, |
661 | ALG_TKIP, | 683 | ALG_TKIP, |
662 | ALG_CCMP, | 684 | ALG_CCMP, |
685 | ALG_AES_CMAC, | ||
663 | }; | 686 | }; |
664 | 687 | ||
665 | /** | 688 | /** |
@@ -688,12 +711,16 @@ enum ieee80211_key_len { | |||
688 | * generation in software. | 711 | * generation in software. |
689 | * @IEEE80211_KEY_FLAG_PAIRWISE: Set by mac80211, this flag indicates | 712 | * @IEEE80211_KEY_FLAG_PAIRWISE: Set by mac80211, this flag indicates |
690 | * that the key is pairwise rather then a shared key. | 713 | * that the key is pairwise rather then a shared key. |
714 | * @IEEE80211_KEY_FLAG_SW_MGMT: This flag should be set by the driver for a | ||
715 | * CCMP key if it requires CCMP encryption of management frames (MFP) to | ||
716 | * be done in software. | ||
691 | */ | 717 | */ |
692 | enum ieee80211_key_flags { | 718 | enum ieee80211_key_flags { |
693 | IEEE80211_KEY_FLAG_WMM_STA = 1<<0, | 719 | IEEE80211_KEY_FLAG_WMM_STA = 1<<0, |
694 | IEEE80211_KEY_FLAG_GENERATE_IV = 1<<1, | 720 | IEEE80211_KEY_FLAG_GENERATE_IV = 1<<1, |
695 | IEEE80211_KEY_FLAG_GENERATE_MMIC= 1<<2, | 721 | IEEE80211_KEY_FLAG_GENERATE_MMIC= 1<<2, |
696 | IEEE80211_KEY_FLAG_PAIRWISE = 1<<3, | 722 | IEEE80211_KEY_FLAG_PAIRWISE = 1<<3, |
723 | IEEE80211_KEY_FLAG_SW_MGMT = 1<<4, | ||
697 | }; | 724 | }; |
698 | 725 | ||
699 | /** | 726 | /** |
@@ -714,8 +741,8 @@ enum ieee80211_key_flags { | |||
714 | * - Temporal Encryption Key (128 bits) | 741 | * - Temporal Encryption Key (128 bits) |
715 | * - Temporal Authenticator Tx MIC Key (64 bits) | 742 | * - Temporal Authenticator Tx MIC Key (64 bits) |
716 | * - Temporal Authenticator Rx MIC Key (64 bits) | 743 | * - Temporal Authenticator Rx MIC Key (64 bits) |
717 | * @icv_len: FIXME | 744 | * @icv_len: The ICV length for this key type |
718 | * @iv_len: FIXME | 745 | * @iv_len: The IV length for this key type |
719 | */ | 746 | */ |
720 | struct ieee80211_key_conf { | 747 | struct ieee80211_key_conf { |
721 | enum ieee80211_key_alg alg; | 748 | enum ieee80211_key_alg alg; |
@@ -759,7 +786,7 @@ enum set_key_cmd { | |||
759 | * sizeof(void *), size is determined in hw information. | 786 | * sizeof(void *), size is determined in hw information. |
760 | */ | 787 | */ |
761 | struct ieee80211_sta { | 788 | struct ieee80211_sta { |
762 | u64 supp_rates[IEEE80211_NUM_BANDS]; | 789 | u32 supp_rates[IEEE80211_NUM_BANDS]; |
763 | u8 addr[ETH_ALEN]; | 790 | u8 addr[ETH_ALEN]; |
764 | u16 aid; | 791 | u16 aid; |
765 | struct ieee80211_sta_ht_cap ht_cap; | 792 | struct ieee80211_sta_ht_cap ht_cap; |
@@ -833,11 +860,6 @@ enum ieee80211_tkip_key_type { | |||
833 | * expect values between 0 and @max_signal. | 860 | * expect values between 0 and @max_signal. |
834 | * If possible please provide dB or dBm instead. | 861 | * If possible please provide dB or dBm instead. |
835 | * | 862 | * |
836 | * @IEEE80211_HW_SIGNAL_DB: | ||
837 | * Hardware gives signal values in dB, decibel difference from an | ||
838 | * arbitrary, fixed reference. We expect values between 0 and @max_signal. | ||
839 | * If possible please provide dBm instead. | ||
840 | * | ||
841 | * @IEEE80211_HW_SIGNAL_DBM: | 863 | * @IEEE80211_HW_SIGNAL_DBM: |
842 | * Hardware gives signal values in dBm, decibel difference from | 864 | * Hardware gives signal values in dBm, decibel difference from |
843 | * one milliwatt. This is the preferred method since it is standardized | 865 | * one milliwatt. This is the preferred method since it is standardized |
@@ -854,10 +876,18 @@ enum ieee80211_tkip_key_type { | |||
854 | * @IEEE80211_HW_AMPDU_AGGREGATION: | 876 | * @IEEE80211_HW_AMPDU_AGGREGATION: |
855 | * Hardware supports 11n A-MPDU aggregation. | 877 | * Hardware supports 11n A-MPDU aggregation. |
856 | * | 878 | * |
857 | * @IEEE80211_HW_NO_STACK_DYNAMIC_PS: | 879 | * @IEEE80211_HW_SUPPORTS_PS: |
858 | * Hardware which has dynamic power save support, meaning | 880 | * Hardware has power save support (i.e. can go to sleep). |
859 | * that power save is enabled in idle periods, and don't need support | 881 | * |
860 | * from stack. | 882 | * @IEEE80211_HW_PS_NULLFUNC_STACK: |
883 | * Hardware requires nullfunc frame handling in stack, implies | ||
884 | * stack support for dynamic PS. | ||
885 | * | ||
886 | * @IEEE80211_HW_SUPPORTS_DYNAMIC_PS: | ||
887 | * Hardware has support for dynamic PS. | ||
888 | * | ||
889 | * @IEEE80211_HW_MFP_CAPABLE: | ||
890 | * Hardware supports management frame protection (MFP, IEEE 802.11w). | ||
861 | */ | 891 | */ |
862 | enum ieee80211_hw_flags { | 892 | enum ieee80211_hw_flags { |
863 | IEEE80211_HW_RX_INCLUDES_FCS = 1<<1, | 893 | IEEE80211_HW_RX_INCLUDES_FCS = 1<<1, |
@@ -865,12 +895,14 @@ enum ieee80211_hw_flags { | |||
865 | IEEE80211_HW_2GHZ_SHORT_SLOT_INCAPABLE = 1<<3, | 895 | IEEE80211_HW_2GHZ_SHORT_SLOT_INCAPABLE = 1<<3, |
866 | IEEE80211_HW_2GHZ_SHORT_PREAMBLE_INCAPABLE = 1<<4, | 896 | IEEE80211_HW_2GHZ_SHORT_PREAMBLE_INCAPABLE = 1<<4, |
867 | IEEE80211_HW_SIGNAL_UNSPEC = 1<<5, | 897 | IEEE80211_HW_SIGNAL_UNSPEC = 1<<5, |
868 | IEEE80211_HW_SIGNAL_DB = 1<<6, | 898 | IEEE80211_HW_SIGNAL_DBM = 1<<6, |
869 | IEEE80211_HW_SIGNAL_DBM = 1<<7, | 899 | IEEE80211_HW_NOISE_DBM = 1<<7, |
870 | IEEE80211_HW_NOISE_DBM = 1<<8, | 900 | IEEE80211_HW_SPECTRUM_MGMT = 1<<8, |
871 | IEEE80211_HW_SPECTRUM_MGMT = 1<<9, | 901 | IEEE80211_HW_AMPDU_AGGREGATION = 1<<9, |
872 | IEEE80211_HW_AMPDU_AGGREGATION = 1<<10, | 902 | IEEE80211_HW_SUPPORTS_PS = 1<<10, |
873 | IEEE80211_HW_NO_STACK_DYNAMIC_PS = 1<<11, | 903 | IEEE80211_HW_PS_NULLFUNC_STACK = 1<<11, |
904 | IEEE80211_HW_SUPPORTS_DYNAMIC_PS = 1<<12, | ||
905 | IEEE80211_HW_MFP_CAPABLE = 1<<13, | ||
874 | }; | 906 | }; |
875 | 907 | ||
876 | /** | 908 | /** |
@@ -890,9 +922,8 @@ enum ieee80211_hw_flags { | |||
890 | * @workqueue: single threaded workqueue available for driver use, | 922 | * @workqueue: single threaded workqueue available for driver use, |
891 | * allocated by mac80211 on registration and flushed when an | 923 | * allocated by mac80211 on registration and flushed when an |
892 | * interface is removed. | 924 | * interface is removed. |
893 | * NOTICE: All work performed on this workqueue should NEVER | 925 | * NOTICE: All work performed on this workqueue must not |
894 | * acquire the RTNL lock (i.e. Don't use the function | 926 | * acquire the RTNL lock. |
895 | * ieee80211_iterate_active_interfaces()) | ||
896 | * | 927 | * |
897 | * @priv: pointer to private area that was allocated for driver use | 928 | * @priv: pointer to private area that was allocated for driver use |
898 | * along with this structure. | 929 | * along with this structure. |
@@ -952,6 +983,19 @@ struct ieee80211_hw { | |||
952 | }; | 983 | }; |
953 | 984 | ||
954 | /** | 985 | /** |
986 | * wiphy_to_ieee80211_hw - return a mac80211 driver hw struct from a wiphy | ||
987 | * | ||
988 | * @wiphy: the &struct wiphy which we want to query | ||
989 | * | ||
990 | * mac80211 drivers can use this to get to their respective | ||
991 | * &struct ieee80211_hw. Drivers wishing to get to their own private | ||
992 | * structure can then access it via hw->priv. Note that mac802111 drivers should | ||
993 | * not use wiphy_priv() to try to get their private driver structure as this | ||
994 | * is already used internally by mac80211. | ||
995 | */ | ||
996 | struct ieee80211_hw *wiphy_to_ieee80211_hw(struct wiphy *wiphy); | ||
997 | |||
998 | /** | ||
955 | * SET_IEEE80211_DEV - set device for 802.11 hardware | 999 | * SET_IEEE80211_DEV - set device for 802.11 hardware |
956 | * | 1000 | * |
957 | * @hw: the &struct ieee80211_hw to set the device for | 1001 | * @hw: the &struct ieee80211_hw to set the device for |
@@ -1018,16 +1062,12 @@ ieee80211_get_alt_retry_rate(const struct ieee80211_hw *hw, | |||
1018 | * | 1062 | * |
1019 | * The set_key() callback in the &struct ieee80211_ops for a given | 1063 | * The set_key() callback in the &struct ieee80211_ops for a given |
1020 | * device is called to enable hardware acceleration of encryption and | 1064 | * device is called to enable hardware acceleration of encryption and |
1021 | * decryption. The callback takes an @address parameter that will be | 1065 | * decryption. The callback takes a @sta parameter that will be NULL |
1022 | * the broadcast address for default keys, the other station's hardware | 1066 | * for default keys or keys used for transmission only, or point to |
1023 | * address for individual keys or the zero address for keys that will | 1067 | * the station information for the peer for individual keys. |
1024 | * be used only for transmission. | ||
1025 | * Multiple transmission keys with the same key index may be used when | 1068 | * Multiple transmission keys with the same key index may be used when |
1026 | * VLANs are configured for an access point. | 1069 | * VLANs are configured for an access point. |
1027 | * | 1070 | * |
1028 | * The @local_address parameter will always be set to our own address, | ||
1029 | * this is only relevant if you support multiple local addresses. | ||
1030 | * | ||
1031 | * When transmitting, the TX control data will use the @hw_key_idx | 1071 | * When transmitting, the TX control data will use the @hw_key_idx |
1032 | * selected by the driver by modifying the &struct ieee80211_key_conf | 1072 | * selected by the driver by modifying the &struct ieee80211_key_conf |
1033 | * pointed to by the @key parameter to the set_key() function. | 1073 | * pointed to by the @key parameter to the set_key() function. |
@@ -1061,6 +1101,42 @@ ieee80211_get_alt_retry_rate(const struct ieee80211_hw *hw, | |||
1061 | */ | 1101 | */ |
1062 | 1102 | ||
1063 | /** | 1103 | /** |
1104 | * DOC: Powersave support | ||
1105 | * | ||
1106 | * mac80211 has support for various powersave implementations. | ||
1107 | * | ||
1108 | * First, it can support hardware that handles all powersaving by | ||
1109 | * itself, such hardware should simply set the %IEEE80211_HW_SUPPORTS_PS | ||
1110 | * hardware flag. In that case, it will be told about the desired | ||
1111 | * powersave mode depending on the association status, and the driver | ||
1112 | * must take care of sending nullfunc frames when necessary, i.e. when | ||
1113 | * entering and leaving powersave mode. The driver is required to look at | ||
1114 | * the AID in beacons and signal to the AP that it woke up when it finds | ||
1115 | * traffic directed to it. This mode supports dynamic PS by simply | ||
1116 | * enabling/disabling PS. | ||
1117 | * | ||
1118 | * Additionally, such hardware may set the %IEEE80211_HW_SUPPORTS_DYNAMIC_PS | ||
1119 | * flag to indicate that it can support dynamic PS mode itself (see below). | ||
1120 | * | ||
1121 | * Other hardware designs cannot send nullfunc frames by themselves and also | ||
1122 | * need software support for parsing the TIM bitmap. This is also supported | ||
1123 | * by mac80211 by combining the %IEEE80211_HW_SUPPORTS_PS and | ||
1124 | * %IEEE80211_HW_PS_NULLFUNC_STACK flags. The hardware is of course still | ||
1125 | * required to pass up beacons. Additionally, in this case, mac80211 will | ||
1126 | * wake up the hardware when multicast traffic is announced in the beacon. | ||
1127 | * | ||
1128 | * FIXME: I don't think we can be fast enough in software when we want to | ||
1129 | * receive multicast traffic? | ||
1130 | * | ||
1131 | * Dynamic powersave mode is an extension to normal powersave mode in which | ||
1132 | * the hardware stays awake for a user-specified period of time after sending | ||
1133 | * a frame so that reply frames need not be buffered and therefore delayed | ||
1134 | * to the next wakeup. This can either be supported by hardware, in which case | ||
1135 | * the driver needs to look at the @dynamic_ps_timeout hardware configuration | ||
1136 | * value, or by the stack if all nullfunc handling is in the stack. | ||
1137 | */ | ||
1138 | |||
1139 | /** | ||
1064 | * DOC: Frame filtering | 1140 | * DOC: Frame filtering |
1065 | * | 1141 | * |
1066 | * mac80211 requires to see many management frames for proper | 1142 | * mac80211 requires to see many management frames for proper |
@@ -1172,6 +1248,8 @@ enum ieee80211_ampdu_mlme_action { | |||
1172 | * configuration in the TX control data. This handler should, | 1248 | * configuration in the TX control data. This handler should, |
1173 | * preferably, never fail and stop queues appropriately, more | 1249 | * preferably, never fail and stop queues appropriately, more |
1174 | * importantly, however, it must never fail for A-MPDU-queues. | 1250 | * importantly, however, it must never fail for A-MPDU-queues. |
1251 | * This function should return NETDEV_TX_OK except in very | ||
1252 | * limited cases. | ||
1175 | * Must be implemented and atomic. | 1253 | * Must be implemented and atomic. |
1176 | * | 1254 | * |
1177 | * @start: Called before the first netdevice attached to the hardware | 1255 | * @start: Called before the first netdevice attached to the hardware |
@@ -1212,9 +1290,12 @@ enum ieee80211_ampdu_mlme_action { | |||
1212 | * | 1290 | * |
1213 | * @config: Handler for configuration requests. IEEE 802.11 code calls this | 1291 | * @config: Handler for configuration requests. IEEE 802.11 code calls this |
1214 | * function to change hardware configuration, e.g., channel. | 1292 | * function to change hardware configuration, e.g., channel. |
1293 | * This function should never fail but returns a negative error code | ||
1294 | * if it does. | ||
1215 | * | 1295 | * |
1216 | * @config_interface: Handler for configuration requests related to interfaces | 1296 | * @config_interface: Handler for configuration requests related to interfaces |
1217 | * (e.g. BSSID changes.) | 1297 | * (e.g. BSSID changes.) |
1298 | * Returns a negative error code which will be seen in userspace. | ||
1218 | * | 1299 | * |
1219 | * @bss_info_changed: Handler for configuration requests related to BSS | 1300 | * @bss_info_changed: Handler for configuration requests related to BSS |
1220 | * parameters that may vary during BSS's lifespan, and may affect low | 1301 | * parameters that may vary during BSS's lifespan, and may affect low |
@@ -1232,8 +1313,9 @@ enum ieee80211_ampdu_mlme_action { | |||
1232 | * | 1313 | * |
1233 | * @set_key: See the section "Hardware crypto acceleration" | 1314 | * @set_key: See the section "Hardware crypto acceleration" |
1234 | * This callback can sleep, and is only called between add_interface | 1315 | * This callback can sleep, and is only called between add_interface |
1235 | * and remove_interface calls, i.e. while the interface with the | 1316 | * and remove_interface calls, i.e. while the given virtual interface |
1236 | * given local_address is enabled. | 1317 | * is enabled. |
1318 | * Returns a negative error code if the key can't be added. | ||
1237 | * | 1319 | * |
1238 | * @update_tkip_key: See the section "Hardware crypto acceleration" | 1320 | * @update_tkip_key: See the section "Hardware crypto acceleration" |
1239 | * This callback will be called in the context of Rx. Called for drivers | 1321 | * This callback will be called in the context of Rx. Called for drivers |
@@ -1245,8 +1327,10 @@ enum ieee80211_ampdu_mlme_action { | |||
1245 | * bands. When the scan finishes, ieee80211_scan_completed() must be | 1327 | * bands. When the scan finishes, ieee80211_scan_completed() must be |
1246 | * called; note that it also must be called when the scan cannot finish | 1328 | * called; note that it also must be called when the scan cannot finish |
1247 | * because the hardware is turned off! Anything else is a bug! | 1329 | * because the hardware is turned off! Anything else is a bug! |
1330 | * Returns a negative error code which will be seen in userspace. | ||
1248 | * | 1331 | * |
1249 | * @get_stats: return low-level statistics | 1332 | * @get_stats: Return low-level statistics. |
1333 | * Returns zero if statistics are available. | ||
1250 | * | 1334 | * |
1251 | * @get_tkip_seq: If your device implements TKIP encryption in hardware this | 1335 | * @get_tkip_seq: If your device implements TKIP encryption in hardware this |
1252 | * callback should be provided to read the TKIP transmit IVs (both IV32 | 1336 | * callback should be provided to read the TKIP transmit IVs (both IV32 |
@@ -1260,6 +1344,7 @@ enum ieee80211_ampdu_mlme_action { | |||
1260 | * | 1344 | * |
1261 | * @conf_tx: Configure TX queue parameters (EDCF (aifs, cw_min, cw_max), | 1345 | * @conf_tx: Configure TX queue parameters (EDCF (aifs, cw_min, cw_max), |
1262 | * bursting) for a hardware TX queue. | 1346 | * bursting) for a hardware TX queue. |
1347 | * Returns a negative error code on failure. | ||
1263 | * | 1348 | * |
1264 | * @get_tx_stats: Get statistics of the current TX queue status. This is used | 1349 | * @get_tx_stats: Get statistics of the current TX queue status. This is used |
1265 | * to get number of currently queued packets (queue length), maximum queue | 1350 | * to get number of currently queued packets (queue length), maximum queue |
@@ -1268,8 +1353,12 @@ enum ieee80211_ampdu_mlme_action { | |||
1268 | * hw->ampdu_queues items. | 1353 | * hw->ampdu_queues items. |
1269 | * | 1354 | * |
1270 | * @get_tsf: Get the current TSF timer value from firmware/hardware. Currently, | 1355 | * @get_tsf: Get the current TSF timer value from firmware/hardware. Currently, |
1271 | * this is only used for IBSS mode debugging and, as such, is not a | 1356 | * this is only used for IBSS mode BSSID merging and debugging. Is not a |
1272 | * required function. Must be atomic. | 1357 | * required function. |
1358 | * | ||
1359 | * @set_tsf: Set the TSF timer to the specified value in the firmware/hardware. | ||
1360 | * Currently, this is only used for IBSS mode debugging. Is not a | ||
1361 | * required function. | ||
1273 | * | 1362 | * |
1274 | * @reset_tsf: Reset the TSF timer and allow firmware/hardware to synchronize | 1363 | * @reset_tsf: Reset the TSF timer and allow firmware/hardware to synchronize |
1275 | * with other STAs in the IBSS. This is only used in IBSS mode. This | 1364 | * with other STAs in the IBSS. This is only used in IBSS mode. This |
@@ -1279,13 +1368,15 @@ enum ieee80211_ampdu_mlme_action { | |||
1279 | * @tx_last_beacon: Determine whether the last IBSS beacon was sent by us. | 1368 | * @tx_last_beacon: Determine whether the last IBSS beacon was sent by us. |
1280 | * This is needed only for IBSS mode and the result of this function is | 1369 | * This is needed only for IBSS mode and the result of this function is |
1281 | * used to determine whether to reply to Probe Requests. | 1370 | * used to determine whether to reply to Probe Requests. |
1371 | * Returns non-zero if this device sent the last beacon. | ||
1282 | * | 1372 | * |
1283 | * @ampdu_action: Perform a certain A-MPDU action | 1373 | * @ampdu_action: Perform a certain A-MPDU action |
1284 | * The RA/TID combination determines the destination and TID we want | 1374 | * The RA/TID combination determines the destination and TID we want |
1285 | * the ampdu action to be performed for. The action is defined through | 1375 | * the ampdu action to be performed for. The action is defined through |
1286 | * ieee80211_ampdu_mlme_action. Starting sequence number (@ssn) | 1376 | * ieee80211_ampdu_mlme_action. Starting sequence number (@ssn) |
1287 | * is the first frame we expect to perform the action on. notice | 1377 | * is the first frame we expect to perform the action on. Notice |
1288 | * that TX/RX_STOP can pass NULL for this parameter. | 1378 | * that TX/RX_STOP can pass NULL for this parameter. |
1379 | * Returns a negative error code on failure. | ||
1289 | */ | 1380 | */ |
1290 | struct ieee80211_ops { | 1381 | struct ieee80211_ops { |
1291 | int (*tx)(struct ieee80211_hw *hw, struct sk_buff *skb); | 1382 | int (*tx)(struct ieee80211_hw *hw, struct sk_buff *skb); |
@@ -1310,12 +1401,13 @@ struct ieee80211_ops { | |||
1310 | int (*set_tim)(struct ieee80211_hw *hw, struct ieee80211_sta *sta, | 1401 | int (*set_tim)(struct ieee80211_hw *hw, struct ieee80211_sta *sta, |
1311 | bool set); | 1402 | bool set); |
1312 | int (*set_key)(struct ieee80211_hw *hw, enum set_key_cmd cmd, | 1403 | int (*set_key)(struct ieee80211_hw *hw, enum set_key_cmd cmd, |
1313 | const u8 *local_address, const u8 *address, | 1404 | struct ieee80211_vif *vif, struct ieee80211_sta *sta, |
1314 | struct ieee80211_key_conf *key); | 1405 | struct ieee80211_key_conf *key); |
1315 | void (*update_tkip_key)(struct ieee80211_hw *hw, | 1406 | void (*update_tkip_key)(struct ieee80211_hw *hw, |
1316 | struct ieee80211_key_conf *conf, const u8 *address, | 1407 | struct ieee80211_key_conf *conf, const u8 *address, |
1317 | u32 iv32, u16 *phase1key); | 1408 | u32 iv32, u16 *phase1key); |
1318 | int (*hw_scan)(struct ieee80211_hw *hw, u8 *ssid, size_t len); | 1409 | int (*hw_scan)(struct ieee80211_hw *hw, |
1410 | struct cfg80211_scan_request *req); | ||
1319 | int (*get_stats)(struct ieee80211_hw *hw, | 1411 | int (*get_stats)(struct ieee80211_hw *hw, |
1320 | struct ieee80211_low_level_stats *stats); | 1412 | struct ieee80211_low_level_stats *stats); |
1321 | void (*get_tkip_seq)(struct ieee80211_hw *hw, u8 hw_key_idx, | 1413 | void (*get_tkip_seq)(struct ieee80211_hw *hw, u8 hw_key_idx, |
@@ -1328,6 +1420,7 @@ struct ieee80211_ops { | |||
1328 | int (*get_tx_stats)(struct ieee80211_hw *hw, | 1420 | int (*get_tx_stats)(struct ieee80211_hw *hw, |
1329 | struct ieee80211_tx_queue_stats *stats); | 1421 | struct ieee80211_tx_queue_stats *stats); |
1330 | u64 (*get_tsf)(struct ieee80211_hw *hw); | 1422 | u64 (*get_tsf)(struct ieee80211_hw *hw); |
1423 | void (*set_tsf)(struct ieee80211_hw *hw, u64 tsf); | ||
1331 | void (*reset_tsf)(struct ieee80211_hw *hw); | 1424 | void (*reset_tsf)(struct ieee80211_hw *hw); |
1332 | int (*tx_last_beacon)(struct ieee80211_hw *hw); | 1425 | int (*tx_last_beacon)(struct ieee80211_hw *hw); |
1333 | int (*ampdu_action)(struct ieee80211_hw *hw, | 1426 | int (*ampdu_action)(struct ieee80211_hw *hw, |
@@ -1752,8 +1845,9 @@ void ieee80211_wake_queues(struct ieee80211_hw *hw); | |||
1752 | * mac80211 that the scan finished. | 1845 | * mac80211 that the scan finished. |
1753 | * | 1846 | * |
1754 | * @hw: the hardware that finished the scan | 1847 | * @hw: the hardware that finished the scan |
1848 | * @aborted: set to true if scan was aborted | ||
1755 | */ | 1849 | */ |
1756 | void ieee80211_scan_completed(struct ieee80211_hw *hw); | 1850 | void ieee80211_scan_completed(struct ieee80211_hw *hw, bool aborted); |
1757 | 1851 | ||
1758 | /** | 1852 | /** |
1759 | * ieee80211_iterate_active_interfaces - iterate active interfaces | 1853 | * ieee80211_iterate_active_interfaces - iterate active interfaces |
@@ -1962,4 +2056,34 @@ rate_lowest_index(struct ieee80211_supported_band *sband, | |||
1962 | int ieee80211_rate_control_register(struct rate_control_ops *ops); | 2056 | int ieee80211_rate_control_register(struct rate_control_ops *ops); |
1963 | void ieee80211_rate_control_unregister(struct rate_control_ops *ops); | 2057 | void ieee80211_rate_control_unregister(struct rate_control_ops *ops); |
1964 | 2058 | ||
2059 | static inline bool | ||
2060 | conf_is_ht20(struct ieee80211_conf *conf) | ||
2061 | { | ||
2062 | return conf->channel_type == NL80211_CHAN_HT20; | ||
2063 | } | ||
2064 | |||
2065 | static inline bool | ||
2066 | conf_is_ht40_minus(struct ieee80211_conf *conf) | ||
2067 | { | ||
2068 | return conf->channel_type == NL80211_CHAN_HT40MINUS; | ||
2069 | } | ||
2070 | |||
2071 | static inline bool | ||
2072 | conf_is_ht40_plus(struct ieee80211_conf *conf) | ||
2073 | { | ||
2074 | return conf->channel_type == NL80211_CHAN_HT40PLUS; | ||
2075 | } | ||
2076 | |||
2077 | static inline bool | ||
2078 | conf_is_ht40(struct ieee80211_conf *conf) | ||
2079 | { | ||
2080 | return conf_is_ht40_minus(conf) || conf_is_ht40_plus(conf); | ||
2081 | } | ||
2082 | |||
2083 | static inline bool | ||
2084 | conf_is_ht(struct ieee80211_conf *conf) | ||
2085 | { | ||
2086 | return conf->channel_type != NL80211_CHAN_NO_HT; | ||
2087 | } | ||
2088 | |||
1965 | #endif /* MAC80211_H */ | 2089 | #endif /* MAC80211_H */ |
diff --git a/include/net/net_namespace.h b/include/net/net_namespace.h index 6fc13d905c5f..ded434b032a4 100644 --- a/include/net/net_namespace.h +++ b/include/net/net_namespace.h | |||
@@ -109,11 +109,6 @@ extern struct list_head net_namespace_list; | |||
109 | #ifdef CONFIG_NET_NS | 109 | #ifdef CONFIG_NET_NS |
110 | extern void __put_net(struct net *net); | 110 | extern void __put_net(struct net *net); |
111 | 111 | ||
112 | static inline int net_alive(struct net *net) | ||
113 | { | ||
114 | return net && atomic_read(&net->count); | ||
115 | } | ||
116 | |||
117 | static inline struct net *get_net(struct net *net) | 112 | static inline struct net *get_net(struct net *net) |
118 | { | 113 | { |
119 | atomic_inc(&net->count); | 114 | atomic_inc(&net->count); |
@@ -145,11 +140,6 @@ int net_eq(const struct net *net1, const struct net *net2) | |||
145 | } | 140 | } |
146 | #else | 141 | #else |
147 | 142 | ||
148 | static inline int net_alive(struct net *net) | ||
149 | { | ||
150 | return 1; | ||
151 | } | ||
152 | |||
153 | static inline struct net *get_net(struct net *net) | 143 | static inline struct net *get_net(struct net *net) |
154 | { | 144 | { |
155 | return net; | 145 | return net; |
@@ -234,6 +224,23 @@ struct pernet_operations { | |||
234 | void (*exit)(struct net *net); | 224 | void (*exit)(struct net *net); |
235 | }; | 225 | }; |
236 | 226 | ||
227 | /* | ||
228 | * Use these carefully. If you implement a network device and it | ||
229 | * needs per network namespace operations use device pernet operations, | ||
230 | * otherwise use pernet subsys operations. | ||
231 | * | ||
232 | * This is critically important. Most of the network code cleanup | ||
233 | * runs with the assumption that dev_remove_pack has been called so no | ||
234 | * new packets will arrive during and after the cleanup functions have | ||
235 | * been called. dev_remove_pack is not per namespace so instead the | ||
236 | * guarantee of no more packets arriving in a network namespace is | ||
237 | * provided by ensuring that all network devices and all sockets have | ||
238 | * left the network namespace before the cleanup methods are called. | ||
239 | * | ||
240 | * For the longest time the ipv4 icmp code was registered as a pernet | ||
241 | * device which caused kernel oops, and panics during network | ||
242 | * namespace cleanup. So please don't get this wrong. | ||
243 | */ | ||
237 | extern int register_pernet_subsys(struct pernet_operations *); | 244 | extern int register_pernet_subsys(struct pernet_operations *); |
238 | extern void unregister_pernet_subsys(struct pernet_operations *); | 245 | extern void unregister_pernet_subsys(struct pernet_operations *); |
239 | extern int register_pernet_gen_subsys(int *id, struct pernet_operations *); | 246 | extern int register_pernet_gen_subsys(int *id, struct pernet_operations *); |
diff --git a/include/net/netns/ipv4.h b/include/net/netns/ipv4.h index 977f482d97a9..2eb3814d6258 100644 --- a/include/net/netns/ipv4.h +++ b/include/net/netns/ipv4.h | |||
@@ -54,5 +54,18 @@ struct netns_ipv4 { | |||
54 | 54 | ||
55 | struct timer_list rt_secret_timer; | 55 | struct timer_list rt_secret_timer; |
56 | atomic_t rt_genid; | 56 | atomic_t rt_genid; |
57 | |||
58 | #ifdef CONFIG_IP_MROUTE | ||
59 | struct sock *mroute_sk; | ||
60 | struct mfc_cache **mfc_cache_array; | ||
61 | struct vif_device *vif_table; | ||
62 | int maxvif; | ||
63 | atomic_t cache_resolve_queue_len; | ||
64 | int mroute_do_assert; | ||
65 | int mroute_do_pim; | ||
66 | #if defined(CONFIG_IP_PIMSM_V1) || defined(CONFIG_IP_PIMSM_V2) | ||
67 | int mroute_reg_vif_num; | ||
68 | #endif | ||
69 | #endif | ||
57 | }; | 70 | }; |
58 | #endif | 71 | #endif |
diff --git a/include/net/netrom.h b/include/net/netrom.h index f06852bba62a..15696b1fd30f 100644 --- a/include/net/netrom.h +++ b/include/net/netrom.h | |||
@@ -59,10 +59,6 @@ enum { | |||
59 | #define NR_MAX_WINDOW_SIZE 127 /* Maximum Window Allowable - 127 */ | 59 | #define NR_MAX_WINDOW_SIZE 127 /* Maximum Window Allowable - 127 */ |
60 | #define NR_MAX_PACKET_SIZE 236 /* Maximum Packet Length - 236 */ | 60 | #define NR_MAX_PACKET_SIZE 236 /* Maximum Packet Length - 236 */ |
61 | 61 | ||
62 | struct nr_private { | ||
63 | struct net_device_stats stats; | ||
64 | }; | ||
65 | |||
66 | struct nr_sock { | 62 | struct nr_sock { |
67 | struct sock sock; | 63 | struct sock sock; |
68 | ax25_address user_addr, source_addr, dest_addr; | 64 | ax25_address user_addr, source_addr, dest_addr; |
diff --git a/include/net/phonet/phonet.h b/include/net/phonet/phonet.h index 057b0a8a2885..d43f71b5ec00 100644 --- a/include/net/phonet/phonet.h +++ b/include/net/phonet/phonet.h | |||
@@ -105,7 +105,6 @@ void phonet_proto_unregister(int protocol, struct phonet_protocol *pp); | |||
105 | 105 | ||
106 | int phonet_sysctl_init(void); | 106 | int phonet_sysctl_init(void); |
107 | void phonet_sysctl_exit(void); | 107 | void phonet_sysctl_exit(void); |
108 | void phonet_netlink_register(void); | ||
109 | int isi_register(void); | 108 | int isi_register(void); |
110 | void isi_unregister(void); | 109 | void isi_unregister(void); |
111 | 110 | ||
diff --git a/include/net/phonet/pn_dev.h b/include/net/phonet/pn_dev.h index aa1c59a1d33f..5054dc5ea2c2 100644 --- a/include/net/phonet/pn_dev.h +++ b/include/net/phonet/pn_dev.h | |||
@@ -28,7 +28,7 @@ struct phonet_device_list { | |||
28 | spinlock_t lock; | 28 | spinlock_t lock; |
29 | }; | 29 | }; |
30 | 30 | ||
31 | extern struct phonet_device_list pndevs; | 31 | struct phonet_device_list *phonet_device_list(struct net *net); |
32 | 32 | ||
33 | struct phonet_device { | 33 | struct phonet_device { |
34 | struct list_head list; | 34 | struct list_head list; |
@@ -36,8 +36,9 @@ struct phonet_device { | |||
36 | DECLARE_BITMAP(addrs, 64); | 36 | DECLARE_BITMAP(addrs, 64); |
37 | }; | 37 | }; |
38 | 38 | ||
39 | void phonet_device_init(void); | 39 | int phonet_device_init(void); |
40 | void phonet_device_exit(void); | 40 | void phonet_device_exit(void); |
41 | int phonet_netlink_register(void); | ||
41 | struct net_device *phonet_device_get(struct net *net); | 42 | struct net_device *phonet_device_get(struct net *net); |
42 | 43 | ||
43 | int phonet_address_add(struct net_device *dev, u8 addr); | 44 | int phonet_address_add(struct net_device *dev, u8 addr); |
diff --git a/include/net/pkt_sched.h b/include/net/pkt_sched.h index 4082f39f5079..e37fe3129c17 100644 --- a/include/net/pkt_sched.h +++ b/include/net/pkt_sched.h | |||
@@ -85,6 +85,7 @@ extern struct qdisc_rate_table *qdisc_get_rtab(struct tc_ratespec *r, | |||
85 | struct nlattr *tab); | 85 | struct nlattr *tab); |
86 | extern void qdisc_put_rtab(struct qdisc_rate_table *tab); | 86 | extern void qdisc_put_rtab(struct qdisc_rate_table *tab); |
87 | extern void qdisc_put_stab(struct qdisc_size_table *tab); | 87 | extern void qdisc_put_stab(struct qdisc_size_table *tab); |
88 | extern void qdisc_warn_nonwc(char *txt, struct Qdisc *qdisc); | ||
88 | 89 | ||
89 | extern void __qdisc_run(struct Qdisc *q); | 90 | extern void __qdisc_run(struct Qdisc *q); |
90 | 91 | ||
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h index f8c47429044a..3d78a4d22460 100644 --- a/include/net/sch_generic.h +++ b/include/net/sch_generic.h | |||
@@ -42,9 +42,10 @@ struct Qdisc | |||
42 | int (*enqueue)(struct sk_buff *skb, struct Qdisc *dev); | 42 | int (*enqueue)(struct sk_buff *skb, struct Qdisc *dev); |
43 | struct sk_buff * (*dequeue)(struct Qdisc *dev); | 43 | struct sk_buff * (*dequeue)(struct Qdisc *dev); |
44 | unsigned flags; | 44 | unsigned flags; |
45 | #define TCQ_F_BUILTIN 1 | 45 | #define TCQ_F_BUILTIN 1 |
46 | #define TCQ_F_THROTTLED 2 | 46 | #define TCQ_F_THROTTLED 2 |
47 | #define TCQ_F_INGRESS 4 | 47 | #define TCQ_F_INGRESS 4 |
48 | #define TCQ_F_WARN_NONWC (1 << 16) | ||
48 | int padded; | 49 | int padded; |
49 | struct Qdisc_ops *ops; | 50 | struct Qdisc_ops *ops; |
50 | struct qdisc_size_table *stab; | 51 | struct qdisc_size_table *stab; |
diff --git a/include/net/sctp/checksum.h b/include/net/sctp/checksum.h index 2fec3c366e81..befc8d2a1b9f 100644 --- a/include/net/sctp/checksum.h +++ b/include/net/sctp/checksum.h | |||
@@ -46,14 +46,14 @@ | |||
46 | #include <net/sctp/sctp.h> | 46 | #include <net/sctp/sctp.h> |
47 | #include <linux/crc32c.h> | 47 | #include <linux/crc32c.h> |
48 | 48 | ||
49 | static inline __be32 sctp_crc32c(__be32 crc, u8 *buffer, u16 length) | 49 | static inline __u32 sctp_crc32c(__u32 crc, u8 *buffer, u16 length) |
50 | { | 50 | { |
51 | return (__force __be32)crc32c((__force u32)crc, buffer, length); | 51 | return crc32c(crc, buffer, length); |
52 | } | 52 | } |
53 | 53 | ||
54 | static inline __be32 sctp_start_cksum(__u8 *buffer, __u16 length) | 54 | static inline __u32 sctp_start_cksum(__u8 *buffer, __u16 length) |
55 | { | 55 | { |
56 | __be32 crc = ~cpu_to_be32(0); | 56 | __u32 crc = ~(__u32)0; |
57 | __u8 zero[sizeof(__u32)] = {0}; | 57 | __u8 zero[sizeof(__u32)] = {0}; |
58 | 58 | ||
59 | /* Optimize this routine to be SCTP specific, knowing how | 59 | /* Optimize this routine to be SCTP specific, knowing how |
@@ -72,12 +72,12 @@ static inline __be32 sctp_start_cksum(__u8 *buffer, __u16 length) | |||
72 | return crc; | 72 | return crc; |
73 | } | 73 | } |
74 | 74 | ||
75 | static inline __be32 sctp_update_cksum(__u8 *buffer, __u16 length, __be32 crc32) | 75 | static inline __u32 sctp_update_cksum(__u8 *buffer, __u16 length, __u32 crc32) |
76 | { | 76 | { |
77 | return sctp_crc32c(crc32, buffer, length); | 77 | return sctp_crc32c(crc32, buffer, length); |
78 | } | 78 | } |
79 | 79 | ||
80 | static inline __be32 sctp_end_cksum(__be32 crc32) | 80 | static inline __le32 sctp_end_cksum(__be32 crc32) |
81 | { | 81 | { |
82 | return (__force __be32)~cpu_to_le32((__force u32)crc32); | 82 | return cpu_to_le32(~crc32); |
83 | } | 83 | } |
diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h index bbb7742195b0..9e226be3be69 100644 --- a/include/net/sctp/sctp.h +++ b/include/net/sctp/sctp.h | |||
@@ -138,6 +138,8 @@ void sctp_write_space(struct sock *sk); | |||
138 | unsigned int sctp_poll(struct file *file, struct socket *sock, | 138 | unsigned int sctp_poll(struct file *file, struct socket *sock, |
139 | poll_table *wait); | 139 | poll_table *wait); |
140 | void sctp_sock_rfree(struct sk_buff *skb); | 140 | void sctp_sock_rfree(struct sk_buff *skb); |
141 | void sctp_copy_sock(struct sock *newsk, struct sock *sk, | ||
142 | struct sctp_association *asoc); | ||
141 | extern struct percpu_counter sctp_sockets_allocated; | 143 | extern struct percpu_counter sctp_sockets_allocated; |
142 | 144 | ||
143 | /* | 145 | /* |
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h index 9661d7b765f0..23f08fe1d50a 100644 --- a/include/net/sctp/structs.h +++ b/include/net/sctp/structs.h | |||
@@ -218,6 +218,10 @@ extern struct sctp_globals { | |||
218 | 218 | ||
219 | /* Flag to idicate if SCTP-AUTH is enabled */ | 219 | /* Flag to idicate if SCTP-AUTH is enabled */ |
220 | int auth_enable; | 220 | int auth_enable; |
221 | |||
222 | /* Flag to indicate whether computing and verifying checksum | ||
223 | * is disabled. */ | ||
224 | int checksum_disable; | ||
221 | } sctp_globals; | 225 | } sctp_globals; |
222 | 226 | ||
223 | #define sctp_rto_initial (sctp_globals.rto_initial) | 227 | #define sctp_rto_initial (sctp_globals.rto_initial) |
@@ -252,6 +256,7 @@ extern struct sctp_globals { | |||
252 | #define sctp_addip_noauth (sctp_globals.addip_noauth_enable) | 256 | #define sctp_addip_noauth (sctp_globals.addip_noauth_enable) |
253 | #define sctp_prsctp_enable (sctp_globals.prsctp_enable) | 257 | #define sctp_prsctp_enable (sctp_globals.prsctp_enable) |
254 | #define sctp_auth_enable (sctp_globals.auth_enable) | 258 | #define sctp_auth_enable (sctp_globals.auth_enable) |
259 | #define sctp_checksum_disable (sctp_globals.checksum_disable) | ||
255 | 260 | ||
256 | /* SCTP Socket type: UDP or TCP style. */ | 261 | /* SCTP Socket type: UDP or TCP style. */ |
257 | typedef enum { | 262 | typedef enum { |
@@ -905,8 +910,10 @@ struct sctp_transport { | |||
905 | * should be set. Every time the RTT | 910 | * should be set. Every time the RTT |
906 | * calculation completes (i.e. the DATA chunk | 911 | * calculation completes (i.e. the DATA chunk |
907 | * is SACK'd) clear this flag. | 912 | * is SACK'd) clear this flag. |
913 | * hb_sent : a flag that signals that we have a pending heartbeat. | ||
908 | */ | 914 | */ |
909 | __u8 rto_pending; | 915 | __u8 rto_pending; |
916 | __u8 hb_sent; | ||
910 | 917 | ||
911 | /* Flag to track the current fast recovery state */ | 918 | /* Flag to track the current fast recovery state */ |
912 | __u8 fast_recovery; | 919 | __u8 fast_recovery; |
diff --git a/include/net/sock.h b/include/net/sock.h index eefeeaf7fc46..4bb1ff9fd15b 100644 --- a/include/net/sock.h +++ b/include/net/sock.h | |||
@@ -158,7 +158,7 @@ struct sock_common { | |||
158 | * @sk_allocation: allocation mode | 158 | * @sk_allocation: allocation mode |
159 | * @sk_sndbuf: size of send buffer in bytes | 159 | * @sk_sndbuf: size of send buffer in bytes |
160 | * @sk_flags: %SO_LINGER (l_onoff), %SO_BROADCAST, %SO_KEEPALIVE, | 160 | * @sk_flags: %SO_LINGER (l_onoff), %SO_BROADCAST, %SO_KEEPALIVE, |
161 | * %SO_OOBINLINE settings | 161 | * %SO_OOBINLINE settings, %SO_TIMESTAMPING settings |
162 | * @sk_no_check: %SO_NO_CHECK setting, wether or not checkup packets | 162 | * @sk_no_check: %SO_NO_CHECK setting, wether or not checkup packets |
163 | * @sk_route_caps: route capabilities (e.g. %NETIF_F_TSO) | 163 | * @sk_route_caps: route capabilities (e.g. %NETIF_F_TSO) |
164 | * @sk_gso_type: GSO type (e.g. %SKB_GSO_TCPV4) | 164 | * @sk_gso_type: GSO type (e.g. %SKB_GSO_TCPV4) |
@@ -488,6 +488,13 @@ enum sock_flags { | |||
488 | SOCK_RCVTSTAMPNS, /* %SO_TIMESTAMPNS setting */ | 488 | SOCK_RCVTSTAMPNS, /* %SO_TIMESTAMPNS setting */ |
489 | SOCK_LOCALROUTE, /* route locally only, %SO_DONTROUTE setting */ | 489 | SOCK_LOCALROUTE, /* route locally only, %SO_DONTROUTE setting */ |
490 | SOCK_QUEUE_SHRUNK, /* write queue has been shrunk recently */ | 490 | SOCK_QUEUE_SHRUNK, /* write queue has been shrunk recently */ |
491 | SOCK_TIMESTAMPING_TX_HARDWARE, /* %SOF_TIMESTAMPING_TX_HARDWARE */ | ||
492 | SOCK_TIMESTAMPING_TX_SOFTWARE, /* %SOF_TIMESTAMPING_TX_SOFTWARE */ | ||
493 | SOCK_TIMESTAMPING_RX_HARDWARE, /* %SOF_TIMESTAMPING_RX_HARDWARE */ | ||
494 | SOCK_TIMESTAMPING_RX_SOFTWARE, /* %SOF_TIMESTAMPING_RX_SOFTWARE */ | ||
495 | SOCK_TIMESTAMPING_SOFTWARE, /* %SOF_TIMESTAMPING_SOFTWARE */ | ||
496 | SOCK_TIMESTAMPING_RAW_HARDWARE, /* %SOF_TIMESTAMPING_RAW_HARDWARE */ | ||
497 | SOCK_TIMESTAMPING_SYS_HARDWARE, /* %SOF_TIMESTAMPING_SYS_HARDWARE */ | ||
491 | }; | 498 | }; |
492 | 499 | ||
493 | static inline void sock_copy_flags(struct sock *nsk, struct sock *osk) | 500 | static inline void sock_copy_flags(struct sock *nsk, struct sock *osk) |
@@ -944,6 +951,11 @@ extern struct sk_buff *sock_alloc_send_skb(struct sock *sk, | |||
944 | unsigned long size, | 951 | unsigned long size, |
945 | int noblock, | 952 | int noblock, |
946 | int *errcode); | 953 | int *errcode); |
954 | extern struct sk_buff *sock_alloc_send_pskb(struct sock *sk, | ||
955 | unsigned long header_len, | ||
956 | unsigned long data_len, | ||
957 | int noblock, | ||
958 | int *errcode); | ||
947 | extern void *sock_kmalloc(struct sock *sk, int size, | 959 | extern void *sock_kmalloc(struct sock *sk, int size, |
948 | gfp_t priority); | 960 | gfp_t priority); |
949 | extern void sock_kfree_s(struct sock *sk, void *mem, int size); | 961 | extern void sock_kfree_s(struct sock *sk, void *mem, int size); |
@@ -1340,14 +1352,45 @@ static __inline__ void | |||
1340 | sock_recv_timestamp(struct msghdr *msg, struct sock *sk, struct sk_buff *skb) | 1352 | sock_recv_timestamp(struct msghdr *msg, struct sock *sk, struct sk_buff *skb) |
1341 | { | 1353 | { |
1342 | ktime_t kt = skb->tstamp; | 1354 | ktime_t kt = skb->tstamp; |
1355 | struct skb_shared_hwtstamps *hwtstamps = skb_hwtstamps(skb); | ||
1343 | 1356 | ||
1344 | if (sock_flag(sk, SOCK_RCVTSTAMP)) | 1357 | /* |
1358 | * generate control messages if | ||
1359 | * - receive time stamping in software requested (SOCK_RCVTSTAMP | ||
1360 | * or SOCK_TIMESTAMPING_RX_SOFTWARE) | ||
1361 | * - software time stamp available and wanted | ||
1362 | * (SOCK_TIMESTAMPING_SOFTWARE) | ||
1363 | * - hardware time stamps available and wanted | ||
1364 | * (SOCK_TIMESTAMPING_SYS_HARDWARE or | ||
1365 | * SOCK_TIMESTAMPING_RAW_HARDWARE) | ||
1366 | */ | ||
1367 | if (sock_flag(sk, SOCK_RCVTSTAMP) || | ||
1368 | sock_flag(sk, SOCK_TIMESTAMPING_RX_SOFTWARE) || | ||
1369 | (kt.tv64 && sock_flag(sk, SOCK_TIMESTAMPING_SOFTWARE)) || | ||
1370 | (hwtstamps->hwtstamp.tv64 && | ||
1371 | sock_flag(sk, SOCK_TIMESTAMPING_RAW_HARDWARE)) || | ||
1372 | (hwtstamps->syststamp.tv64 && | ||
1373 | sock_flag(sk, SOCK_TIMESTAMPING_SYS_HARDWARE))) | ||
1345 | __sock_recv_timestamp(msg, sk, skb); | 1374 | __sock_recv_timestamp(msg, sk, skb); |
1346 | else | 1375 | else |
1347 | sk->sk_stamp = kt; | 1376 | sk->sk_stamp = kt; |
1348 | } | 1377 | } |
1349 | 1378 | ||
1350 | /** | 1379 | /** |
1380 | * sock_tx_timestamp - checks whether the outgoing packet is to be time stamped | ||
1381 | * @msg: outgoing packet | ||
1382 | * @sk: socket sending this packet | ||
1383 | * @shtx: filled with instructions for time stamping | ||
1384 | * | ||
1385 | * Currently only depends on SOCK_TIMESTAMPING* flags. Returns error code if | ||
1386 | * parameters are invalid. | ||
1387 | */ | ||
1388 | extern int sock_tx_timestamp(struct msghdr *msg, | ||
1389 | struct sock *sk, | ||
1390 | union skb_shared_tx *shtx); | ||
1391 | |||
1392 | |||
1393 | /** | ||
1351 | * sk_eat_skb - Release a skb if it is no longer needed | 1394 | * sk_eat_skb - Release a skb if it is no longer needed |
1352 | * @sk: socket to eat this skb from | 1395 | * @sk: socket to eat this skb from |
1353 | * @skb: socket buffer to eat | 1396 | * @skb: socket buffer to eat |
@@ -1415,7 +1458,7 @@ static inline struct sock *skb_steal_sock(struct sk_buff *skb) | |||
1415 | return NULL; | 1458 | return NULL; |
1416 | } | 1459 | } |
1417 | 1460 | ||
1418 | extern void sock_enable_timestamp(struct sock *sk); | 1461 | extern void sock_enable_timestamp(struct sock *sk, int flag); |
1419 | extern int sock_get_timestamp(struct sock *, struct timeval __user *); | 1462 | extern int sock_get_timestamp(struct sock *, struct timeval __user *); |
1420 | extern int sock_get_timestampns(struct sock *, struct timespec __user *); | 1463 | extern int sock_get_timestampns(struct sock *, struct timespec __user *); |
1421 | 1464 | ||
diff --git a/include/net/transp_v6.h b/include/net/transp_v6.h index 876b6f2bb4fd..bfb240c6cf79 100644 --- a/include/net/transp_v6.h +++ b/include/net/transp_v6.h | |||
@@ -46,7 +46,7 @@ extern int datagram_send_ctl(struct net *net, | |||
46 | struct ipv6_txoptions *opt, | 46 | struct ipv6_txoptions *opt, |
47 | int *hlimit, int *tclass); | 47 | int *hlimit, int *tclass); |
48 | 48 | ||
49 | #define LOOPBACK4_IPV6 __constant_htonl(0x7f000006) | 49 | #define LOOPBACK4_IPV6 cpu_to_be32(0x7f000006) |
50 | 50 | ||
51 | /* | 51 | /* |
52 | * address family specific functions | 52 | * address family specific functions |
diff --git a/include/net/wireless.h b/include/net/wireless.h index 21c5d966142d..1c6285eb1666 100644 --- a/include/net/wireless.h +++ b/include/net/wireless.h | |||
@@ -181,12 +181,25 @@ struct ieee80211_supported_band { | |||
181 | * struct wiphy - wireless hardware description | 181 | * struct wiphy - wireless hardware description |
182 | * @idx: the wiphy index assigned to this item | 182 | * @idx: the wiphy index assigned to this item |
183 | * @class_dev: the class device representing /sys/class/ieee80211/<wiphy-name> | 183 | * @class_dev: the class device representing /sys/class/ieee80211/<wiphy-name> |
184 | * @fw_handles_regulatory: tells us the firmware for this device | 184 | * @custom_regulatory: tells us the driver for this device |
185 | * has its own regulatory solution and cannot identify the | 185 | * has its own custom regulatory domain and cannot identify the |
186 | * ISO / IEC 3166 alpha2 it belongs to. When this is enabled | 186 | * ISO / IEC 3166 alpha2 it belongs to. When this is enabled |
187 | * we will disregard the first regulatory hint (when the | 187 | * we will disregard the first regulatory hint (when the |
188 | * initiator is %REGDOM_SET_BY_CORE). | 188 | * initiator is %REGDOM_SET_BY_CORE). |
189 | * @strict_regulatory: tells us the driver for this device will ignore | ||
190 | * regulatory domain settings until it gets its own regulatory domain | ||
191 | * via its regulatory_hint(). After its gets its own regulatory domain | ||
192 | * it will only allow further regulatory domain settings to further | ||
193 | * enhance compliance. For example if channel 13 and 14 are disabled | ||
194 | * by this regulatory domain no user regulatory domain can enable these | ||
195 | * channels at a later time. This can be used for devices which do not | ||
196 | * have calibration information gauranteed for frequencies or settings | ||
197 | * outside of its regulatory domain. | ||
189 | * @reg_notifier: the driver's regulatory notification callback | 198 | * @reg_notifier: the driver's regulatory notification callback |
199 | * @regd: the driver's regulatory domain, if one was requested via | ||
200 | * the regulatory_hint() API. This can be used by the driver | ||
201 | * on the reg_notifier() if it chooses to ignore future | ||
202 | * regulatory domain changes caused by other drivers. | ||
190 | */ | 203 | */ |
191 | struct wiphy { | 204 | struct wiphy { |
192 | /* assign these fields before you register the wiphy */ | 205 | /* assign these fields before you register the wiphy */ |
@@ -197,7 +210,11 @@ struct wiphy { | |||
197 | /* Supported interface modes, OR together BIT(NL80211_IFTYPE_...) */ | 210 | /* Supported interface modes, OR together BIT(NL80211_IFTYPE_...) */ |
198 | u16 interface_modes; | 211 | u16 interface_modes; |
199 | 212 | ||
200 | bool fw_handles_regulatory; | 213 | bool custom_regulatory; |
214 | bool strict_regulatory; | ||
215 | |||
216 | int bss_priv_size; | ||
217 | u8 max_scan_ssids; | ||
201 | 218 | ||
202 | /* If multiple wiphys are registered and you're handed e.g. | 219 | /* If multiple wiphys are registered and you're handed e.g. |
203 | * a regular netdev with assigned ieee80211_ptr, you won't | 220 | * a regular netdev with assigned ieee80211_ptr, you won't |
@@ -209,10 +226,13 @@ struct wiphy { | |||
209 | struct ieee80211_supported_band *bands[IEEE80211_NUM_BANDS]; | 226 | struct ieee80211_supported_band *bands[IEEE80211_NUM_BANDS]; |
210 | 227 | ||
211 | /* Lets us get back the wiphy on the callback */ | 228 | /* Lets us get back the wiphy on the callback */ |
212 | int (*reg_notifier)(struct wiphy *wiphy, enum reg_set_by setby); | 229 | int (*reg_notifier)(struct wiphy *wiphy, |
230 | struct regulatory_request *request); | ||
213 | 231 | ||
214 | /* fields below are read-only, assigned by cfg80211 */ | 232 | /* fields below are read-only, assigned by cfg80211 */ |
215 | 233 | ||
234 | const struct ieee80211_regdomain *regd; | ||
235 | |||
216 | /* the item in /sys/class/ieee80211/ points to this, | 236 | /* the item in /sys/class/ieee80211/ points to this, |
217 | * you need use set_wiphy_dev() (see below) */ | 237 | * you need use set_wiphy_dev() (see below) */ |
218 | struct device dev; | 238 | struct device dev; |
@@ -361,7 +381,7 @@ ieee80211_get_channel(struct wiphy *wiphy, int freq) | |||
361 | */ | 381 | */ |
362 | struct ieee80211_rate * | 382 | struct ieee80211_rate * |
363 | ieee80211_get_response_rate(struct ieee80211_supported_band *sband, | 383 | ieee80211_get_response_rate(struct ieee80211_supported_band *sband, |
364 | u64 basic_rates, int bitrate); | 384 | u32 basic_rates, int bitrate); |
365 | 385 | ||
366 | /** | 386 | /** |
367 | * regulatory_hint - driver hint to the wireless core a regulatory domain | 387 | * regulatory_hint - driver hint to the wireless core a regulatory domain |
@@ -395,4 +415,45 @@ extern void regulatory_hint(struct wiphy *wiphy, const char *alpha2); | |||
395 | extern void regulatory_hint_11d(struct wiphy *wiphy, | 415 | extern void regulatory_hint_11d(struct wiphy *wiphy, |
396 | u8 *country_ie, | 416 | u8 *country_ie, |
397 | u8 country_ie_len); | 417 | u8 country_ie_len); |
418 | |||
419 | /** | ||
420 | * wiphy_apply_custom_regulatory - apply a custom driver regulatory domain | ||
421 | * @wiphy: the wireless device we want to process the regulatory domain on | ||
422 | * @regd: the custom regulatory domain to use for this wiphy | ||
423 | * | ||
424 | * Drivers can sometimes have custom regulatory domains which do not apply | ||
425 | * to a specific country. Drivers can use this to apply such custom regulatory | ||
426 | * domains. This routine must be called prior to wiphy registration. The | ||
427 | * custom regulatory domain will be trusted completely and as such previous | ||
428 | * default channel settings will be disregarded. If no rule is found for a | ||
429 | * channel on the regulatory domain the channel will be disabled. | ||
430 | */ | ||
431 | extern void wiphy_apply_custom_regulatory( | ||
432 | struct wiphy *wiphy, | ||
433 | const struct ieee80211_regdomain *regd); | ||
434 | |||
435 | /** | ||
436 | * freq_reg_info - get regulatory information for the given frequency | ||
437 | * @wiphy: the wiphy for which we want to process this rule for | ||
438 | * @center_freq: Frequency in KHz for which we want regulatory information for | ||
439 | * @bandwidth: the bandwidth requirement you have in KHz, if you do not have one | ||
440 | * you can set this to 0. If this frequency is allowed we then set | ||
441 | * this value to the maximum allowed bandwidth. | ||
442 | * @reg_rule: the regulatory rule which we have for this frequency | ||
443 | * | ||
444 | * Use this function to get the regulatory rule for a specific frequency on | ||
445 | * a given wireless device. If the device has a specific regulatory domain | ||
446 | * it wants to follow we respect that unless a country IE has been received | ||
447 | * and processed already. | ||
448 | * | ||
449 | * Returns 0 if it was able to find a valid regulatory rule which does | ||
450 | * apply to the given center_freq otherwise it returns non-zero. It will | ||
451 | * also return -ERANGE if we determine the given center_freq does not even have | ||
452 | * a regulatory rule for a frequency range in the center_freq's band. See | ||
453 | * freq_in_rule_band() for our current definition of a band -- this is purely | ||
454 | * subjective and right now its 802.11 specific. | ||
455 | */ | ||
456 | extern int freq_reg_info(struct wiphy *wiphy, u32 center_freq, u32 *bandwidth, | ||
457 | const struct ieee80211_reg_rule **reg_rule); | ||
458 | |||
398 | #endif /* __NET_WIRELESS_H */ | 459 | #endif /* __NET_WIRELESS_H */ |