blob: 1c71e01d075f1f16ac0f3ca13980bad1c7abc488 [file] [log] [blame]
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001/*
Jeff Johnson330c6b02017-01-12 10:42:31 -08002 * Copyright (c) 2014, 2017 The Linux Foundation. All rights reserved.
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003 *
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004 * Permission to use, copy, modify, and/or distribute this software for
5 * any purpose with or without fee is hereby granted, provided that the
6 * above copyright notice and this permission notice appear in all
7 * copies.
8 *
9 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
10 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
11 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
12 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
13 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
14 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
15 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
16 * PERFORMANCE OF THIS SOFTWARE.
17 */
18
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080019#ifndef _WLAN_HDD_ETHER_H
20#define _WLAN_HDD_ETHER_H
Jeff Johnson330c6b02017-01-12 10:42:31 -080021/**
22 * DOC: wlan_hdd_ether.h
23 *
24 * This module describes Ethernet packet formats for processing by HDD.
25 */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080026
Jeff Johnson330c6b02017-01-12 10:42:31 -080027/*
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080028 * Include Files
Jeff Johnson330c6b02017-01-12 10:42:31 -080029 */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080030#include <linux/version.h>
31#include <linux/byteorder/generic.h>
32#include <linux/if_ether.h>
33#include <linux/if_vlan.h>
34
Jeff Johnson330c6b02017-01-12 10:42:31 -080035/*
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080036 * Preprocessor Definitions and Constants
Jeff Johnson330c6b02017-01-12 10:42:31 -080037 */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080038#define WLAN_SNAP_OUI_LEN 3
39#define WLAN_SNAP_DSAP 0xAAU
40#define WLAN_SNAP_SSAP 0xAAU
41#define WLAN_SNAP_CTRL 0x03
42#define WLAN_MIN_PROTO 0x0600
43
Jeff Johnson330c6b02017-01-12 10:42:31 -080044/*
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080045 * Type Declarations
Jeff Johnson330c6b02017-01-12 10:42:31 -080046 */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080047struct wlan_snap_hdr {
48 unsigned char dsap;
49 unsigned char ssap;
50 unsigned char ctrl;
51 unsigned char oui[WLAN_SNAP_OUI_LEN];
52} __packed;
53
54struct wlan_8023 {
55 unsigned char h_dest[ETH_ALEN];
56 unsigned char h_source[ETH_ALEN];
57 __be16 h_len;
58 struct wlan_snap_hdr h_snap;
59 __be16 h_proto;
60} __packed;
61
62struct wlan_8023_vlan {
63 unsigned char h_dest[ETH_ALEN];
64 unsigned char h_source[ETH_ALEN];
65 __be16 h_vlan_proto;
66 __be16 h_vlan_TCI;
67 __be16 h_len;
68 struct wlan_snap_hdr h_snap;
69 __be16 h_proto;
70} __packed;
71
72union generic_ethhdr {
73 struct ethhdr eth_II;
74 struct vlan_ethhdr eth_IIv;
75 struct wlan_8023 eth_8023;
76 struct wlan_8023_vlan eth_8023v;
77};
78
79#endif /* #ifndef _WLAN_HDD_ETHER_H */