Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2014 The Linux Foundation. All rights reserved. |
| 3 | * |
| 4 | * Previously licensed under the ISC license by Qualcomm Atheros, Inc. |
| 5 | * |
| 6 | * |
| 7 | * Permission to use, copy, modify, and/or distribute this software for |
| 8 | * any purpose with or without fee is hereby granted, provided that the |
| 9 | * above copyright notice and this permission notice appear in all |
| 10 | * copies. |
| 11 | * |
| 12 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL |
| 13 | * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED |
| 14 | * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE |
| 15 | * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL |
| 16 | * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR |
| 17 | * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER |
| 18 | * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR |
| 19 | * PERFORMANCE OF THIS SOFTWARE. |
| 20 | */ |
| 21 | |
| 22 | /* |
| 23 | * This file was originally distributed by Qualcomm Atheros, Inc. |
| 24 | * under proprietary terms before Copyright ownership was assigned |
| 25 | * to the Linux Foundation. |
| 26 | */ |
| 27 | |
| 28 | #ifndef _WLAN_HDD_ETHER_H |
| 29 | #define _WLAN_HDD_ETHER_H |
| 30 | /*============================================================================ |
| 31 | @file wlan_hdd_ether.h |
| 32 | |
| 33 | This module describes Ethernet packet formats for processing by HDD. |
| 34 | ============================================================================*/ |
| 35 | /* $Header$ */ |
| 36 | |
| 37 | /*---------------------------------------------------------------------------- |
| 38 | * Include Files |
| 39 | * -------------------------------------------------------------------------*/ |
| 40 | #include <linux/version.h> |
| 41 | #include <linux/byteorder/generic.h> |
| 42 | #include <linux/if_ether.h> |
| 43 | #include <linux/if_vlan.h> |
| 44 | |
| 45 | /*---------------------------------------------------------------------------- |
| 46 | * Preprocessor Definitions and Constants |
| 47 | * -------------------------------------------------------------------------*/ |
| 48 | #define WLAN_SNAP_OUI_LEN 3 |
| 49 | #define WLAN_SNAP_DSAP 0xAAU |
| 50 | #define WLAN_SNAP_SSAP 0xAAU |
| 51 | #define WLAN_SNAP_CTRL 0x03 |
| 52 | #define WLAN_MIN_PROTO 0x0600 |
| 53 | |
| 54 | /*---------------------------------------------------------------------------- |
| 55 | * Type Declarations |
| 56 | * -------------------------------------------------------------------------*/ |
| 57 | struct wlan_snap_hdr { |
| 58 | unsigned char dsap; |
| 59 | unsigned char ssap; |
| 60 | unsigned char ctrl; |
| 61 | unsigned char oui[WLAN_SNAP_OUI_LEN]; |
| 62 | } __packed; |
| 63 | |
| 64 | struct wlan_8023 { |
| 65 | unsigned char h_dest[ETH_ALEN]; |
| 66 | unsigned char h_source[ETH_ALEN]; |
| 67 | __be16 h_len; |
| 68 | struct wlan_snap_hdr h_snap; |
| 69 | __be16 h_proto; |
| 70 | } __packed; |
| 71 | |
| 72 | struct wlan_8023_vlan { |
| 73 | unsigned char h_dest[ETH_ALEN]; |
| 74 | unsigned char h_source[ETH_ALEN]; |
| 75 | __be16 h_vlan_proto; |
| 76 | __be16 h_vlan_TCI; |
| 77 | __be16 h_len; |
| 78 | struct wlan_snap_hdr h_snap; |
| 79 | __be16 h_proto; |
| 80 | } __packed; |
| 81 | |
| 82 | union generic_ethhdr { |
| 83 | struct ethhdr eth_II; |
| 84 | struct vlan_ethhdr eth_IIv; |
| 85 | struct wlan_8023 eth_8023; |
| 86 | struct wlan_8023_vlan eth_8023v; |
| 87 | }; |
| 88 | |
| 89 | #endif /* #ifndef _WLAN_HDD_ETHER_H */ |