| .. | .. |
|---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0 */ |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Merged with mainline rtllib.h in Aug 2004. Original ieee802_11 |
|---|
| 3 | 4 | * remains copyright by the original authors |
|---|
| .. | .. |
|---|
| 15 | 16 | * |
|---|
| 16 | 17 | * Modified for Realtek's wi-fi cards by Andrea Merello |
|---|
| 17 | 18 | * <andrea.merello@gmail.com> |
|---|
| 18 | | - * |
|---|
| 19 | | - * This program is free software; you can redistribute it and/or modify |
|---|
| 20 | | - * it under the terms of the GNU General Public License version 2 as |
|---|
| 21 | | - * published by the Free Software Foundation. See README and COPYING for |
|---|
| 22 | | - * more details. |
|---|
| 23 | 19 | */ |
|---|
| 24 | 20 | #ifndef RTLLIB_H |
|---|
| 25 | 21 | #define RTLLIB_H |
|---|
| .. | .. |
|---|
| 483 | 479 | #define P80211_OUI_LEN 3 |
|---|
| 484 | 480 | |
|---|
| 485 | 481 | struct rtllib_snap_hdr { |
|---|
| 486 | | - |
|---|
| 487 | 482 | u8 dsap; /* always 0xAA */ |
|---|
| 488 | 483 | u8 ssap; /* always 0xAA */ |
|---|
| 489 | 484 | u8 ctrl; /* always 0x03 */ |
|---|
| .. | .. |
|---|
| 733 | 728 | struct rtllib_hdr { |
|---|
| 734 | 729 | __le16 frame_ctl; |
|---|
| 735 | 730 | __le16 duration_id; |
|---|
| 736 | | - u8 payload[0]; |
|---|
| 731 | + u8 payload[]; |
|---|
| 737 | 732 | } __packed; |
|---|
| 738 | 733 | |
|---|
| 739 | 734 | struct rtllib_hdr_1addr { |
|---|
| 740 | 735 | __le16 frame_ctl; |
|---|
| 741 | 736 | __le16 duration_id; |
|---|
| 742 | 737 | u8 addr1[ETH_ALEN]; |
|---|
| 743 | | - u8 payload[0]; |
|---|
| 738 | + u8 payload[]; |
|---|
| 744 | 739 | } __packed; |
|---|
| 745 | 740 | |
|---|
| 746 | 741 | struct rtllib_hdr_2addr { |
|---|
| .. | .. |
|---|
| 748 | 743 | __le16 duration_id; |
|---|
| 749 | 744 | u8 addr1[ETH_ALEN]; |
|---|
| 750 | 745 | u8 addr2[ETH_ALEN]; |
|---|
| 751 | | - u8 payload[0]; |
|---|
| 746 | + u8 payload[]; |
|---|
| 752 | 747 | } __packed; |
|---|
| 753 | 748 | |
|---|
| 754 | 749 | struct rtllib_hdr_3addr { |
|---|
| .. | .. |
|---|
| 758 | 753 | u8 addr2[ETH_ALEN]; |
|---|
| 759 | 754 | u8 addr3[ETH_ALEN]; |
|---|
| 760 | 755 | __le16 seq_ctl; |
|---|
| 761 | | - u8 payload[0]; |
|---|
| 756 | + u8 payload[]; |
|---|
| 762 | 757 | } __packed; |
|---|
| 763 | 758 | |
|---|
| 764 | 759 | struct rtllib_hdr_4addr { |
|---|
| .. | .. |
|---|
| 769 | 764 | u8 addr3[ETH_ALEN]; |
|---|
| 770 | 765 | __le16 seq_ctl; |
|---|
| 771 | 766 | u8 addr4[ETH_ALEN]; |
|---|
| 772 | | - u8 payload[0]; |
|---|
| 767 | + u8 payload[]; |
|---|
| 773 | 768 | } __packed; |
|---|
| 774 | 769 | |
|---|
| 775 | 770 | struct rtllib_hdr_3addrqos { |
|---|
| .. | .. |
|---|
| 780 | 775 | u8 addr3[ETH_ALEN]; |
|---|
| 781 | 776 | __le16 seq_ctl; |
|---|
| 782 | 777 | __le16 qos_ctl; |
|---|
| 783 | | - u8 payload[0]; |
|---|
| 778 | + u8 payload[]; |
|---|
| 784 | 779 | } __packed; |
|---|
| 785 | 780 | |
|---|
| 786 | 781 | struct rtllib_hdr_4addrqos { |
|---|
| .. | .. |
|---|
| 792 | 787 | __le16 seq_ctl; |
|---|
| 793 | 788 | u8 addr4[ETH_ALEN]; |
|---|
| 794 | 789 | __le16 qos_ctl; |
|---|
| 795 | | - u8 payload[0]; |
|---|
| 790 | + u8 payload[]; |
|---|
| 796 | 791 | } __packed; |
|---|
| 797 | 792 | |
|---|
| 798 | 793 | struct rtllib_info_element { |
|---|
| 799 | 794 | u8 id; |
|---|
| 800 | 795 | u8 len; |
|---|
| 801 | | - u8 data[0]; |
|---|
| 796 | + u8 data[]; |
|---|
| 802 | 797 | } __packed; |
|---|
| 803 | 798 | |
|---|
| 804 | 799 | struct rtllib_authentication { |
|---|
| .. | .. |
|---|
| 807 | 802 | __le16 transaction; |
|---|
| 808 | 803 | __le16 status; |
|---|
| 809 | 804 | /*challenge*/ |
|---|
| 810 | | - struct rtllib_info_element info_element[0]; |
|---|
| 805 | + struct rtllib_info_element info_element[]; |
|---|
| 811 | 806 | } __packed; |
|---|
| 812 | 807 | |
|---|
| 813 | 808 | struct rtllib_disauth { |
|---|
| .. | .. |
|---|
| 823 | 818 | struct rtllib_probe_request { |
|---|
| 824 | 819 | struct rtllib_hdr_3addr header; |
|---|
| 825 | 820 | /* SSID, supported rates */ |
|---|
| 826 | | - struct rtllib_info_element info_element[0]; |
|---|
| 821 | + struct rtllib_info_element info_element[]; |
|---|
| 827 | 822 | } __packed; |
|---|
| 828 | 823 | |
|---|
| 829 | 824 | struct rtllib_probe_response { |
|---|
| .. | .. |
|---|
| 834 | 829 | /* SSID, supported rates, FH params, DS params, |
|---|
| 835 | 830 | * CF params, IBSS params, TIM (if beacon), RSN |
|---|
| 836 | 831 | */ |
|---|
| 837 | | - struct rtllib_info_element info_element[0]; |
|---|
| 832 | + struct rtllib_info_element info_element[]; |
|---|
| 838 | 833 | } __packed; |
|---|
| 839 | 834 | |
|---|
| 840 | 835 | /* Alias beacon for probe_response */ |
|---|
| .. | .. |
|---|
| 845 | 840 | __le16 capability; |
|---|
| 846 | 841 | __le16 listen_interval; |
|---|
| 847 | 842 | /* SSID, supported rates, RSN */ |
|---|
| 848 | | - struct rtllib_info_element info_element[0]; |
|---|
| 843 | + struct rtllib_info_element info_element[]; |
|---|
| 849 | 844 | } __packed; |
|---|
| 850 | 845 | |
|---|
| 851 | 846 | struct rtllib_assoc_response_frame { |
|---|
| .. | .. |
|---|
| 853 | 848 | __le16 capability; |
|---|
| 854 | 849 | __le16 status; |
|---|
| 855 | 850 | __le16 aid; |
|---|
| 856 | | - struct rtllib_info_element info_element[0]; /* supported rates */ |
|---|
| 851 | + struct rtllib_info_element info_element[]; /* supported rates */ |
|---|
| 857 | 852 | } __packed; |
|---|
| 858 | 853 | |
|---|
| 859 | 854 | struct rtllib_txb { |
|---|
| .. | .. |
|---|
| 864 | 859 | u16 reserved; |
|---|
| 865 | 860 | __le16 frag_size; |
|---|
| 866 | 861 | __le16 payload_size; |
|---|
| 867 | | - struct sk_buff *fragments[0]; |
|---|
| 862 | + struct sk_buff *fragments[]; |
|---|
| 868 | 863 | }; |
|---|
| 869 | 864 | |
|---|
| 870 | 865 | #define MAX_SUBFRAME_COUNT 64 |
|---|
| .. | .. |
|---|
| 1560 | 1555 | u16 scan_watch_dog; |
|---|
| 1561 | 1556 | |
|---|
| 1562 | 1557 | /* map of allowed channels. 0 is dummy */ |
|---|
| 1563 | | - void *pDot11dInfo; |
|---|
| 1564 | | - bool bGlobalDomain; |
|---|
| 1558 | + void *dot11d_info; |
|---|
| 1559 | + bool global_domain; |
|---|
| 1565 | 1560 | u8 active_channel_map[MAX_CHANNEL_NUMBER+1]; |
|---|
| 1566 | 1561 | |
|---|
| 1567 | | - u8 IbssStartChnl; |
|---|
| 1562 | + u8 bss_start_channel; |
|---|
| 1568 | 1563 | u8 ibss_maxjoin_chal; |
|---|
| 1569 | 1564 | |
|---|
| 1570 | 1565 | int rate; /* current rate */ |
|---|
| .. | .. |
|---|
| 1797 | 1792 | /* This must be the last item so that it points to the data |
|---|
| 1798 | 1793 | * allocated beyond this structure by alloc_rtllib |
|---|
| 1799 | 1794 | */ |
|---|
| 1800 | | - u8 priv[0]; |
|---|
| 1795 | + u8 priv[]; |
|---|
| 1801 | 1796 | }; |
|---|
| 1802 | 1797 | |
|---|
| 1803 | 1798 | #define IEEE_A (1<<0) |
|---|
| .. | .. |
|---|
| 1944 | 1939 | int hdr_len); |
|---|
| 1945 | 1940 | |
|---|
| 1946 | 1941 | int rtllib_xmit(struct sk_buff *skb, struct net_device *dev); |
|---|
| 1947 | | -void rtllib_txb_free(struct rtllib_txb *); |
|---|
| 1942 | +void rtllib_txb_free(struct rtllib_txb *txb); |
|---|
| 1948 | 1943 | |
|---|
| 1949 | 1944 | /* rtllib_rx.c */ |
|---|
| 1950 | 1945 | int rtllib_rx(struct rtllib_device *ieee, struct sk_buff *skb, |
|---|
| .. | .. |
|---|
| 1987 | 1982 | void rtllib_stop_send_beacons(struct rtllib_device *ieee); |
|---|
| 1988 | 1983 | void notify_wx_assoc_event(struct rtllib_device *ieee); |
|---|
| 1989 | 1984 | void rtllib_start_ibss(struct rtllib_device *ieee); |
|---|
| 1990 | | -void rtllib_softmac_init(struct rtllib_device *ieee); |
|---|
| 1985 | +int rtllib_softmac_init(struct rtllib_device *ieee); |
|---|
| 1991 | 1986 | void rtllib_softmac_free(struct rtllib_device *ieee); |
|---|
| 1992 | 1987 | void rtllib_disassociate(struct rtllib_device *ieee); |
|---|
| 1993 | 1988 | void rtllib_stop_scan(struct rtllib_device *ieee); |
|---|
| .. | .. |
|---|
| 2136 | 2131 | return escaped; |
|---|
| 2137 | 2132 | } |
|---|
| 2138 | 2133 | |
|---|
| 2139 | | - snprintf(escaped, sizeof(escaped), "%*pEn", essid_len, essid); |
|---|
| 2134 | + snprintf(escaped, sizeof(escaped), "%*pE", essid_len, essid); |
|---|
| 2140 | 2135 | return escaped; |
|---|
| 2141 | 2136 | } |
|---|
| 2142 | 2137 | |
|---|