Home | History | Annotate | Download | only in shm
      1 /*
      2  * Copyright (C) 2017 The Android Open Source Project
      3  *
      4  * Licensed under the Apache License, Version 2.0 (the "License");
      5  * you may not use this file except in compliance with the License.
      6  * You may obtain a copy of the License at
      7  *
      8  *      http://www.apache.org/licenses/LICENSE-2.0
      9  *
     10  * Unless required by applicable law or agreed to in writing, software
     11  * distributed under the License is distributed on an "AS IS" BASIS,
     12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     13  * See the License for the specific language governing permissions and
     14  * limitations under the License.
     15  */
     16 #pragma once
     17 
     18 #include "common/vsoc/shm/base.h"
     19 #include "common/vsoc/shm/circqueue.h"
     20 #include "common/vsoc/shm/lock.h"
     21 
     22 // Memory layout for wifi packet exchange region.
     23 namespace vsoc {
     24 namespace layout {
     25 namespace wifi {
     26 
     27 struct WifiExchangeLayout : public RegionLayout {
     28   static constexpr size_t layout_size = 2 * CircularPacketQueue<16, 8192>::layout_size + 12;
     29 
     30   // Traffic originating from host that proceeds towards guest.
     31   CircularPacketQueue<16, 8192> guest_ingress;
     32   // Traffic originating from guest that proceeds towards host.
     33   CircularPacketQueue<16, 8192> guest_egress;
     34 
     35   // Desired MAC address for guest device.
     36   uint8_t guest_mac_address[6];
     37   // MAC address of host device.
     38   uint8_t host_mac_address[6];
     39 
     40   static const char* region_name;
     41 };
     42 
     43 ASSERT_SHM_COMPATIBLE(WifiExchangeLayout);
     44 
     45 }  // namespace wifi
     46 }  // namespace layout
     47 }  // namespace vsoc
     48