Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1 | /* |
Kiet Lam | 842dad0 | 2014-02-18 18:44:02 -0800 | [diff] [blame] | 2 | * Copyright (c) 2012-2013 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. |
Gopichand Nakkala | 92f07d8 | 2013-01-08 21:16:34 -0800 | [diff] [blame] | 20 | */ |
Kiet Lam | 842dad0 | 2014-02-18 18:44:02 -0800 | [diff] [blame] | 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 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 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 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 35 | ============================================================================*/ |
| 36 | /* $Header$ */ |
| 37 | |
| 38 | /*---------------------------------------------------------------------------- |
| 39 | * Include Files |
| 40 | * -------------------------------------------------------------------------*/ |
| 41 | #include <linux/version.h> |
| 42 | #include <linux/byteorder/generic.h> |
| 43 | #include <linux/if_ether.h> |
| 44 | #include <linux/if_vlan.h> |
| 45 | |
| 46 | /*---------------------------------------------------------------------------- |
| 47 | * Preprocessor Definitions and Constants |
| 48 | * -------------------------------------------------------------------------*/ |
| 49 | #define WLAN_SNAP_OUI_LEN 3 |
| 50 | #define WLAN_SNAP_DSAP 0xAAU |
| 51 | #define WLAN_SNAP_SSAP 0xAAU |
| 52 | #define WLAN_SNAP_CTRL 0x03 |
| 53 | #define WLAN_MIN_PROTO 0x0600 |
| 54 | |
| 55 | /*---------------------------------------------------------------------------- |
| 56 | * Type Declarations |
| 57 | * -------------------------------------------------------------------------*/ |
| 58 | struct wlan_snap_hdr { |
| 59 | unsigned char dsap; |
| 60 | unsigned char ssap; |
| 61 | unsigned char ctrl; |
| 62 | unsigned char oui[WLAN_SNAP_OUI_LEN]; |
Madan Mohan Koyyalamudi | 4e31b13 | 2012-11-02 13:13:52 -0700 | [diff] [blame] | 63 | } __packed; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 64 | |
| 65 | struct wlan_8023 { |
| 66 | unsigned char h_dest[ETH_ALEN]; |
| 67 | unsigned char h_source[ETH_ALEN]; |
| 68 | __be16 h_len; |
| 69 | struct wlan_snap_hdr h_snap; |
| 70 | __be16 h_proto; |
Madan Mohan Koyyalamudi | 4e31b13 | 2012-11-02 13:13:52 -0700 | [diff] [blame] | 71 | } __packed; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 72 | |
| 73 | struct wlan_8023_vlan { |
| 74 | unsigned char h_dest[ETH_ALEN]; |
| 75 | unsigned char h_source[ETH_ALEN]; |
| 76 | __be16 h_vlan_proto; |
| 77 | __be16 h_vlan_TCI; |
| 78 | __be16 h_len; |
| 79 | struct wlan_snap_hdr h_snap; |
| 80 | __be16 h_proto; |
Madan Mohan Koyyalamudi | 4e31b13 | 2012-11-02 13:13:52 -0700 | [diff] [blame] | 81 | } __packed; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 82 | |
| 83 | union generic_ethhdr { |
| 84 | struct ethhdr eth_II; |
| 85 | struct vlan_ethhdr eth_IIv; |
| 86 | struct wlan_8023 eth_8023; |
| 87 | struct wlan_8023_vlan eth_8023v; |
| 88 | }; |
| 89 | |
| 90 | #endif /* #ifndef _WLAN_HDD_ETHER_H */ |