blob: 1ea13c75fcf8c1f5a01991d16fe505c446791a94 [file] [log] [blame]
Jeff Johnson295189b2012-06-20 16:38:30 -07001/*
Kiet Lam842dad02014-02-18 18:44:02 -08002 * 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 Nakkala92f07d82013-01-08 21:16:34 -080020 */
Kiet Lam842dad02014-02-18 18:44:02 -080021
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 Johnson295189b2012-06-20 16:38:30 -070028#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 Johnson295189b2012-06-20 16:38:30 -070035============================================================================*/
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 * -------------------------------------------------------------------------*/
58struct 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 Koyyalamudi4e31b132012-11-02 13:13:52 -070063} __packed;
Jeff Johnson295189b2012-06-20 16:38:30 -070064
65struct 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 Koyyalamudi4e31b132012-11-02 13:13:52 -070071} __packed;
Jeff Johnson295189b2012-06-20 16:38:30 -070072
73struct 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 Koyyalamudi4e31b132012-11-02 13:13:52 -070081} __packed;
Jeff Johnson295189b2012-06-20 16:38:30 -070082
83union 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 */