diff options
author | vamsi krishna <vamsin@codeaurora.org> | 2019-02-28 21:09:11 +0530 |
---|---|---|
committer | Ahmed ElArabawy <arabawy@google.com> | 2019-03-18 14:26:59 -0700 |
commit | 55d0309c07fc62ee43d00e740cece70541bcc82e (patch) | |
tree | cd044ac17a63ab780535ddebab9074914fe1f524 /qcwcn | |
parent | 74064d74227d7e64e962c82d79c491578acf714e (diff) | |
download | wlan-55d0309c07fc62ee43d00e740cece70541bcc82e.tar.gz |
Wifi: Add ether type to sending offloaded packet
In current implementation, the ether type used for offloaded
packets is always hardcoded to IPv4 in lower layers.
This commit adds support to specify ether type of offloaded
packets from user space.
Bug: 122487582
Test: Manual
Change-Id: Ib3a5dcb92aa6b193eabbcff32cd5a1138dcd04d0
CRs-Fixed: 2398213
Diffstat (limited to 'qcwcn')
-rw-r--r-- | qcwcn/wifi_hal/common.h | 4 | ||||
-rw-r--r-- | qcwcn/wifi_hal/qca-vendor_copy.h | 4 | ||||
-rw-r--r-- | qcwcn/wifi_hal/wifi_hal.cpp | 8 |
3 files changed, 14 insertions, 2 deletions
diff --git a/qcwcn/wifi_hal/common.h b/qcwcn/wifi_hal/common.h index 3ea962d..c847313 100644 --- a/qcwcn/wifi_hal/common.h +++ b/qcwcn/wifi_hal/common.h @@ -177,8 +177,8 @@ wifi_error cleanupRSSIMonitorHandler(hal_info *info); lowi_cb_table_t *getLowiCallbackTable(u32 requested_lowi_capabilities); wifi_error wifi_start_sending_offloaded_packet(wifi_request_id id, - wifi_interface_handle iface, u8 *ip_packet, u16 ip_packet_len, - u8 *src_mac_addr, u8 *dst_mac_addr, u32 period_msec); + wifi_interface_handle iface, u16 ether_type, u8 *ip_packet, + u16 ip_packet_len, u8 *src_mac_addr, u8 *dst_mac_addr, u32 period_msec); wifi_error wifi_stop_sending_offloaded_packet(wifi_request_id id, wifi_interface_handle iface); wifi_error wifi_start_rssi_monitoring(wifi_request_id id, wifi_interface_handle diff --git a/qcwcn/wifi_hal/qca-vendor_copy.h b/qcwcn/wifi_hal/qca-vendor_copy.h index 3f5163f..df36ec0 100644 --- a/qcwcn/wifi_hal/qca-vendor_copy.h +++ b/qcwcn/wifi_hal/qca-vendor_copy.h @@ -4774,6 +4774,10 @@ enum qca_wlan_vendor_attr_offloaded_packets { QCA_WLAN_VENDOR_ATTR_OFFLOADED_PACKETS_DST_MAC_ADDR, /* Unsigned 32-bit value, in milli seconds */ QCA_WLAN_VENDOR_ATTR_OFFLOADED_PACKETS_PERIOD, + /* This optional unsigned 16-bit attribute is used for specifying + * ethernet protocol type. If not specified ethertype defaults to IPv4. + */ + QCA_WLAN_VENDOR_ATTR_OFFLOADED_PACKETS_ETHER_PROTO_TYPE, /* keep last */ QCA_WLAN_VENDOR_ATTR_OFFLOADED_PACKETS_AFTER_LAST, diff --git a/qcwcn/wifi_hal/wifi_hal.cpp b/qcwcn/wifi_hal/wifi_hal.cpp index 8e8367c..8834bba 100644 --- a/qcwcn/wifi_hal/wifi_hal.cpp +++ b/qcwcn/wifi_hal/wifi_hal.cpp @@ -1348,6 +1348,7 @@ cleanup: wifi_error wifi_start_sending_offloaded_packet(wifi_request_id id, wifi_interface_handle iface, + u16 ether_type, u8 *ip_packet, u16 ip_packet_len, u8 *src_mac_addr, @@ -1366,6 +1367,7 @@ wifi_error wifi_start_sending_offloaded_packet(wifi_request_id id, return ret; } + ALOGV("ether type 0x%04x\n", ether_type); ALOGV("ip packet length : %u\nIP Packet:", ip_packet_len); hexdump(ip_packet, ip_packet_len); ALOGV("Src Mac Address: " MAC_ADDR_STR "\nDst Mac Address: " MAC_ADDR_STR @@ -1389,6 +1391,12 @@ wifi_error wifi_start_sending_offloaded_packet(wifi_request_id id, if (ret != WIFI_SUCCESS) goto cleanup; + ret = vCommand->put_u16( + QCA_WLAN_VENDOR_ATTR_OFFLOADED_PACKETS_ETHER_PROTO_TYPE, + ether_type); + if (ret != WIFI_SUCCESS) + goto cleanup; + ret = vCommand->put_bytes( QCA_WLAN_VENDOR_ATTR_OFFLOADED_PACKETS_IP_PACKET_DATA, (const char *)ip_packet, ip_packet_len); |