mirror of
https://github.com/Telecominfraproject/wlan-ap.git
synced 2025-10-29 17:42:41 +00:00
Compare commits
7 Commits
next
...
v3.0.2-rc1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f0035a9908 | ||
|
|
14aa04ad10 | ||
|
|
589cdf6795 | ||
|
|
bf06374839 | ||
|
|
d2ff492853 | ||
|
|
18ba90f5b4 | ||
|
|
8301bfbf89 |
11
.github/workflows/build-dev.yml
vendored
Executable file → Normal file
11
.github/workflows/build-dev.yml
vendored
Executable file → Normal file
@@ -15,20 +15,21 @@ on:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-22.04
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
x64_vm_image_name: ${{ steps.package_and_upload_image.outputs.x64_vm_image_name }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
target: [ 'cig_wf189h', 'cig_wf189w', 'cig_wf660a', 'cig_wf672', 'cig_wf186h', 'cig_wf186w', 'cig_wf188n', 'cig_wf189', 'cig_wf196', 'cig_wf196', 'cybertan_eww631-a1', 'cybertan_eww631-b1', 'sonicfi_rap630w-312g', 'sonicfi_rap63xc-211g', 'sonicfi_rap630c-311g', 'sonicfi_rap630w-311g', 'sonicfi_rap630w-211g', 'sonicfi_rap650c', 'sonicfi_rap7110c-341x', 'sonicfi_rap750e-h', 'sonicfi_rap750e-s', 'sonicfi_rap750w-311a', 'edgecore_eap101', 'edgecore_eap102', 'edgecore_eap104', 'edgecore_eap105', 'edgecore_eap111', 'edgecore_eap112', 'edgecore_oap101', 'edgecore_oap101-6e', 'edgecore_oap101e', 'edgecore_oap101e-6e', 'edgecore_oap103', 'hfcl_ion4xe', 'hfcl_ion4xi', 'hfcl_ion4x', 'hfcl_ion4x_2', 'hfcl_ion4x_3', 'hfcl_ion4xi_w', 'hfcl_ion4x_w', 'indio_um-305ax', 'senao_iap4300m', 'senao_iap2300m', 'senao_jeap6500', 'udaya_a6-id2', 'udaya_a6-od2', 'yuncore_ax820', 'yuncore_ax840', 'yuncore_fap640', 'yuncore_fap650', 'yuncore_fap655', 'emplus_wap588m', 'zyxel_nwa130be', 'sercomm_ap72tip-v4' ]
|
||||
target: [ 'cig_wf186h', 'cig_wf186w', 'cig_wf188n', 'cig_wf196', 'cig_wf189', 'cig_wf660a', 'cybertan_eww622-a1', 'cybertan_eww631-a1', 'cybertan_eww631-b1', 'edgecore_eap101', 'edgecore_eap102', 'edgecore_eap104', 'edgecore_eap111', 'edgecore_ecw5211', 'edgecore_oap101', 'edgecore_oap101-6e', 'edgecore_oap101e', 'edgecore_oap101e-6e', 'edgecore_oap102', 'hfcl_ion4','hfcl_ion4xi_wp', 'hfcl_ion4xe', 'hfcl_ion4xi', 'hfcl_ion4x', 'hfcl_ion4x_2', 'hfcl_ion4xi_w', 'hfcl_ion4xi_HMR', 'hfcl_ion4x_w', 'indio_um-305ax', 'indio_um-325ac', 'indio_um-510ac-v3', 'indio_um-550ac', 'indio_um-310ax-v1', 'indio_um-510axp-v1', 'indio_um-510axm-v1', 'sercomm_ap72tip', 'udaya_a5-id2', 'wallys_dr40x9', 'wallys_dr6018', 'wallys_dr6018-v4', 'yuncore_ax820', 'yuncore_ax840', 'yuncore_fap640', 'yuncore_fap650', 'yuncore_fap655' ]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
# Clean unnecessary files to save disk space
|
||||
- name: clean unncessary files to save space
|
||||
run: |
|
||||
docker rmi `docker images -q` || true
|
||||
docker rmi `docker images -q`
|
||||
|
||||
- name: Build image for ${{ matrix.target }}
|
||||
id: build
|
||||
@@ -80,7 +81,7 @@ jobs:
|
||||
fi
|
||||
|
||||
trigger-testing:
|
||||
runs-on: ubuntu-22.04
|
||||
runs-on: ubuntu-latest
|
||||
needs: build
|
||||
if: startsWith(github.ref, 'refs/tags/v')
|
||||
steps:
|
||||
@@ -93,7 +94,7 @@ jobs:
|
||||
client-payload: '{"ref": "${GITHUB_REF#refs/tags/}", "sha": "${{ github.sha }}"}'
|
||||
|
||||
create-x64_vm-ami:
|
||||
runs-on: ubuntu-22.04
|
||||
runs-on: ubuntu-latest
|
||||
needs: build
|
||||
if: startsWith(github.ref, 'refs/tags/v')
|
||||
steps:
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
repo: https://github.com/openwrt/openwrt.git
|
||||
branch: openwrt-24.10
|
||||
revision: v24.10.3
|
||||
branch: openwrt-23.05
|
||||
revision: e92cf0c46ffe3ac7fca936c18577bfb19eb4ce9e
|
||||
output_dir: ./output
|
||||
|
||||
patch_folders:
|
||||
- patches-24.10
|
||||
- patches
|
||||
|
||||
29
feeds/bluetooth-cc2652/ble_scan/Makefile
Normal file
29
feeds/bluetooth-cc2652/ble_scan/Makefile
Normal file
@@ -0,0 +1,29 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=ble_scan
|
||||
PKG_VERSION:=1.0
|
||||
PKG_BUILD_DIR:= $(BUILD_DIR)/$(PKG_NAME)
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/ble_scan
|
||||
SECTION:=base
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=ble_scan
|
||||
endef
|
||||
|
||||
define Build/Prepare
|
||||
mkdir -p $(PKG_BUILD_DIR)
|
||||
$(CP) ./src/* $(PKG_BUILD_DIR)/
|
||||
endef
|
||||
|
||||
define Package/ble_scan/install
|
||||
$(INSTALL_DIR) $(1)/bin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/ble_scan $(1)/bin/
|
||||
endef
|
||||
|
||||
define Package/ble_scan/extra_provides
|
||||
echo "libc.so.6";
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,ble_scan))
|
||||
47
feeds/bluetooth-cc2652/ble_scan/src/Makefile
Normal file
47
feeds/bluetooth-cc2652/ble_scan/src/Makefile
Normal file
@@ -0,0 +1,47 @@
|
||||
#all: ble_scan
|
||||
#ble_scan: ble_scan.o
|
||||
# $(CC) $(LDFLAGS) ble_scan.o -o ble_scan
|
||||
#blescan.o: ble_scan.c
|
||||
# $(CC) $(CFLAGS) -c ble_scan.c
|
||||
#clean:
|
||||
# rm *.o ble_scan
|
||||
|
||||
#
|
||||
#
|
||||
# Author: Teunis van Beelen
|
||||
#
|
||||
# email: teuniz@protonmail.com
|
||||
#
|
||||
#
|
||||
|
||||
#CROSS-COMPILE:=../../../../../qsdk/staging_dir/toolchain-arm/bin/arm-openwrt-linux-
|
||||
#CC:=$(CROSS-COMPILE)gcc
|
||||
|
||||
CC = gcc
|
||||
CFLAGS = -Wall -Wextra -Wshadow -Wformat-nonliteral -Wformat-security -Wtype-limits -O2
|
||||
|
||||
objects = rs232.o
|
||||
|
||||
all: ble_scan
|
||||
|
||||
ble_scan : $(objects) ble_scan.o
|
||||
$(CC) $(CFLAGS) $(objects) ble_scan.o -o ble_scan
|
||||
|
||||
ble_scan.o : ble_scan.c rs232.h
|
||||
$(CC) $(CFLAGS) -c ble_scan.c -o ble_scan.o
|
||||
|
||||
rs232.o : rs232.h rs232.c
|
||||
$(CC) $(CFLAGS) -c rs232.c -o rs232.o
|
||||
|
||||
clean :
|
||||
$(RM) ble_scan $(objects) ble_scan.o
|
||||
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
387
feeds/bluetooth-cc2652/ble_scan/src/ble_scan.c
Normal file
387
feeds/bluetooth-cc2652/ble_scan/src/ble_scan.c
Normal file
@@ -0,0 +1,387 @@
|
||||
|
||||
/**************************************************
|
||||
|
||||
file: ble_scan.c
|
||||
purpose: Send HCI command to do BLE scan
|
||||
|
||||
compile with the command: gcc ble_scan.c rs232.c -Wall -Wextra -o2 -o ble_scan
|
||||
|
||||
**************************************************/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <time.h>
|
||||
#ifdef _WIN32
|
||||
#include <Windows.h>
|
||||
#else
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#include "rs232.h"
|
||||
|
||||
#define TX 0
|
||||
#define RX 1
|
||||
#define BUF_SIZE 4095
|
||||
#define FULL_BUF_SIZE BUF_SIZE*4
|
||||
|
||||
//#define DEBUG
|
||||
|
||||
#ifdef DEBUG
|
||||
#else
|
||||
#endif
|
||||
|
||||
int print_hex(int mode, unsigned char *buf, int size);
|
||||
int rx_pkt_parser(unsigned char *buf, int size);
|
||||
|
||||
|
||||
struct rx_packet_h{
|
||||
unsigned char rxType;
|
||||
unsigned char rxEventCode;
|
||||
unsigned char rxDataLen;
|
||||
unsigned char Event[2];
|
||||
unsigned char Status;
|
||||
};
|
||||
|
||||
struct event_cmd_st_h{
|
||||
unsigned char OpCode[2];
|
||||
unsigned char DataLength;
|
||||
};
|
||||
|
||||
struct event_scn_evnt_rep_h{
|
||||
unsigned char EventId[4];
|
||||
unsigned char AdvRptEventType;
|
||||
unsigned char AddressType;
|
||||
unsigned char Address[6];
|
||||
unsigned char PrimaryPHY;
|
||||
unsigned char SecondaryPHY;
|
||||
unsigned char AdvSid;
|
||||
unsigned char TxPower;
|
||||
unsigned char RSSI;
|
||||
unsigned char DirectAddrType;
|
||||
unsigned char DirectAddr[6];
|
||||
unsigned char PeriodicAdvInt[2];
|
||||
unsigned char DataLength[2];
|
||||
//unsigned char *DataPtr;
|
||||
};
|
||||
|
||||
|
||||
|
||||
int main()
|
||||
{
|
||||
int cport_nr,bdrate,n;
|
||||
//cport_nr=0, /* /dev/ttyS0 (COM1 on windows) */
|
||||
//bdrate=9600; /* 9600 baud */
|
||||
cport_nr=39, /* (ttyMSM1 : 39) */
|
||||
bdrate=115200; /* 115200 baud */
|
||||
#ifdef DEBUG
|
||||
clock_t t;
|
||||
#endif
|
||||
char mode[]={'8','N','1',0};
|
||||
|
||||
unsigned char buf[BUF_SIZE];
|
||||
unsigned char full_buf[FULL_BUF_SIZE];
|
||||
int full_buf_ptr = 0;
|
||||
unsigned char HCIExt_ResetSystemCmd[] = {0x01, 0x1D, 0xFC, 0x01, 0x00 };
|
||||
int HCIExt_ResetSystemCmd_length = 5;
|
||||
|
||||
unsigned char GAP_DeviceInitCmd[] = {0x01, 0x00, 0xFE, 0x08, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
|
||||
int GAP_DeviceInitCmd_length = 12;
|
||||
|
||||
unsigned char GapScan_enableCmd[] = {0x01, 0x51, 0xFE, 0x06, 0x00, 0x00, 0xF4, 0x01, 0x28, 0x00 };
|
||||
int GapScan_enableCmd_length = 10;
|
||||
|
||||
if(RS232_OpenComport(cport_nr, bdrate, mode, 0))
|
||||
{
|
||||
printf("Can not open comport\n");
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
RS232_flushRXTX(cport_nr);
|
||||
|
||||
// send reset command
|
||||
#ifdef DEBUG
|
||||
t=clock();
|
||||
print_hex(TX, HCIExt_ResetSystemCmd, HCIExt_ResetSystemCmd_length);
|
||||
t=clock()-t;
|
||||
printf("t=%ld\n",t); //60
|
||||
#else
|
||||
/* sleep for 60ms */
|
||||
usleep(60000);
|
||||
#endif
|
||||
|
||||
|
||||
RS232_SendBuf(cport_nr, HCIExt_ResetSystemCmd, HCIExt_ResetSystemCmd_length);
|
||||
/* sleep for 1 Second */
|
||||
#ifdef DEBUG
|
||||
t=clock();
|
||||
#endif
|
||||
usleep(1000000);
|
||||
#ifdef DEBUG
|
||||
t=clock()-t;
|
||||
printf("CLOCKS_PER_SEC=%ld\n",t);
|
||||
#endif
|
||||
n = RS232_PollComport(cport_nr, buf, BUF_SIZE);
|
||||
|
||||
#ifdef DEBUG
|
||||
t=clock();
|
||||
print_hex(RX, buf, n);
|
||||
t=clock()-t;
|
||||
printf("t=%ld\n",t);
|
||||
#else
|
||||
/* sleep for 300ms */
|
||||
usleep(300000);
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
// send device initial command
|
||||
#ifdef DEBUG
|
||||
t=clock();
|
||||
print_hex(TX, GAP_DeviceInitCmd, GAP_DeviceInitCmd_length);
|
||||
t=clock()-t;
|
||||
printf("t=%ld\n",t);
|
||||
#else
|
||||
/* sleep for 250 ms */
|
||||
usleep(250000);
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
RS232_SendBuf(cport_nr, GAP_DeviceInitCmd, GAP_DeviceInitCmd_length);
|
||||
/* sleep for 0.5 Second */
|
||||
usleep(500000);
|
||||
|
||||
n = RS232_PollComport(cport_nr, buf, BUF_SIZE);
|
||||
|
||||
#ifdef DEBUG
|
||||
t=clock();
|
||||
print_hex(RX, buf, n);
|
||||
t=clock()-t;
|
||||
printf("t=%ld\n",t);
|
||||
#else
|
||||
/* sleep for 500 ms */
|
||||
usleep(500000);
|
||||
#endif
|
||||
|
||||
|
||||
// send scan command
|
||||
#ifdef DEBUG
|
||||
t=clock();
|
||||
print_hex(TX, GapScan_enableCmd, GapScan_enableCmd_length);
|
||||
t=clock()-t;
|
||||
printf("t=%ld\n",t);
|
||||
#else
|
||||
/* sleep for 30ms */
|
||||
usleep(30000);
|
||||
#endif
|
||||
|
||||
|
||||
RS232_SendBuf(cport_nr, GapScan_enableCmd, GapScan_enableCmd_length);
|
||||
|
||||
//read scan respone
|
||||
while (n > 0)
|
||||
{
|
||||
/* sleep for 400 mS */
|
||||
usleep(400000);
|
||||
|
||||
n = RS232_PollComport(cport_nr, buf, BUF_SIZE);
|
||||
#ifdef DEBUG
|
||||
t=clock();
|
||||
print_hex(RX, buf, n);
|
||||
t=clock()-t;
|
||||
printf("t=%ld\n",t);
|
||||
#endif
|
||||
|
||||
if (full_buf_ptr+n>FULL_BUF_SIZE)
|
||||
{
|
||||
#ifdef DEBUG
|
||||
printf("buffer full. break.\n");
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
memcpy(full_buf+full_buf_ptr, buf, n);
|
||||
full_buf_ptr+=n;
|
||||
|
||||
#ifdef DEBUG
|
||||
printf("n:%d, full_buf_ptr:%d\n",n, full_buf_ptr);
|
||||
#endif
|
||||
}
|
||||
#ifdef DEBUG
|
||||
print_hex(RX, full_buf, full_buf_ptr);
|
||||
#endif
|
||||
rx_pkt_parser( full_buf, full_buf_ptr);
|
||||
#ifdef DEBUG
|
||||
printf("n:%d, full_buf_ptr:%d\n",n, full_buf_ptr);
|
||||
#endif
|
||||
RS232_flushRXTX(cport_nr);
|
||||
RS232_CloseComport(cport_nr);
|
||||
return(0);
|
||||
}
|
||||
/**************************************************
|
||||
Print buffer in HEX
|
||||
**************************************************/
|
||||
int print_hex(int mode, unsigned char *buf, int size)
|
||||
{
|
||||
|
||||
int ii,jj;
|
||||
|
||||
if (mode == TX)
|
||||
printf("TX: ");
|
||||
else
|
||||
printf("RX: ");
|
||||
|
||||
for(ii=0,jj=0; ii < size; ii++,jj++)
|
||||
{
|
||||
printf("%02X ",buf[ii]);
|
||||
if (jj==15)
|
||||
{
|
||||
printf("\n");
|
||||
jj = 0;
|
||||
}
|
||||
}
|
||||
printf("\n");
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
||||
int rx_pkt_parser(unsigned char *buf, int size)
|
||||
{
|
||||
int pkt_index=0;
|
||||
int pkt_size=0;
|
||||
int temp_event=0;
|
||||
int temp_EventId=0;
|
||||
int total_device_count=0;
|
||||
char szAddress[18];
|
||||
struct rx_packet_h *rx_packet;
|
||||
struct event_scn_evnt_rep_h *event_scn_evnt_rep;
|
||||
#ifdef DEBUG
|
||||
int dump_i=0;
|
||||
unsigned char *pkt_ptr;
|
||||
#endif
|
||||
if(size<=0){printf("size error\n");return -1;}
|
||||
|
||||
printf("BLE scan start:\n");
|
||||
rx_packet = (struct rx_packet_h *)(buf);
|
||||
|
||||
while(pkt_index<size)
|
||||
{
|
||||
#ifdef DEBUG
|
||||
printf("--------------------------------------------------------------------\n");
|
||||
printf("-Type : 0x%02X (%s)\n",rx_packet->rxType,rx_packet->rxType==0x4?"Event":"Unknown");
|
||||
|
||||
if(rx_packet->rxType!=0x4)
|
||||
{
|
||||
printf(" Type unknown, rxType:0x%02X, pkt_index:%d\n",rx_packet->rxType,pkt_index);
|
||||
}
|
||||
|
||||
printf("-EventCode : 0x%02X (%s)\n",rx_packet->rxEventCode,rx_packet->rxEventCode==0xff?"HCI_LE_ExtEvent":"Unknown");
|
||||
if(rx_packet->rxEventCode!=0xff)
|
||||
{
|
||||
printf(" EventCode unknown, rxEventCode:0x%02X, pkt_index:%d\n",rx_packet->rxEventCode,pkt_index);
|
||||
}
|
||||
|
||||
printf("-Data Length : 0x%02X (%d) bytes(s)\n",rx_packet->rxDataLen,rx_packet->rxDataLen);
|
||||
#endif
|
||||
temp_event = (rx_packet->Event[1]<<8)+rx_packet->Event[0] ;
|
||||
#ifdef DEBUG
|
||||
printf(" Event : 0x%02X%02X (%d) ",rx_packet->Event[1],rx_packet->Event[0],temp_event);
|
||||
if(temp_event==0x067F)
|
||||
{
|
||||
printf("(GAP_HCI_ExtentionCommandStatus)\n");
|
||||
}
|
||||
else if(temp_event==0x0600)
|
||||
{
|
||||
printf("(GAP_DeviceInitDone)\n");
|
||||
}
|
||||
else if(temp_event==0x0613)
|
||||
{
|
||||
printf("(GAP_AdvertiserScannerEvent)\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
printf(" Event unknown, Event:0x%04X, pkt_index:%d\n",temp_event,pkt_index);
|
||||
}
|
||||
|
||||
printf(" Status : 0x%02X (%d) (%s)\n",rx_packet->Status,rx_packet->Status,rx_packet->Status==0?"SUCCESS":"FAIL");
|
||||
#endif
|
||||
|
||||
if(temp_event==0x0613)
|
||||
{
|
||||
event_scn_evnt_rep = (struct event_scn_evnt_rep_h *)(&(rx_packet->Status) + 1);
|
||||
temp_EventId = (event_scn_evnt_rep->EventId[3]<<24) + (event_scn_evnt_rep->EventId[2]<<16) +
|
||||
(event_scn_evnt_rep->EventId[1]<<8) + (event_scn_evnt_rep->EventId[0]) ;
|
||||
#ifdef DEBUG
|
||||
printf(" EventId : 0x%02X%02X%02X%02X (%d) ", event_scn_evnt_rep->EventId[3],
|
||||
event_scn_evnt_rep->EventId[2],
|
||||
event_scn_evnt_rep->EventId[1],
|
||||
event_scn_evnt_rep->EventId[0],temp_EventId);
|
||||
|
||||
if(temp_EventId==0x00010000)
|
||||
{
|
||||
printf("(GAP_EVT_SCAN_ENABLED)\n");
|
||||
}
|
||||
else if(temp_EventId==0x00020000)
|
||||
{
|
||||
printf("(GAP_EVT_SCAN_DISABLED)\n");
|
||||
}
|
||||
else if(temp_EventId==0x00400000)
|
||||
{
|
||||
printf("(GAP_EVT_ADV_REPORT)\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
printf(" EventId unknown, EventId:0x%08X, pkt_index:%d\n",temp_EventId,pkt_index);
|
||||
}
|
||||
#endif
|
||||
if(temp_EventId==0x00400000)
|
||||
{
|
||||
sprintf(szAddress,"%02X:%02X:%02X:%02X:%02X:%02X", event_scn_evnt_rep->Address[5],
|
||||
event_scn_evnt_rep->Address[4],
|
||||
event_scn_evnt_rep->Address[3],
|
||||
event_scn_evnt_rep->Address[2],
|
||||
event_scn_evnt_rep->Address[1],
|
||||
event_scn_evnt_rep->Address[0]);
|
||||
#ifdef DEBUG
|
||||
printf("%04d", total_device_count);
|
||||
printf(" Address : %s", szAddress);
|
||||
printf(" RSSI : 0x%02X (%d)(%d)",event_scn_evnt_rep->RSSI,event_scn_evnt_rep->RSSI,event_scn_evnt_rep->RSSI-256);
|
||||
#else
|
||||
printf(" Address: %s RSSI: %d", szAddress, event_scn_evnt_rep->RSSI-256);
|
||||
#endif
|
||||
printf("\n");
|
||||
total_device_count++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
pkt_size = 3+rx_packet->rxDataLen;
|
||||
|
||||
#ifdef DEBUG
|
||||
pkt_ptr = (unsigned char *)rx_packet;
|
||||
printf(" <Info > Dump(Rx):");
|
||||
for(dump_i=0; dump_i < pkt_size; dump_i++)
|
||||
{
|
||||
if (dump_i%16==0)
|
||||
{
|
||||
printf("\n");
|
||||
printf("%04x:",dump_i);
|
||||
}
|
||||
printf("%02X ",pkt_ptr[dump_i]);
|
||||
}
|
||||
printf("\n");
|
||||
#endif
|
||||
|
||||
pkt_index+=pkt_size;
|
||||
#ifdef DEBUG
|
||||
printf(" pkt_size:%d, pkt_index:%d\n",pkt_size,pkt_index);
|
||||
#endif
|
||||
rx_packet = (struct rx_packet_h *)(&(rx_packet->rxDataLen) + rx_packet->rxDataLen + 1);
|
||||
|
||||
}
|
||||
printf("Total: %d Device found.\n",total_device_count);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
879
feeds/bluetooth-cc2652/ble_scan/src/rs232.c
Executable file
879
feeds/bluetooth-cc2652/ble_scan/src/rs232.c
Executable file
@@ -0,0 +1,879 @@
|
||||
/*
|
||||
***************************************************************************
|
||||
*
|
||||
* Author: Teunis van Beelen
|
||||
*
|
||||
* Copyright (C) 2005 - 2021 Teunis van Beelen
|
||||
*
|
||||
* Email: teuniz@protonmail.com
|
||||
*
|
||||
***************************************************************************
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
***************************************************************************
|
||||
*/
|
||||
|
||||
|
||||
/* Last revision: February 9, 2021 */
|
||||
/* For more info and how to use this library, visit: http://www.teuniz.net/RS-232/ */
|
||||
|
||||
|
||||
#include "rs232.h"
|
||||
|
||||
|
||||
#if defined(__linux__) || defined(__FreeBSD__) /* Linux & FreeBSD */
|
||||
|
||||
#define RS232_PORTNR 40
|
||||
|
||||
|
||||
int Cport[RS232_PORTNR],
|
||||
error;
|
||||
|
||||
struct termios new_port_settings,
|
||||
old_port_settings[RS232_PORTNR];
|
||||
|
||||
const char *comports[RS232_PORTNR]={"/dev/ttyS0","/dev/ttyS1","/dev/ttyS2","/dev/ttyS3","/dev/ttyS4","/dev/ttyS5",
|
||||
"/dev/ttyS6","/dev/ttyS7","/dev/ttyS8","/dev/ttyS9","/dev/ttyS10","/dev/ttyS11",
|
||||
"/dev/ttyS12","/dev/ttyS13","/dev/ttyS14","/dev/ttyS15","/dev/ttyUSB0",
|
||||
"/dev/ttyUSB1","/dev/ttyUSB2","/dev/ttyUSB3","/dev/ttyUSB4","/dev/ttyUSB5",
|
||||
"/dev/ttyAMA0","/dev/ttyAMA1","/dev/ttyACM0","/dev/ttyACM1",
|
||||
"/dev/rfcomm0","/dev/rfcomm1","/dev/ircomm0","/dev/ircomm1",
|
||||
"/dev/cuau0","/dev/cuau1","/dev/cuau2","/dev/cuau3",
|
||||
"/dev/cuaU0","/dev/cuaU1","/dev/cuaU2","/dev/cuaU3",
|
||||
"/dev/ttyMSM0","/dev/ttyMSM1"};
|
||||
int RS232_OpenComport(int comport_number, int baudrate, const char *mode, int flowctrl)
|
||||
{
|
||||
int baudr,
|
||||
status;
|
||||
|
||||
if((comport_number>=RS232_PORTNR)||(comport_number<0))
|
||||
{
|
||||
printf("illegal comport number\n");
|
||||
return(1);
|
||||
}
|
||||
|
||||
switch(baudrate)
|
||||
{
|
||||
case 50 : baudr = B50;
|
||||
break;
|
||||
case 75 : baudr = B75;
|
||||
break;
|
||||
case 110 : baudr = B110;
|
||||
break;
|
||||
case 134 : baudr = B134;
|
||||
break;
|
||||
case 150 : baudr = B150;
|
||||
break;
|
||||
case 200 : baudr = B200;
|
||||
break;
|
||||
case 300 : baudr = B300;
|
||||
break;
|
||||
case 600 : baudr = B600;
|
||||
break;
|
||||
case 1200 : baudr = B1200;
|
||||
break;
|
||||
case 1800 : baudr = B1800;
|
||||
break;
|
||||
case 2400 : baudr = B2400;
|
||||
break;
|
||||
case 4800 : baudr = B4800;
|
||||
break;
|
||||
case 9600 : baudr = B9600;
|
||||
break;
|
||||
case 19200 : baudr = B19200;
|
||||
break;
|
||||
case 38400 : baudr = B38400;
|
||||
break;
|
||||
case 57600 : baudr = B57600;
|
||||
break;
|
||||
case 115200 : baudr = B115200;
|
||||
break;
|
||||
case 230400 : baudr = B230400;
|
||||
break;
|
||||
case 460800 : baudr = B460800;
|
||||
break;
|
||||
#if defined(__linux__)
|
||||
case 500000 : baudr = B500000;
|
||||
break;
|
||||
case 576000 : baudr = B576000;
|
||||
break;
|
||||
case 921600 : baudr = B921600;
|
||||
break;
|
||||
case 1000000 : baudr = B1000000;
|
||||
break;
|
||||
case 1152000 : baudr = B1152000;
|
||||
break;
|
||||
case 1500000 : baudr = B1500000;
|
||||
break;
|
||||
case 2000000 : baudr = B2000000;
|
||||
break;
|
||||
case 2500000 : baudr = B2500000;
|
||||
break;
|
||||
case 3000000 : baudr = B3000000;
|
||||
break;
|
||||
case 3500000 : baudr = B3500000;
|
||||
break;
|
||||
case 4000000 : baudr = B4000000;
|
||||
break;
|
||||
#endif
|
||||
default : printf("invalid baudrate\n");
|
||||
return(1);
|
||||
break;
|
||||
}
|
||||
|
||||
int cbits=CS8,
|
||||
cpar=0,
|
||||
ipar=IGNPAR,
|
||||
bstop=0;
|
||||
|
||||
if(strlen(mode) != 3)
|
||||
{
|
||||
printf("invalid mode \"%s\"\n", mode);
|
||||
return(1);
|
||||
}
|
||||
|
||||
switch(mode[0])
|
||||
{
|
||||
case '8': cbits = CS8;
|
||||
break;
|
||||
case '7': cbits = CS7;
|
||||
break;
|
||||
case '6': cbits = CS6;
|
||||
break;
|
||||
case '5': cbits = CS5;
|
||||
break;
|
||||
default : printf("invalid number of data-bits '%c'\n", mode[0]);
|
||||
return(1);
|
||||
break;
|
||||
}
|
||||
|
||||
switch(mode[1])
|
||||
{
|
||||
case 'N':
|
||||
case 'n': cpar = 0;
|
||||
ipar = IGNPAR;
|
||||
break;
|
||||
case 'E':
|
||||
case 'e': cpar = PARENB;
|
||||
ipar = INPCK;
|
||||
break;
|
||||
case 'O':
|
||||
case 'o': cpar = (PARENB | PARODD);
|
||||
ipar = INPCK;
|
||||
break;
|
||||
default : printf("invalid parity '%c'\n", mode[1]);
|
||||
return(1);
|
||||
break;
|
||||
}
|
||||
|
||||
switch(mode[2])
|
||||
{
|
||||
case '1': bstop = 0;
|
||||
break;
|
||||
case '2': bstop = CSTOPB;
|
||||
break;
|
||||
default : printf("invalid number of stop bits '%c'\n", mode[2]);
|
||||
return(1);
|
||||
break;
|
||||
}
|
||||
|
||||
/*
|
||||
http://pubs.opengroup.org/onlinepubs/7908799/xsh/termios.h.html
|
||||
|
||||
http://man7.org/linux/man-pages/man3/termios.3.html
|
||||
*/
|
||||
|
||||
Cport[comport_number] = open(comports[comport_number], O_RDWR | O_NOCTTY | O_NDELAY);
|
||||
if(Cport[comport_number]==-1)
|
||||
{
|
||||
perror("unable to open comport ");
|
||||
return(1);
|
||||
}
|
||||
|
||||
/* lock access so that another process can't also use the port */
|
||||
if(flock(Cport[comport_number], LOCK_EX | LOCK_NB) != 0)
|
||||
{
|
||||
close(Cport[comport_number]);
|
||||
perror("Another process has locked the comport.");
|
||||
return(1);
|
||||
}
|
||||
|
||||
error = tcgetattr(Cport[comport_number], old_port_settings + comport_number);
|
||||
if(error==-1)
|
||||
{
|
||||
close(Cport[comport_number]);
|
||||
flock(Cport[comport_number], LOCK_UN); /* free the port so that others can use it. */
|
||||
perror("unable to read portsettings ");
|
||||
return(1);
|
||||
}
|
||||
memset(&new_port_settings, 0, sizeof(new_port_settings)); /* clear the new struct */
|
||||
|
||||
new_port_settings.c_cflag = cbits | cpar | bstop | CLOCAL | CREAD;
|
||||
if(flowctrl)
|
||||
{
|
||||
new_port_settings.c_cflag |= CRTSCTS;
|
||||
}
|
||||
new_port_settings.c_iflag = ipar;
|
||||
new_port_settings.c_oflag = 0;
|
||||
new_port_settings.c_lflag = 0;
|
||||
new_port_settings.c_cc[VMIN] = 0; /* block untill n bytes are received */
|
||||
new_port_settings.c_cc[VTIME] = 0; /* block untill a timer expires (n * 100 mSec.) */
|
||||
|
||||
cfsetispeed(&new_port_settings, baudr);
|
||||
cfsetospeed(&new_port_settings, baudr);
|
||||
|
||||
error = tcsetattr(Cport[comport_number], TCSANOW, &new_port_settings);
|
||||
if(error==-1)
|
||||
{
|
||||
tcsetattr(Cport[comport_number], TCSANOW, old_port_settings + comport_number);
|
||||
close(Cport[comport_number]);
|
||||
flock(Cport[comport_number], LOCK_UN); /* free the port so that others can use it. */
|
||||
perror("unable to adjust portsettings ");
|
||||
return(1);
|
||||
}
|
||||
|
||||
/* http://man7.org/linux/man-pages/man4/tty_ioctl.4.html */
|
||||
|
||||
if(ioctl(Cport[comport_number], TIOCMGET, &status) == -1)
|
||||
{
|
||||
tcsetattr(Cport[comport_number], TCSANOW, old_port_settings + comport_number);
|
||||
flock(Cport[comport_number], LOCK_UN); /* free the port so that others can use it. */
|
||||
perror("unable to get portstatus");
|
||||
return(1);
|
||||
}
|
||||
|
||||
status |= TIOCM_DTR; /* turn on DTR */
|
||||
status |= TIOCM_RTS; /* turn on RTS */
|
||||
|
||||
if(ioctl(Cport[comport_number], TIOCMSET, &status) == -1)
|
||||
{
|
||||
tcsetattr(Cport[comport_number], TCSANOW, old_port_settings + comport_number);
|
||||
flock(Cport[comport_number], LOCK_UN); /* free the port so that others can use it. */
|
||||
perror("unable to set portstatus");
|
||||
return(1);
|
||||
}
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
||||
int RS232_PollComport(int comport_number, unsigned char *buf, int size)
|
||||
{
|
||||
int n;
|
||||
|
||||
n = read(Cport[comport_number], buf, size);
|
||||
|
||||
if(n < 0)
|
||||
{
|
||||
if(errno == EAGAIN) return 0;
|
||||
}
|
||||
|
||||
return(n);
|
||||
}
|
||||
|
||||
|
||||
int RS232_SendByte(int comport_number, unsigned char byte)
|
||||
{
|
||||
int n = write(Cport[comport_number], &byte, 1);
|
||||
if(n < 0)
|
||||
{
|
||||
if(errno == EAGAIN)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
||||
int RS232_SendBuf(int comport_number, unsigned char *buf, int size)
|
||||
{
|
||||
int n = write(Cport[comport_number], buf, size);
|
||||
if(n < 0)
|
||||
{
|
||||
if(errno == EAGAIN)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
return(n);
|
||||
}
|
||||
|
||||
|
||||
void RS232_CloseComport(int comport_number)
|
||||
{
|
||||
int status;
|
||||
|
||||
if(ioctl(Cport[comport_number], TIOCMGET, &status) == -1)
|
||||
{
|
||||
perror("unable to get portstatus");
|
||||
}
|
||||
|
||||
status &= ~TIOCM_DTR; /* turn off DTR */
|
||||
status &= ~TIOCM_RTS; /* turn off RTS */
|
||||
|
||||
if(ioctl(Cport[comport_number], TIOCMSET, &status) == -1)
|
||||
{
|
||||
perror("unable to set portstatus");
|
||||
}
|
||||
|
||||
tcsetattr(Cport[comport_number], TCSANOW, old_port_settings + comport_number);
|
||||
close(Cport[comport_number]);
|
||||
|
||||
flock(Cport[comport_number], LOCK_UN); /* free the port so that others can use it. */
|
||||
}
|
||||
|
||||
/*
|
||||
Constant Description
|
||||
TIOCM_LE DSR (data set ready/line enable)
|
||||
TIOCM_DTR DTR (data terminal ready)
|
||||
TIOCM_RTS RTS (request to send)
|
||||
TIOCM_ST Secondary TXD (transmit)
|
||||
TIOCM_SR Secondary RXD (receive)
|
||||
TIOCM_CTS CTS (clear to send)
|
||||
TIOCM_CAR DCD (data carrier detect)
|
||||
TIOCM_CD see TIOCM_CAR
|
||||
TIOCM_RNG RNG (ring)
|
||||
TIOCM_RI see TIOCM_RNG
|
||||
TIOCM_DSR DSR (data set ready)
|
||||
|
||||
http://man7.org/linux/man-pages/man4/tty_ioctl.4.html
|
||||
*/
|
||||
|
||||
int RS232_IsDCDEnabled(int comport_number)
|
||||
{
|
||||
int status;
|
||||
|
||||
ioctl(Cport[comport_number], TIOCMGET, &status);
|
||||
|
||||
if(status&TIOCM_CAR) return(1);
|
||||
else return(0);
|
||||
}
|
||||
|
||||
|
||||
int RS232_IsRINGEnabled(int comport_number)
|
||||
{
|
||||
int status;
|
||||
|
||||
ioctl(Cport[comport_number], TIOCMGET, &status);
|
||||
|
||||
if(status&TIOCM_RNG) return(1);
|
||||
else return(0);
|
||||
}
|
||||
|
||||
|
||||
int RS232_IsCTSEnabled(int comport_number)
|
||||
{
|
||||
int status;
|
||||
|
||||
ioctl(Cport[comport_number], TIOCMGET, &status);
|
||||
|
||||
if(status&TIOCM_CTS) return(1);
|
||||
else return(0);
|
||||
}
|
||||
|
||||
|
||||
int RS232_IsDSREnabled(int comport_number)
|
||||
{
|
||||
int status;
|
||||
|
||||
ioctl(Cport[comport_number], TIOCMGET, &status);
|
||||
|
||||
if(status&TIOCM_DSR) return(1);
|
||||
else return(0);
|
||||
}
|
||||
|
||||
|
||||
void RS232_enableDTR(int comport_number)
|
||||
{
|
||||
int status;
|
||||
|
||||
if(ioctl(Cport[comport_number], TIOCMGET, &status) == -1)
|
||||
{
|
||||
perror("unable to get portstatus");
|
||||
}
|
||||
|
||||
status |= TIOCM_DTR; /* turn on DTR */
|
||||
|
||||
if(ioctl(Cport[comport_number], TIOCMSET, &status) == -1)
|
||||
{
|
||||
perror("unable to set portstatus");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void RS232_disableDTR(int comport_number)
|
||||
{
|
||||
int status;
|
||||
|
||||
if(ioctl(Cport[comport_number], TIOCMGET, &status) == -1)
|
||||
{
|
||||
perror("unable to get portstatus");
|
||||
}
|
||||
|
||||
status &= ~TIOCM_DTR; /* turn off DTR */
|
||||
|
||||
if(ioctl(Cport[comport_number], TIOCMSET, &status) == -1)
|
||||
{
|
||||
perror("unable to set portstatus");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void RS232_enableRTS(int comport_number)
|
||||
{
|
||||
int status;
|
||||
|
||||
if(ioctl(Cport[comport_number], TIOCMGET, &status) == -1)
|
||||
{
|
||||
perror("unable to get portstatus");
|
||||
}
|
||||
|
||||
status |= TIOCM_RTS; /* turn on RTS */
|
||||
|
||||
if(ioctl(Cport[comport_number], TIOCMSET, &status) == -1)
|
||||
{
|
||||
perror("unable to set portstatus");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void RS232_disableRTS(int comport_number)
|
||||
{
|
||||
int status;
|
||||
|
||||
if(ioctl(Cport[comport_number], TIOCMGET, &status) == -1)
|
||||
{
|
||||
perror("unable to get portstatus");
|
||||
}
|
||||
|
||||
status &= ~TIOCM_RTS; /* turn off RTS */
|
||||
|
||||
if(ioctl(Cport[comport_number], TIOCMSET, &status) == -1)
|
||||
{
|
||||
perror("unable to set portstatus");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void RS232_flushRX(int comport_number)
|
||||
{
|
||||
tcflush(Cport[comport_number], TCIFLUSH);
|
||||
}
|
||||
|
||||
|
||||
void RS232_flushTX(int comport_number)
|
||||
{
|
||||
tcflush(Cport[comport_number], TCOFLUSH);
|
||||
}
|
||||
|
||||
|
||||
void RS232_flushRXTX(int comport_number)
|
||||
{
|
||||
tcflush(Cport[comport_number], TCIOFLUSH);
|
||||
}
|
||||
|
||||
|
||||
#else /* windows */
|
||||
|
||||
#define RS232_PORTNR 32
|
||||
|
||||
HANDLE Cport[RS232_PORTNR];
|
||||
|
||||
|
||||
const char *comports[RS232_PORTNR]={"\\\\.\\COM1", "\\\\.\\COM2", "\\\\.\\COM3", "\\\\.\\COM4",
|
||||
"\\\\.\\COM5", "\\\\.\\COM6", "\\\\.\\COM7", "\\\\.\\COM8",
|
||||
"\\\\.\\COM9", "\\\\.\\COM10", "\\\\.\\COM11", "\\\\.\\COM12",
|
||||
"\\\\.\\COM13", "\\\\.\\COM14", "\\\\.\\COM15", "\\\\.\\COM16",
|
||||
"\\\\.\\COM17", "\\\\.\\COM18", "\\\\.\\COM19", "\\\\.\\COM20",
|
||||
"\\\\.\\COM21", "\\\\.\\COM22", "\\\\.\\COM23", "\\\\.\\COM24",
|
||||
"\\\\.\\COM25", "\\\\.\\COM26", "\\\\.\\COM27", "\\\\.\\COM28",
|
||||
"\\\\.\\COM29", "\\\\.\\COM30", "\\\\.\\COM31", "\\\\.\\COM32"};
|
||||
|
||||
char mode_str[128];
|
||||
|
||||
|
||||
int RS232_OpenComport(int comport_number, int baudrate, const char *mode, int flowctrl)
|
||||
{
|
||||
if((comport_number>=RS232_PORTNR)||(comport_number<0))
|
||||
{
|
||||
printf("illegal comport number\n");
|
||||
return(1);
|
||||
}
|
||||
|
||||
switch(baudrate)
|
||||
{
|
||||
case 110 : strcpy(mode_str, "baud=110");
|
||||
break;
|
||||
case 300 : strcpy(mode_str, "baud=300");
|
||||
break;
|
||||
case 600 : strcpy(mode_str, "baud=600");
|
||||
break;
|
||||
case 1200 : strcpy(mode_str, "baud=1200");
|
||||
break;
|
||||
case 2400 : strcpy(mode_str, "baud=2400");
|
||||
break;
|
||||
case 4800 : strcpy(mode_str, "baud=4800");
|
||||
break;
|
||||
case 9600 : strcpy(mode_str, "baud=9600");
|
||||
break;
|
||||
case 19200 : strcpy(mode_str, "baud=19200");
|
||||
break;
|
||||
case 38400 : strcpy(mode_str, "baud=38400");
|
||||
break;
|
||||
case 57600 : strcpy(mode_str, "baud=57600");
|
||||
break;
|
||||
case 115200 : strcpy(mode_str, "baud=115200");
|
||||
break;
|
||||
case 128000 : strcpy(mode_str, "baud=128000");
|
||||
break;
|
||||
case 256000 : strcpy(mode_str, "baud=256000");
|
||||
break;
|
||||
case 500000 : strcpy(mode_str, "baud=500000");
|
||||
break;
|
||||
case 921600 : strcpy(mode_str, "baud=921600");
|
||||
break;
|
||||
case 1000000 : strcpy(mode_str, "baud=1000000");
|
||||
break;
|
||||
case 1500000 : strcpy(mode_str, "baud=1500000");
|
||||
break;
|
||||
case 2000000 : strcpy(mode_str, "baud=2000000");
|
||||
break;
|
||||
case 3000000 : strcpy(mode_str, "baud=3000000");
|
||||
break;
|
||||
default : printf("invalid baudrate\n");
|
||||
return(1);
|
||||
break;
|
||||
}
|
||||
|
||||
if(strlen(mode) != 3)
|
||||
{
|
||||
printf("invalid mode \"%s\"\n", mode);
|
||||
return(1);
|
||||
}
|
||||
|
||||
switch(mode[0])
|
||||
{
|
||||
case '8': strcat(mode_str, " data=8");
|
||||
break;
|
||||
case '7': strcat(mode_str, " data=7");
|
||||
break;
|
||||
case '6': strcat(mode_str, " data=6");
|
||||
break;
|
||||
case '5': strcat(mode_str, " data=5");
|
||||
break;
|
||||
default : printf("invalid number of data-bits '%c'\n", mode[0]);
|
||||
return(1);
|
||||
break;
|
||||
}
|
||||
|
||||
switch(mode[1])
|
||||
{
|
||||
case 'N':
|
||||
case 'n': strcat(mode_str, " parity=n");
|
||||
break;
|
||||
case 'E':
|
||||
case 'e': strcat(mode_str, " parity=e");
|
||||
break;
|
||||
case 'O':
|
||||
case 'o': strcat(mode_str, " parity=o");
|
||||
break;
|
||||
default : printf("invalid parity '%c'\n", mode[1]);
|
||||
return(1);
|
||||
break;
|
||||
}
|
||||
|
||||
switch(mode[2])
|
||||
{
|
||||
case '1': strcat(mode_str, " stop=1");
|
||||
break;
|
||||
case '2': strcat(mode_str, " stop=2");
|
||||
break;
|
||||
default : printf("invalid number of stop bits '%c'\n", mode[2]);
|
||||
return(1);
|
||||
break;
|
||||
}
|
||||
|
||||
if(flowctrl)
|
||||
{
|
||||
strcat(mode_str, " xon=off to=off odsr=off dtr=on rts=off");
|
||||
}
|
||||
else
|
||||
{
|
||||
strcat(mode_str, " xon=off to=off odsr=off dtr=on rts=on");
|
||||
}
|
||||
|
||||
/*
|
||||
http://msdn.microsoft.com/en-us/library/windows/desktop/aa363145%28v=vs.85%29.aspx
|
||||
|
||||
http://technet.microsoft.com/en-us/library/cc732236.aspx
|
||||
|
||||
https://docs.microsoft.com/en-us/windows/desktop/api/winbase/ns-winbase-_dcb
|
||||
*/
|
||||
|
||||
Cport[comport_number] = CreateFileA(comports[comport_number],
|
||||
GENERIC_READ|GENERIC_WRITE,
|
||||
0, /* no share */
|
||||
NULL, /* no security */
|
||||
OPEN_EXISTING,
|
||||
0, /* no threads */
|
||||
NULL); /* no templates */
|
||||
|
||||
if(Cport[comport_number]==INVALID_HANDLE_VALUE)
|
||||
{
|
||||
printf("unable to open comport\n");
|
||||
return(1);
|
||||
}
|
||||
|
||||
DCB port_settings;
|
||||
memset(&port_settings, 0, sizeof(port_settings)); /* clear the new struct */
|
||||
port_settings.DCBlength = sizeof(port_settings);
|
||||
|
||||
if(!BuildCommDCBA(mode_str, &port_settings))
|
||||
{
|
||||
printf("unable to set comport dcb settings\n");
|
||||
CloseHandle(Cport[comport_number]);
|
||||
return(1);
|
||||
}
|
||||
|
||||
if(flowctrl)
|
||||
{
|
||||
port_settings.fOutxCtsFlow = TRUE;
|
||||
port_settings.fRtsControl = RTS_CONTROL_HANDSHAKE;
|
||||
}
|
||||
|
||||
if(!SetCommState(Cport[comport_number], &port_settings))
|
||||
{
|
||||
printf("unable to set comport cfg settings\n");
|
||||
CloseHandle(Cport[comport_number]);
|
||||
return(1);
|
||||
}
|
||||
|
||||
COMMTIMEOUTS Cptimeouts;
|
||||
|
||||
Cptimeouts.ReadIntervalTimeout = MAXDWORD;
|
||||
Cptimeouts.ReadTotalTimeoutMultiplier = 0;
|
||||
Cptimeouts.ReadTotalTimeoutConstant = 0;
|
||||
Cptimeouts.WriteTotalTimeoutMultiplier = 0;
|
||||
Cptimeouts.WriteTotalTimeoutConstant = 0;
|
||||
|
||||
if(!SetCommTimeouts(Cport[comport_number], &Cptimeouts))
|
||||
{
|
||||
printf("unable to set comport time-out settings\n");
|
||||
CloseHandle(Cport[comport_number]);
|
||||
return(1);
|
||||
}
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
||||
int RS232_PollComport(int comport_number, unsigned char *buf, int size)
|
||||
{
|
||||
int n;
|
||||
|
||||
/* added the void pointer cast, otherwise gcc will complain about */
|
||||
/* "warning: dereferencing type-punned pointer will break strict aliasing rules" */
|
||||
|
||||
if(!ReadFile(Cport[comport_number], buf, size, (LPDWORD)((void *)&n), NULL))
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
return(n);
|
||||
}
|
||||
|
||||
|
||||
int RS232_SendByte(int comport_number, unsigned char byte)
|
||||
{
|
||||
int n;
|
||||
|
||||
if(!WriteFile(Cport[comport_number], &byte, 1, (LPDWORD)((void *)&n), NULL))
|
||||
{
|
||||
return(1);
|
||||
}
|
||||
|
||||
if(n<0) return(1);
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
||||
int RS232_SendBuf(int comport_number, unsigned char *buf, int size)
|
||||
{
|
||||
int n;
|
||||
|
||||
if(WriteFile(Cport[comport_number], buf, size, (LPDWORD)((void *)&n), NULL))
|
||||
{
|
||||
return(n);
|
||||
}
|
||||
|
||||
return(-1);
|
||||
}
|
||||
|
||||
|
||||
void RS232_CloseComport(int comport_number)
|
||||
{
|
||||
CloseHandle(Cport[comport_number]);
|
||||
}
|
||||
|
||||
/*
|
||||
http://msdn.microsoft.com/en-us/library/windows/desktop/aa363258%28v=vs.85%29.aspx
|
||||
*/
|
||||
|
||||
int RS232_IsDCDEnabled(int comport_number)
|
||||
{
|
||||
int status;
|
||||
|
||||
GetCommModemStatus(Cport[comport_number], (LPDWORD)((void *)&status));
|
||||
|
||||
if(status&MS_RLSD_ON) return(1);
|
||||
else return(0);
|
||||
}
|
||||
|
||||
|
||||
int RS232_IsRINGEnabled(int comport_number)
|
||||
{
|
||||
int status;
|
||||
|
||||
GetCommModemStatus(Cport[comport_number], (LPDWORD)((void *)&status));
|
||||
|
||||
if(status&MS_RING_ON) return(1);
|
||||
else return(0);
|
||||
}
|
||||
|
||||
|
||||
int RS232_IsCTSEnabled(int comport_number)
|
||||
{
|
||||
int status;
|
||||
|
||||
GetCommModemStatus(Cport[comport_number], (LPDWORD)((void *)&status));
|
||||
|
||||
if(status&MS_CTS_ON) return(1);
|
||||
else return(0);
|
||||
}
|
||||
|
||||
|
||||
int RS232_IsDSREnabled(int comport_number)
|
||||
{
|
||||
int status;
|
||||
|
||||
GetCommModemStatus(Cport[comport_number], (LPDWORD)((void *)&status));
|
||||
|
||||
if(status&MS_DSR_ON) return(1);
|
||||
else return(0);
|
||||
}
|
||||
|
||||
|
||||
void RS232_enableDTR(int comport_number)
|
||||
{
|
||||
EscapeCommFunction(Cport[comport_number], SETDTR);
|
||||
}
|
||||
|
||||
|
||||
void RS232_disableDTR(int comport_number)
|
||||
{
|
||||
EscapeCommFunction(Cport[comport_number], CLRDTR);
|
||||
}
|
||||
|
||||
|
||||
void RS232_enableRTS(int comport_number)
|
||||
{
|
||||
EscapeCommFunction(Cport[comport_number], SETRTS);
|
||||
}
|
||||
|
||||
|
||||
void RS232_disableRTS(int comport_number)
|
||||
{
|
||||
EscapeCommFunction(Cport[comport_number], CLRRTS);
|
||||
}
|
||||
|
||||
/*
|
||||
https://msdn.microsoft.com/en-us/library/windows/desktop/aa363428%28v=vs.85%29.aspx
|
||||
*/
|
||||
|
||||
void RS232_flushRX(int comport_number)
|
||||
{
|
||||
PurgeComm(Cport[comport_number], PURGE_RXCLEAR | PURGE_RXABORT);
|
||||
}
|
||||
|
||||
|
||||
void RS232_flushTX(int comport_number)
|
||||
{
|
||||
PurgeComm(Cport[comport_number], PURGE_TXCLEAR | PURGE_TXABORT);
|
||||
}
|
||||
|
||||
|
||||
void RS232_flushRXTX(int comport_number)
|
||||
{
|
||||
PurgeComm(Cport[comport_number], PURGE_RXCLEAR | PURGE_RXABORT);
|
||||
PurgeComm(Cport[comport_number], PURGE_TXCLEAR | PURGE_TXABORT);
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
void RS232_cputs(int comport_number, const char *text) /* sends a string to serial port */
|
||||
{
|
||||
while(*text != 0) RS232_SendByte(comport_number, *(text++));
|
||||
}
|
||||
|
||||
|
||||
/* return index in comports matching to device name or -1 if not found */
|
||||
int RS232_GetPortnr(const char *devname)
|
||||
{
|
||||
int i;
|
||||
|
||||
char str[32];
|
||||
|
||||
#if defined(__linux__) || defined(__FreeBSD__) /* Linux & FreeBSD */
|
||||
strcpy(str, "/dev/");
|
||||
#else /* windows */
|
||||
strcpy(str, "\\\\.\\");
|
||||
#endif
|
||||
strncat(str, devname, 16);
|
||||
str[31] = 0;
|
||||
|
||||
for(i=0; i<RS232_PORTNR; i++)
|
||||
{
|
||||
if(!strcmp(comports[i], str))
|
||||
{
|
||||
return i;
|
||||
}
|
||||
}
|
||||
|
||||
return -1; /* device not found */
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
85
feeds/bluetooth-cc2652/ble_scan/src/rs232.h
Executable file
85
feeds/bluetooth-cc2652/ble_scan/src/rs232.h
Executable file
@@ -0,0 +1,85 @@
|
||||
/*
|
||||
***************************************************************************
|
||||
*
|
||||
* Author: Teunis van Beelen
|
||||
*
|
||||
* Copyright (C) 2005 - 2021 Teunis van Beelen
|
||||
*
|
||||
* Email: teuniz@protonmail.com
|
||||
*
|
||||
***************************************************************************
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
***************************************************************************
|
||||
*/
|
||||
|
||||
/* For more info and how to use this library, visit: http://www.teuniz.net/RS-232/ */
|
||||
|
||||
|
||||
#ifndef rs232_INCLUDED
|
||||
#define rs232_INCLUDED
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
|
||||
|
||||
#if defined(__linux__) || defined(__FreeBSD__)
|
||||
|
||||
#include <termios.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <limits.h>
|
||||
#include <sys/file.h>
|
||||
#include <errno.h>
|
||||
|
||||
#else
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
#endif
|
||||
|
||||
int RS232_OpenComport(int, int, const char *, int);
|
||||
int RS232_PollComport(int, unsigned char *, int);
|
||||
int RS232_SendByte(int, unsigned char);
|
||||
int RS232_SendBuf(int, unsigned char *, int);
|
||||
void RS232_CloseComport(int);
|
||||
void RS232_cputs(int, const char *);
|
||||
int RS232_IsDCDEnabled(int);
|
||||
int RS232_IsRINGEnabled(int);
|
||||
int RS232_IsCTSEnabled(int);
|
||||
int RS232_IsDSREnabled(int);
|
||||
void RS232_enableDTR(int);
|
||||
void RS232_disableDTR(int);
|
||||
void RS232_enableRTS(int);
|
||||
void RS232_disableRTS(int);
|
||||
void RS232_flushRX(int);
|
||||
void RS232_flushTX(int);
|
||||
void RS232_flushRXTX(int);
|
||||
int RS232_GetPortnr(const char *);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
37
feeds/bluetooth-cc2652/cc2652/Makefile
Executable file
37
feeds/bluetooth-cc2652/cc2652/Makefile
Executable file
@@ -0,0 +1,37 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=cc2652
|
||||
PKG_VERSION:=1.0.0
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/cc2652
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=cc2652 -- TI CC26x2 firmware upgrade tool
|
||||
DEPENDS:=+libstdcpp +zlib
|
||||
endef
|
||||
|
||||
define Package/cc2652/description
|
||||
TI CC26x2 firmware upgrade tool
|
||||
endef
|
||||
|
||||
define Build/Prepare
|
||||
mkdir -p $(PKG_BUILD_DIR)
|
||||
$(CP) ./src/* $(PKG_BUILD_DIR)/
|
||||
endef
|
||||
|
||||
define Package/cc2652/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/cc2562
|
||||
$(INSTALL_BIN) ./files/firmware/* $(1)/lib/firmware/cc2562
|
||||
|
||||
$(INSTALL_DIR) $(1)/usr/bin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/tisbl $(1)/usr/bin/
|
||||
$(INSTALL_BIN) ./files/*.sh $(1)/usr/bin/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,cc2652))
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
#!/bin/sh
|
||||
|
||||
if [ -f /sys/class/gpio/ble_enable/value ]; then
|
||||
echo 1 > /sys/class/gpio/ble_enable/value
|
||||
fi
|
||||
echo 0 > /sys/class/gpio/ble_backdoor/value
|
||||
echo 1 > /sys/class/gpio/ble_reset/value
|
||||
echo 0 > /sys/class/gpio/ble_reset/value
|
||||
sleep 1
|
||||
echo 1 > /sys/class/gpio/ble_reset/value
|
||||
sleep 1
|
||||
echo 1 > /sys/class/gpio/ble_backdoor/value
|
||||
tisbl /dev/ttyMSM1 115200 2652 /lib/firmware/cc2562/simple_broadcaster_bd9.bin
|
||||
13
feeds/bluetooth-cc2652/cc2652/files/cc2562-flash-scanner.sh
Normal file
13
feeds/bluetooth-cc2652/cc2652/files/cc2562-flash-scanner.sh
Normal file
@@ -0,0 +1,13 @@
|
||||
#!/bin/sh
|
||||
|
||||
if [ -f /sys/class/gpio/ble_enable/value ]; then
|
||||
echo 1 > /sys/class/gpio/ble_enable/value
|
||||
fi
|
||||
echo 0 > /sys/class/gpio/ble_backdoor/value
|
||||
echo 1 > /sys/class/gpio/ble_reset/value
|
||||
echo 0 > /sys/class/gpio/ble_reset/value
|
||||
sleep 1
|
||||
echo 1 > /sys/class/gpio/ble_reset/value
|
||||
sleep 1
|
||||
echo 1 > /sys/class/gpio/ble_backdoor/value
|
||||
tisbl /dev/ttyMSM1 115200 2652 /lib/firmware/cc2562/ble5_host_test_bd9.bin
|
||||
10
feeds/bluetooth-cc2652/cc2652/files/cc2562-reset.sh
Normal file
10
feeds/bluetooth-cc2652/cc2652/files/cc2562-reset.sh
Normal file
@@ -0,0 +1,10 @@
|
||||
#!/bin/sh
|
||||
|
||||
if [ -f /sys/class/gpio/ble_enable/value ]; then
|
||||
echo 1 > /sys/class/gpio/ble_enable/value
|
||||
fi
|
||||
echo 1 > /sys/class/gpio/ble_backdoor/value
|
||||
echo 1 > /sys/class/gpio/ble_reset/value
|
||||
sleep 1
|
||||
echo 1 > /sys/class/gpio/ble_reset/value
|
||||
sleep 1
|
||||
13
feeds/bluetooth-cc2652/cc2652/files/cc2562-wr.sh
Executable file
13
feeds/bluetooth-cc2652/cc2652/files/cc2562-wr.sh
Executable file
@@ -0,0 +1,13 @@
|
||||
#!/bin/sh
|
||||
# com-wr.sh tty time command parser
|
||||
# example com-wr.sh /dev/ttyMSM1 1 "\x01\x1D\xFC\x01\x00" | hexdump.sh --> send "\x01\x1D\xFC\x01\x00" to /dev/ttyMSM1 and then hexdump receive data until 100ms timeout
|
||||
#command example "\x7E\x03\xD0\xAF und normaler Text"
|
||||
tty=$1
|
||||
time=$2
|
||||
command=$3
|
||||
parser=$4
|
||||
stty -F $tty time $time
|
||||
exec 99< $tty
|
||||
echo -en $command > $tty
|
||||
cat $tty
|
||||
exec 99<&-
|
||||
BIN
feeds/bluetooth-cc2652/cc2652/files/firmware/ble5_host_test_bd9.bin
Executable file
BIN
feeds/bluetooth-cc2652/cc2652/files/firmware/ble5_host_test_bd9.bin
Executable file
Binary file not shown.
BIN
feeds/bluetooth-cc2652/cc2652/files/firmware/blinky_bd9.bin
Executable file
BIN
feeds/bluetooth-cc2652/cc2652/files/firmware/blinky_bd9.bin
Executable file
Binary file not shown.
BIN
feeds/bluetooth-cc2652/cc2652/files/firmware/multi_role_bd9.bin
Executable file
BIN
feeds/bluetooth-cc2652/cc2652/files/firmware/multi_role_bd9.bin
Executable file
Binary file not shown.
BIN
feeds/bluetooth-cc2652/cc2652/files/firmware/simple_broadcaster_bd9.bin
Executable file
BIN
feeds/bluetooth-cc2652/cc2652/files/firmware/simple_broadcaster_bd9.bin
Executable file
Binary file not shown.
BIN
feeds/bluetooth-cc2652/cc2652/files/firmware/simple_central_bd9.bin
Executable file
BIN
feeds/bluetooth-cc2652/cc2652/files/firmware/simple_central_bd9.bin
Executable file
Binary file not shown.
BIN
feeds/bluetooth-cc2652/cc2652/files/firmware/simple_peripheral_bd9.bin
Executable file
BIN
feeds/bluetooth-cc2652/cc2652/files/firmware/simple_peripheral_bd9.bin
Executable file
Binary file not shown.
BIN
feeds/bluetooth-cc2652/cc2652/files/firmware/znp_bd9.bin
Executable file
BIN
feeds/bluetooth-cc2652/cc2652/files/firmware/znp_bd9.bin
Executable file
Binary file not shown.
28
feeds/bluetooth-cc2652/cc2652/files/ibeacon-broadcaster.sh
Executable file
28
feeds/bluetooth-cc2652/cc2652/files/ibeacon-broadcaster.sh
Executable file
@@ -0,0 +1,28 @@
|
||||
#!/bin/sh
|
||||
function iBeconScan() {
|
||||
if [ "$#" -eq 4 ]; then
|
||||
UUID=$1
|
||||
MAJOR=$2
|
||||
MINOR=$3
|
||||
POWER=$4
|
||||
else
|
||||
UUID="\xE2\x0A\x39\xF4\x73\xF5\x4B\xC4\xA1\x2F\x17\xD1\xAD\x07\xA9\x61"
|
||||
MAJOR="\x01\x23"
|
||||
MINOR="\x45\x67"
|
||||
POWER="\xC8"
|
||||
fi
|
||||
|
||||
cc2562-wr.sh /dev/ttyMSM1 3 "\x01\x1D\xFC\x01\x00" > /dev/null # this command dealy time must >= 3, if small then 3, the following commands will be something wrong
|
||||
cc2562-wr.sh /dev/ttyMSM1 1 "\x01\x00\xFE\x08\x01\x00\x00\x00\x00\x00\x00\x00" > /dev/null
|
||||
cc2562-wr.sh /dev/ttyMSM1 1 "\x01\x3E\xFE\x15\x12\x00\xA0\x00\x00\xA0\x00\x00\x07\x00\x00\x00\x00\x00\x00\x00\x00\x7F\x01\x01\x00" > /dev/null
|
||||
cc2562-wr.sh /dev/ttyMSM1 1 "\x09\x44\xFE\x23\x00\x00\x00\x1E\x00\x02\x01\x1A\x1A\xFF\x4C\x00\x02\x15${UUID}${MAJOR}${MINOR}${POWER}\x00" > /dev/null
|
||||
cc2562-wr.sh /dev/ttyMSM1 1 "\x01\x3F\xFE\x04\x00\x00\x00\x00"
|
||||
}
|
||||
|
||||
cc2562-reset.sh
|
||||
|
||||
while true
|
||||
do
|
||||
iBeconScan
|
||||
sleep 1
|
||||
done
|
||||
27
feeds/bluetooth-cc2652/cc2652/src/Makefile
Executable file
27
feeds/bluetooth-cc2652/cc2652/src/Makefile
Executable file
@@ -0,0 +1,27 @@
|
||||
# Executable
|
||||
EXE = tisbl
|
||||
|
||||
# Compiler, Linker Defines
|
||||
#CC = g++
|
||||
#CFLAGS = -w -O -Wno-deprecated -I. -fpermissive -std=gnu++0x
|
||||
#CFLAGS = -I. -fpermissive -Wwrite-strings -lstdc++
|
||||
CFLAGS = -I. -Wwrite-strings -std=gnu++0x -lstdc++ -fPIC
|
||||
#CFLAGS = -I. -lstdc++ -Wwrite-strings -std=gnu++0x
|
||||
#LIBS =
|
||||
#LDFLAGS = $(LIBS)
|
||||
|
||||
# Compile and Assemble C++ Source Files into Object Files
|
||||
%.o: %.cpp
|
||||
$(CXX) $(CFLAGS) $(LDFLAGS) -c $< -o $@
|
||||
# Source and Object files
|
||||
SRC = $(wildcard *.cpp)
|
||||
OBJ = $(patsubst %.cpp, %.o, $(SRC))
|
||||
|
||||
# Link all Object Files with external Libraries into Binaries
|
||||
$(EXE): $(OBJ)
|
||||
$(CC) $(CFLAGS) $(OBJ) $(LDFLAGS) -o $(EXE)
|
||||
# $(CC) $(CFLAGS) $(OBJ) $(LDFLAGS) -o $(EXE) -lz
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
-rm -f $(EXE) *.o
|
||||
13
feeds/bluetooth-cc2652/cc2652/src/debug.h
Executable file
13
feeds/bluetooth-cc2652/cc2652/src/debug.h
Executable file
@@ -0,0 +1,13 @@
|
||||
#ifndef __DEBUG_H__
|
||||
#define __DEBUG_H__
|
||||
|
||||
#include <stdio.h>
|
||||
#define DEBUG 0
|
||||
#if defined(DEBUG) && DEBUG > 0
|
||||
#define DEBUG_PRINT(fmt, args...) fprintf(stderr, "$$%d:%s:%d:%s():" fmt, \
|
||||
(int)time(NULL), __FILE__, __LINE__, __func__, ##args)
|
||||
#else
|
||||
#define DEBUG_PRINT(fmt, args...) /* Don't do anything in release builds */
|
||||
#endif
|
||||
|
||||
#endif // __DEBUG_H__
|
||||
257
feeds/bluetooth-cc2652/cc2652/src/sblAppEx.cpp
Executable file
257
feeds/bluetooth-cc2652/cc2652/src/sblAppEx.cpp
Executable file
@@ -0,0 +1,257 @@
|
||||
/******************************************************************************
|
||||
* Filename: sblAppEx.cpp
|
||||
* Revised: $Date$
|
||||
* Revision: $Revision$
|
||||
*
|
||||
* Description: Serial Bootloader Library application example.
|
||||
* This example enumerates all COM devices and lets you
|
||||
* select which port to connect to. The example assumes the
|
||||
* connected device is a CC2538, CC2650 or CC2652 and programs
|
||||
* a blinky onto the device. After programming the blinky,
|
||||
* bootloader mode may be forced by
|
||||
* - holding SELECT button on 06EB (for CC2538 and CC26x0 EMKs), or
|
||||
* - holding BTN-1 on the device LaunchPad (for CC26x2 LPs)
|
||||
* when resetting the chip.
|
||||
*
|
||||
* Copyright (C) 2013 - 2019 Texas Instruments Incorporated - http://www.ti.com/
|
||||
*
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* Neither the name of Texas Instruments Incorporated nor the names of
|
||||
* its contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
******************************************************************************/
|
||||
#include "serialib.h"
|
||||
#include "sbllib.h"
|
||||
#include <vector>
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
|
||||
//#include <time.h>
|
||||
|
||||
using namespace std;
|
||||
|
||||
// Calculate crc32 checksum the way CC2538 and CC2650 does it.
|
||||
int calcCrcLikeChip(const unsigned char *pData, unsigned long ulByteCount)
|
||||
{
|
||||
unsigned long d, ind;
|
||||
unsigned long acc = 0xFFFFFFFF;
|
||||
const unsigned long ulCrcRand32Lut[] =
|
||||
{
|
||||
0x00000000, 0x1DB71064, 0x3B6E20C8, 0x26D930AC,
|
||||
0x76DC4190, 0x6B6B51F4, 0x4DB26158, 0x5005713C,
|
||||
0xEDB88320, 0xF00F9344, 0xD6D6A3E8, 0xCB61B38C,
|
||||
0x9B64C2B0, 0x86D3D2D4, 0xA00AE278, 0xBDBDF21C
|
||||
};
|
||||
|
||||
while ( ulByteCount-- )
|
||||
{
|
||||
d = *pData++;
|
||||
ind = (acc & 0x0F) ^ (d & 0x0F);
|
||||
acc = (acc >> 4) ^ ulCrcRand32Lut[ind];
|
||||
ind = (acc & 0x0F) ^ (d >> 4);
|
||||
acc = (acc >> 4) ^ ulCrcRand32Lut[ind];
|
||||
}
|
||||
|
||||
return (acc ^ 0xFFFFFFFF);
|
||||
}
|
||||
|
||||
/// Application status function (used as SBL status callback)
|
||||
void appStatus(char *pcText, bool bError)
|
||||
{
|
||||
if(bError)
|
||||
{
|
||||
cerr << pcText;
|
||||
}
|
||||
else
|
||||
{
|
||||
cout << pcText;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// Application progress function (used as SBL progress callback)
|
||||
static void appProgress(uint32_t progress)
|
||||
{
|
||||
fprintf(stdout, "\r%d%% ", progress);
|
||||
fflush(stdout);
|
||||
}
|
||||
|
||||
// Defines
|
||||
// Name Hex Dec
|
||||
// ------------------------------- --------------- ---------------------------------
|
||||
#define DEVICE_CC2538 0x2538 // 9528
|
||||
#define DEVICE_CC26X0 0x2650 // 9808
|
||||
#define DEVICE_CC2640R2 0x2640 // 9792
|
||||
#define DEVICE_CC26X2 0x2652 // 9810
|
||||
#define CC2538_FLASH_BASE 0x00200000
|
||||
#define CC26XX_FLASH_BASE 0x00000000
|
||||
|
||||
// Application main function
|
||||
// tisbl SerialDevNode baudRate deviceType firmware
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
// START: Program Configuration
|
||||
/* UART baud rate. Default: 230400 */
|
||||
uint32_t baudRate = 115200;
|
||||
uint32_t deviceType = DEVICE_CC26X2;
|
||||
SblDevice *pDevice = NULL; // Pointer to SblDevice object
|
||||
char *SerialDevNode;
|
||||
int32_t devStatus = -1; // Hold SBL status codes
|
||||
std::string fileName; // File name to program
|
||||
uint32_t byteCount = 0; // File size in bytes
|
||||
uint32_t fileCrc, devCrc; // Variables to save CRC checksum
|
||||
uint32_t devFlashBase; // Flash start address
|
||||
static std::vector<char> pvWrite(1);// Vector to application firmware in.
|
||||
static std::ifstream file; // File stream
|
||||
|
||||
// Set callback functions
|
||||
SblDevice::setCallBackStatusFunction(&appStatus);
|
||||
SblDevice::setCallBackProgressFunction(&appProgress);
|
||||
|
||||
// Select device
|
||||
// deviceType FlashBase File
|
||||
// DEVICE_CC2538 CC2538_FLASH_BASE blinky_backdoor_select_btn2538.bin
|
||||
// DEVICE_CC26X0 CC26XX_FLASH_BASE blinky_backdoor_select_btn2650.bin
|
||||
// DEVICE_CC2640R2 CC26XX_FLASH_BASE blinky_backdoor_select_btn2640r2.bin
|
||||
// DEVICE_CC26X2 CC26XX_FLASH_BASE blinky_backdoor_select_btn26x2.bin
|
||||
if(argc < 5) {
|
||||
return -1;
|
||||
}
|
||||
SerialDevNode = argv[1];
|
||||
baudRate = atoi(argv[2]);
|
||||
deviceType = strtol(argv[3], NULL, 16);
|
||||
fileName = argv[4];
|
||||
switch(deviceType)
|
||||
{
|
||||
case DEVICE_CC2538:
|
||||
devFlashBase = CC2538_FLASH_BASE;
|
||||
break;
|
||||
case DEVICE_CC26X0:
|
||||
case DEVICE_CC2640R2:
|
||||
case DEVICE_CC26X2:
|
||||
devFlashBase = CC26XX_FLASH_BASE;
|
||||
break;
|
||||
}
|
||||
printf("SerialDevNode=%s, baudRate=%d, deviceType=%04x, fileName=%s\n",SerialDevNode,baudRate,deviceType,fileName.c_str());
|
||||
|
||||
// Should SBL try to enable XOSC? (Not possible for CC26xx)
|
||||
bool bEnableXosc = false;
|
||||
if(deviceType == DEVICE_CC2538)
|
||||
{
|
||||
char answer[64];
|
||||
cout << "Enable device CC2538 XOSC? (Y/N): ";
|
||||
cin >> answer;
|
||||
bEnableXosc = (answer[0] == 'Y' || answer[0] == 'y') ? true : false;
|
||||
}
|
||||
|
||||
// Create SBL object
|
||||
pDevice = SblDevice::Create(deviceType);
|
||||
if(pDevice == NULL)
|
||||
{
|
||||
printf("No SBL device object.\n");
|
||||
cout << "\n\nAn error occurred: " << pDevice->getLastStatus();
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Connect to device
|
||||
printf("Connecting (%s @ %d baud) ...\n", SerialDevNode, baudRate);
|
||||
if(pDevice->connect(SerialDevNode, baudRate, bEnableXosc) != SBL_SUCCESS)
|
||||
{
|
||||
cout << "\n\nAn error occurred: " << pDevice->getLastStatus();
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Read file
|
||||
file.open(fileName.c_str(), std::ios::binary);
|
||||
if(file.is_open())
|
||||
{
|
||||
// Get file size:
|
||||
file.seekg(0, std::ios::end);
|
||||
byteCount = (uint32_t)file.tellg();
|
||||
file.seekg(0, std::ios::beg);
|
||||
|
||||
// Read data
|
||||
pvWrite.resize(byteCount);
|
||||
file.read((char*) &pvWrite[0], byteCount);
|
||||
}
|
||||
else
|
||||
{
|
||||
cout << "Unable to open file " << fileName.c_str();
|
||||
cout << "\n\nAn error occurred: " << pDevice->getLastStatus();
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Calculate file CRC checksum
|
||||
fileCrc = calcCrcLikeChip((unsigned char *)&pvWrite[0], byteCount);
|
||||
|
||||
if(pDevice->calculateCrc32(devFlashBase, byteCount, &devCrc) != SBL_SUCCESS)
|
||||
{
|
||||
cout << "\n\nAn error occurred: " << pDevice->getLastStatus();
|
||||
return -1;
|
||||
}
|
||||
printf ("pre-Comparing CRC: fileCrc=%x,devCrc=%x\n",fileCrc,devCrc);
|
||||
|
||||
if(fileCrc == devCrc) {
|
||||
cout << "CRC is same, no need to upgrade\n";
|
||||
pDevice->reset();
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Erasing as much flash needed to program firmware.
|
||||
cout << "Erasing flash ...\n";
|
||||
if(pDevice->eraseFlashRange(devFlashBase, byteCount) != SBL_SUCCESS)
|
||||
{
|
||||
cout << "\n\nAn error occurred: " << pDevice->getLastStatus();
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Writing file to device flash memory.
|
||||
cout << "Writing flash ...\n";
|
||||
if(pDevice->writeFlashRange(devFlashBase, byteCount, &pvWrite[0]) != SBL_SUCCESS)
|
||||
{
|
||||
cout << "\n\nAn error occurred: " << pDevice->getLastStatus();
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Calculate CRC checksum of flashed content.
|
||||
cout << "Calculating CRC on device ...\n";
|
||||
if(pDevice->calculateCrc32(devFlashBase, byteCount, &devCrc) != SBL_SUCCESS)
|
||||
{
|
||||
cout << "\n\nAn error occurred: " << pDevice->getLastStatus();
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Compare CRC checksums
|
||||
printf ("Comparing CRC: fileCrc=%x,devCrc=%x\n",fileCrc,devCrc);
|
||||
if(fileCrc == devCrc) printf("OK\n");
|
||||
else printf("Mismatch!\n");
|
||||
|
||||
cout << "Resetting device ...\n";
|
||||
pDevice->reset();
|
||||
cout << "OK\n";
|
||||
|
||||
}
|
||||
673
feeds/bluetooth-cc2652/cc2652/src/sbl_device.cpp
Executable file
673
feeds/bluetooth-cc2652/cc2652/src/sbl_device.cpp
Executable file
@@ -0,0 +1,673 @@
|
||||
/******************************************************************************
|
||||
* Filename: sbl_device.cpp
|
||||
* Revised: $Date$
|
||||
* Revision: $Revision$
|
||||
*
|
||||
* Description: Serial Bootloader device file.
|
||||
*
|
||||
* Copyright (C) 2014 Texas Instruments Incorporated - http://www.ti.com/
|
||||
*
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* Neither the name of Texas Instruments Incorporated nor the names of
|
||||
* its contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
#include <sbllib.h>
|
||||
#include "sbl_device.h"
|
||||
#include "sbl_device_cc2538.h"
|
||||
#include "sbl_device_cc2650.h"
|
||||
#include "sbl_device_cc2652.h"
|
||||
|
||||
#if 0
|
||||
#include <ComPort.h>
|
||||
#include <ComPortElement.h>
|
||||
#else
|
||||
#include "serialib.h"
|
||||
#endif
|
||||
|
||||
#include <stdarg.h>
|
||||
|
||||
// Static variables
|
||||
//
|
||||
std::string SblDevice::sm_csLastError;
|
||||
uint32_t SblDevice::sm_progress = 0;
|
||||
tProgressFPTR SblDevice::sm_pProgressFunction = NULL;
|
||||
tStatusFPTR SblDevice::sm_pStatusFunction = NULL;
|
||||
uint32_t SblDevice::sm_chipType = 0;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
/** \brief Constructor
|
||||
*/
|
||||
//-----------------------------------------------------------------------------
|
||||
SblDevice::SblDevice()
|
||||
{
|
||||
m_pCom = NULL;
|
||||
m_lastDeviceStatus = -1;
|
||||
m_lastSblStatus = SBL_SUCCESS;
|
||||
m_bCommInitialized = false;
|
||||
m_deviceId = 0;
|
||||
m_ramSize = 0;
|
||||
m_flashSize = 0;
|
||||
m_pageEraseSize = 0;
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
/** \brief Destructor
|
||||
*/
|
||||
//-----------------------------------------------------------------------------
|
||||
SblDevice::~SblDevice()
|
||||
{
|
||||
if (m_pCom != nullptr)
|
||||
{
|
||||
delete m_pCom;
|
||||
m_pCom = nullptr;
|
||||
}
|
||||
|
||||
m_lastDeviceStatus = -1;
|
||||
m_bCommInitialized = false;
|
||||
m_ramSize = -1;
|
||||
m_flashSize = -1;
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
/** \brief Create Serial Bootloader Device
|
||||
*
|
||||
* \param[in] ui32ChipType
|
||||
* Chip type the object should be created for, e.g. 0x2650 for CC2650.
|
||||
*/
|
||||
//-----------------------------------------------------------------------------
|
||||
/*static*/SblDevice *
|
||||
SblDevice::Create(uint32_t ui32ChipType)
|
||||
{
|
||||
if (ui32ChipType == 0)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
sm_chipType = ui32ChipType;
|
||||
|
||||
switch (ui32ChipType)
|
||||
{
|
||||
case 0x2538:
|
||||
return (SblDevice *)new SblDeviceCC2538();
|
||||
case 0x1350:
|
||||
case 0x1310:
|
||||
case 0x2670:
|
||||
case 0x2650:
|
||||
case 0x2640:
|
||||
case 0x2630:
|
||||
case 0x2620:
|
||||
return (SblDevice *)new SblDeviceCC2650();
|
||||
case 0x1312:
|
||||
case 0x1352:
|
||||
case 0x2642:
|
||||
case 0x2652:
|
||||
return (SblDevice *)new SblDeviceCC2652();
|
||||
default:
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#if 0
|
||||
//-----------------------------------------------------------------------------
|
||||
/** \brief Enumerate COM port devices
|
||||
*
|
||||
* \param[in/out] pComPortElements
|
||||
* Pointer to array where enumerated COM devices are stored
|
||||
* \param[in/out] numElements
|
||||
* Maximum number of elements to enumerate. Is populated with number
|
||||
* of devices enumerated.
|
||||
*
|
||||
* \return
|
||||
*
|
||||
*/
|
||||
//-----------------------------------------------------------------------------
|
||||
/*static*/uint32_t
|
||||
SblDevice::enumerate(ComPortElement *pComPortElements, int &numElements)
|
||||
{
|
||||
ComPort com;
|
||||
if (com.enumerate(pComPortElements, numElements) != ComPort::COMPORT_SUCCESS)
|
||||
{
|
||||
printf("Failed to enumerate COM devices.\n");
|
||||
return SBL_ENUM_ERROR;
|
||||
}
|
||||
|
||||
return SBL_SUCCESS;
|
||||
}
|
||||
#endif
|
||||
//-----------------------------------------------------------------------------
|
||||
/** \brief Connect to given port number at specified baud rate.
|
||||
*
|
||||
* \param[in] csPortNum
|
||||
* String containing the COM port to use
|
||||
* \param[in] ui32BaudRate
|
||||
* Baud rate to use for talking to the device.
|
||||
* \param[in] bEnableXosc (optional)
|
||||
* If true, try to enable device XOSC. Defaults to false. This option is
|
||||
* not available for all device types.
|
||||
*
|
||||
* \return
|
||||
* Returns SBL_SUCCESS, ...
|
||||
*/
|
||||
//-----------------------------------------------------------------------------
|
||||
uint32_t
|
||||
SblDevice::connect(std::string csPortNum, uint32_t ui32BaudRate,
|
||||
bool bEnableXosc/* = false*/)
|
||||
{
|
||||
DEBUG_PRINT("\n");
|
||||
int retCode = SBL_SUCCESS;
|
||||
|
||||
//
|
||||
// Check input arguments
|
||||
//
|
||||
if (csPortNum.empty() || ui32BaudRate == 0)
|
||||
{
|
||||
setState(SBL_ARGUMENT_ERROR, "Cannot connect. Port number '%s' or baud rate '%d' is invalid.\n",
|
||||
csPortNum.c_str(), ui32BaudRate);
|
||||
return SBL_ARGUMENT_ERROR;
|
||||
}
|
||||
|
||||
// Try to connect to the specified port at the specified baud rate
|
||||
if (m_pCom != NULL)
|
||||
{
|
||||
// Try to open port
|
||||
#if 1
|
||||
char result = m_pCom->openDevice(csPortNum.c_str(),ui32BaudRate);
|
||||
if(result < 0)
|
||||
{
|
||||
setState(SBL_PORT_ERROR, "SBL: Unable to open %s. Error: %d.\n", csPortNum.c_str(), result);
|
||||
return SBL_PORT_ERROR;
|
||||
}
|
||||
#else
|
||||
if (int result = m_pCom->open(csPortNum,
|
||||
ui32BaudRate,
|
||||
SBL_DEFAULT_READ_TIMEOUT,
|
||||
SBL_DEFAULT_WRITE_TIMEOUT) != ComPort::COMPORT_SUCCESS)
|
||||
{
|
||||
setState(SBL_PORT_ERROR, "SBL: Unable to open %s. Error: %d.\n", csPortNum.c_str(), result);
|
||||
return SBL_PORT_ERROR;
|
||||
}
|
||||
#endif
|
||||
m_csComPort = csPortNum;
|
||||
m_baudRate = ui32BaudRate;
|
||||
}
|
||||
// Check if device is responding at the given baud rate
|
||||
if ((retCode = initCommunication(bEnableXosc)) != SBL_SUCCESS)
|
||||
{
|
||||
return retCode;
|
||||
}
|
||||
|
||||
//
|
||||
// Read device ID
|
||||
//
|
||||
uint32_t tmp;
|
||||
if ((retCode = readDeviceId(&tmp)) != SBL_SUCCESS)
|
||||
{
|
||||
setState(retCode, "Failed to read device ID during initial connect.\n");
|
||||
return retCode;
|
||||
}
|
||||
//
|
||||
// Read device flash size
|
||||
//
|
||||
if ((retCode = readFlashSize(&tmp)) != SBL_SUCCESS)
|
||||
{
|
||||
setState(retCode, "Failed to read flash size during initial connect.\n");
|
||||
return retCode;
|
||||
}
|
||||
//
|
||||
// Read device ram size
|
||||
//
|
||||
if ((retCode = readRamSize(&tmp)) != SBL_SUCCESS)
|
||||
{
|
||||
setState(retCode, "Failed to read RAM size during initial connect.\n");
|
||||
return retCode;
|
||||
}
|
||||
return SBL_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
/** \brief Send auto baud.
|
||||
*
|
||||
* \param[out] bBaudSetOk
|
||||
* True if response is ACK, false otherwise
|
||||
*
|
||||
* \return
|
||||
* Returns SBL_SUCCESS, ...
|
||||
*/
|
||||
//-----------------------------------------------------------------------------
|
||||
uint32_t
|
||||
SblDevice::sendAutoBaud(bool &bBaudSetOk)
|
||||
{
|
||||
DEBUG_PRINT("\n");
|
||||
bBaudSetOk = false;
|
||||
//
|
||||
// Send 0x55 0x55 and expect ACK
|
||||
//
|
||||
char pData[2];
|
||||
memset(pData, 0x55, 2);
|
||||
if (m_pCom->writeBytes(pData, 2) != 2)
|
||||
{
|
||||
setState(SBL_PORT_ERROR, "Communication initialization failed. Failed to send data.\n");
|
||||
return SBL_PORT_ERROR;
|
||||
}
|
||||
|
||||
if (getCmdResponse(bBaudSetOk, 2, true) != SBL_SUCCESS)
|
||||
{
|
||||
// No response received. Invalid baud rate?
|
||||
setState(SBL_PORT_ERROR, "No response from device. Device may not be in bootloader mode. Reset device and try again.\nIf problem persists, check connection and baud rate.\n");
|
||||
return SBL_PORT_ERROR;
|
||||
}
|
||||
|
||||
return SBL_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
/** \brief Get ACK/NAK from the boot loader.
|
||||
*
|
||||
* \param[out] bAck
|
||||
* True if response is ACK, false if response is NAK.
|
||||
* \param[in] ui32MaxRetries (optional)
|
||||
* How many times ComPort::readBytes() can time out before fail is issued.
|
||||
* \param[in] bQuietTimeout (optional)
|
||||
* Do not set error if no command response is received.
|
||||
*
|
||||
* \return
|
||||
* Returns SBL_SUCCESS, ...
|
||||
*/
|
||||
//-----------------------------------------------------------------------------
|
||||
uint32_t
|
||||
SblDevice::getCmdResponse(bool &bAck,
|
||||
uint32_t ui32MaxRetries/* = SBL_DEFAULT_RETRY_COUNT*/,
|
||||
bool bQuietTimeout/* = false*/)
|
||||
{
|
||||
DEBUG_PRINT("\n");
|
||||
unsigned char pIn[2];
|
||||
memset(pIn, 0, 2);
|
||||
uint32_t numBytes = 0;
|
||||
uint32_t retry = 0;
|
||||
bAck = false;
|
||||
uint32_t bytesRecv = 0;
|
||||
|
||||
//
|
||||
// Expect 2 bytes (ACK or NAK)
|
||||
//
|
||||
do
|
||||
{
|
||||
numBytes = m_pCom->readBytes(pIn, 2);
|
||||
bytesRecv += numBytes;
|
||||
retry++;
|
||||
} while ((bytesRecv < 2) && (retry < ui32MaxRetries));
|
||||
|
||||
if (bytesRecv < 2)
|
||||
{
|
||||
if (!bQuietTimeout) setState(SBL_TIMEOUT_ERROR, "Timed out waiting for ACK/NAK. No response from device.\n");
|
||||
return SBL_TIMEOUT_ERROR;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (pIn[0] == 0x00 && pIn[1] == 0xCC)
|
||||
{
|
||||
bAck = true;
|
||||
return setState(SBL_SUCCESS);
|
||||
}
|
||||
else if (pIn[0] == 0x00 && pIn[1] == 0x33)
|
||||
{
|
||||
return setState(SBL_SUCCESS);
|
||||
}
|
||||
else
|
||||
{
|
||||
setState(SBL_ERROR, "ACK/NAK not received. Expected 0x00 0xCC or 0x00 0x33, received 0x%02X 0x%02X. bytesRecv=%d\n", pIn[0], pIn[1], bytesRecv);
|
||||
return SBL_ERROR;
|
||||
}
|
||||
}
|
||||
return SBL_ERROR;
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
/** \brief Send command response (ACK/NAK).
|
||||
*
|
||||
* \param[in] bAck
|
||||
* True if response is ACK, false if response is NAK.
|
||||
* \return
|
||||
* Returns SBL_SUCCESS, ...
|
||||
*/
|
||||
//-----------------------------------------------------------------------------
|
||||
uint32_t
|
||||
SblDevice::sendCmdResponse(bool bAck)
|
||||
{
|
||||
DEBUG_PRINT("\n");
|
||||
//
|
||||
// Send response
|
||||
//
|
||||
char pData[2];
|
||||
pData[0] = 0x00;
|
||||
pData[1] = (bAck) ? 0xCC : 0x33;
|
||||
|
||||
if (m_pCom->writeBytes(pData, 2) != 2)
|
||||
{
|
||||
setState(SBL_PORT_ERROR, "Failed to send ACK/NAK response over %s\n",
|
||||
m_csComPort.c_str());
|
||||
return SBL_PORT_ERROR;
|
||||
}
|
||||
return SBL_SUCCESS;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
/** \brief Get response data from device.
|
||||
*
|
||||
* \param[out] pcData
|
||||
* Pointer to where received data will be stored.
|
||||
* \param[in|out] ui32MaxLen
|
||||
* Max number of bytes that can be received. Is populated with the actual
|
||||
* number of bytes received.
|
||||
* \param[in] ui32MaxRetries (optional)
|
||||
* How many times ComPort::readBytes() can time out before fail is issued.
|
||||
* \return
|
||||
* Returns SBL_SUCCESS, ...
|
||||
*/
|
||||
//-----------------------------------------------------------------------------
|
||||
uint32_t
|
||||
SblDevice::getResponseData(char *pcData, uint32_t &ui32MaxLen,
|
||||
uint32_t ui32MaxRetries/* = SBL_DEFAULT_RETRY_COUNT*/)
|
||||
{
|
||||
DEBUG_PRINT("\n");
|
||||
uint32_t numBytes = 0;
|
||||
uint32_t retry = 0;
|
||||
unsigned char pcHdr[2];
|
||||
uint32_t numPayloadBytes;
|
||||
uint8_t hdrChecksum, dataChecksum;
|
||||
uint32_t bytesRecv = 0;
|
||||
|
||||
setState(SBL_SUCCESS);
|
||||
//
|
||||
// Read length and checksum
|
||||
//
|
||||
memset(pcHdr, 0, 2);
|
||||
do
|
||||
{
|
||||
bytesRecv += m_pCom->readBytes(&pcHdr[bytesRecv], (2 - bytesRecv));
|
||||
retry++;
|
||||
} while ((bytesRecv < 2) && retry < ui32MaxRetries);
|
||||
|
||||
//
|
||||
// Check that we've received 2 bytes
|
||||
//
|
||||
if (bytesRecv < 2)
|
||||
{
|
||||
setState(SBL_TIMEOUT_ERROR, "Timed out waiting for data header from device.\n");
|
||||
return SBL_TIMEOUT_ERROR;
|
||||
}
|
||||
numPayloadBytes = pcHdr[0] - 2;
|
||||
hdrChecksum = pcHdr[1];
|
||||
|
||||
//
|
||||
// Check if length byte is too long.
|
||||
//
|
||||
if (numPayloadBytes > ui32MaxLen)
|
||||
{
|
||||
setState(SBL_ERROR, "Error: Device sending more data than expected. \nMax expected was %d, sent was %d.\n", (uint32_t)ui32MaxLen, (numPayloadBytes + 2));
|
||||
#if 1
|
||||
m_pCom->flushReceiver();
|
||||
#endif
|
||||
return SBL_ERROR;
|
||||
}
|
||||
|
||||
//
|
||||
// Read the payload data
|
||||
//
|
||||
bytesRecv = 0;
|
||||
do
|
||||
{
|
||||
bytesRecv += m_pCom->readBytes(&pcData[bytesRecv], (numPayloadBytes - bytesRecv));
|
||||
retry++;
|
||||
} while (bytesRecv < numPayloadBytes && retry < ui32MaxRetries);
|
||||
|
||||
//
|
||||
// Have we received what we expected?
|
||||
//
|
||||
if (bytesRecv < numPayloadBytes)
|
||||
{
|
||||
ui32MaxLen = bytesRecv;
|
||||
setState(SBL_TIMEOUT_ERROR, "Timed out waiting for data from device.\n");
|
||||
return SBL_TIMEOUT_ERROR;
|
||||
}
|
||||
|
||||
//
|
||||
// Verify data checksum
|
||||
//
|
||||
dataChecksum = generateCheckSum(0, pcData, numPayloadBytes);
|
||||
if (dataChecksum != hdrChecksum)
|
||||
{
|
||||
setState(SBL_ERROR, "Checksum verification error. Expected 0x%02X, got 0x%02X.\n", hdrChecksum, dataChecksum);
|
||||
return SBL_ERROR;
|
||||
}
|
||||
|
||||
ui32MaxLen = bytesRecv;
|
||||
return SBL_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
/** \brief Are we connected to the device?
|
||||
*
|
||||
* \return
|
||||
* Returns true if connected to device.
|
||||
* Returns false if not connected to device.
|
||||
*/
|
||||
//-----------------------------------------------------------------------------
|
||||
bool
|
||||
SblDevice::isConnected()
|
||||
{
|
||||
DEBUG_PRINT("\n");
|
||||
if (!m_pCom)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
/** \brief This function generates the bootloader protocol checksum.
|
||||
*
|
||||
* \param[in] ui32Cmd
|
||||
* The bootloader command
|
||||
* \param[in] pcData
|
||||
* Pointer to the command data.
|
||||
* \param[in] ui32DataLen
|
||||
* Data length in bytes.
|
||||
*
|
||||
* \return
|
||||
* Returns the generated checksum.
|
||||
*/
|
||||
//-----------------------------------------------------------------------------
|
||||
uint8_t
|
||||
SblDevice::generateCheckSum(uint32_t ui32Cmd, const char *pcData,
|
||||
uint32_t ui32DataLen)
|
||||
{
|
||||
DEBUG_PRINT("\n");
|
||||
uint8_t ui8CheckSum = (uint8_t)ui32Cmd;
|
||||
for (uint32_t i = 0; i < ui32DataLen; i++)
|
||||
{
|
||||
ui8CheckSum += pcData[i];
|
||||
}
|
||||
return ui8CheckSum;
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
/** \brief This function sets the SBL status and the SBL error string.
|
||||
*
|
||||
* \param[in] ui32Status
|
||||
* The new SBL status. SBL_SUCCESS, SBL_ERROR, ...
|
||||
* \param[in] pcFormat
|
||||
* 'printf' like format string.
|
||||
* \param[in] ...
|
||||
* Input variables to the \e pcFormat string.
|
||||
*
|
||||
* \return
|
||||
* Returns SBL_SUCCESS, ...
|
||||
*/
|
||||
//-----------------------------------------------------------------------------
|
||||
uint32_t
|
||||
SblDevice::setState(const uint32_t &ui32Status, char *pcFormat, ...)
|
||||
{
|
||||
DEBUG_PRINT("\n");
|
||||
va_list args;
|
||||
char text[2048];
|
||||
|
||||
m_lastSblStatus = ui32Status;
|
||||
|
||||
// Attempt to do a sanity check. Not possible to say how long
|
||||
// the formatted text will be, but if we reserve half the space for
|
||||
// formatted arguments it should be sufficient.
|
||||
if (strlen(pcFormat) > 2048 / 2) {
|
||||
return SBL_ERROR;
|
||||
}
|
||||
|
||||
va_start(args, pcFormat);
|
||||
#if 0
|
||||
vsprintf_s(text, pcFormat, args);
|
||||
#else
|
||||
vsprintf(text, pcFormat, args);
|
||||
#endif
|
||||
sm_csLastError = text;
|
||||
va_end(args);
|
||||
|
||||
if (SblDevice::sm_pStatusFunction != NULL)
|
||||
{
|
||||
bool error = (m_lastSblStatus == SBL_SUCCESS) ? false : true;
|
||||
sm_pStatusFunction((char *)sm_csLastError.c_str(), error);
|
||||
}
|
||||
|
||||
return SBL_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
/** \brief Utility function for converting 4 elements in char array into
|
||||
* 32 bit variable. Data are converted MSB, that is. \e pcSrc[0] is the
|
||||
* most significant byte.
|
||||
*
|
||||
* \param pcSrc[in]
|
||||
* A pointer to the source array.
|
||||
*
|
||||
* \return
|
||||
* Returns the 32 bit variable.
|
||||
*/
|
||||
//-----------------------------------------------------------------------------
|
||||
/*static */uint32_t
|
||||
SblDevice::charArrayToUL(const char *pcSrc)
|
||||
{
|
||||
DEBUG_PRINT("\n");
|
||||
uint32_t ui32Val = (unsigned char)pcSrc[3];
|
||||
ui32Val += (((unsigned long)pcSrc[2]) & 0xFF) << 8;
|
||||
ui32Val += (((unsigned long)pcSrc[1]) & 0xFF) << 16;
|
||||
ui32Val += (((unsigned long)pcSrc[0]) & 0xFF) << 24;
|
||||
return (ui32Val);
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
/** \brief Utility function for splitting 32 bit variable into char array
|
||||
* (4 elements). Data are converted MSB, that is, \e pcDst[0] is the
|
||||
* most significant byte.
|
||||
*
|
||||
* \param[in] ui32Src
|
||||
* The 32 bit variable to convert.
|
||||
*
|
||||
* \param[out] pcDst
|
||||
* Pointer to the char array where the data will be stored.
|
||||
*
|
||||
* \return
|
||||
* void
|
||||
*/
|
||||
//-----------------------------------------------------------------------------
|
||||
/*static */void
|
||||
SblDevice::ulToCharArray(const uint32_t ui32Src, char *pcDst)
|
||||
{
|
||||
DEBUG_PRINT("\n");
|
||||
// MSB first
|
||||
pcDst[0] = (uint8_t)(ui32Src >> 24);
|
||||
pcDst[1] = (uint8_t)(ui32Src >> 16);
|
||||
pcDst[2] = (uint8_t)(ui32Src >> 8);
|
||||
pcDst[3] = (uint8_t)(ui32Src >> 0);
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
/** \brief Utility function for swapping the byte order of a 4B char array.
|
||||
*
|
||||
* \param[in|out] pcArray
|
||||
* The char array to byte swap.
|
||||
*
|
||||
* \return
|
||||
* void
|
||||
*/
|
||||
//-----------------------------------------------------------------------------
|
||||
/*static */void
|
||||
SblDevice::byteSwap(char *pcArray)
|
||||
{
|
||||
DEBUG_PRINT("\n");
|
||||
uint8_t tmp[2] = { (uint8_t)pcArray[0], (uint8_t)pcArray[1] };
|
||||
pcArray[0] = pcArray[3];
|
||||
pcArray[1] = pcArray[2];
|
||||
pcArray[2] = tmp[1];
|
||||
pcArray[3] = tmp[0];
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
/** \brief This functions sets the SBL progress.
|
||||
*
|
||||
* \param[in] ui32Progress
|
||||
* The current progress, typically in percent [0-100].
|
||||
*
|
||||
* \return
|
||||
* void
|
||||
*/
|
||||
//-----------------------------------------------------------------------------
|
||||
/*static*/uint32_t
|
||||
SblDevice::setProgress(uint32_t ui32Progress)
|
||||
{
|
||||
DEBUG_PRINT("\n");
|
||||
if (sm_pProgressFunction)
|
||||
{
|
||||
sm_pProgressFunction(ui32Progress);
|
||||
}
|
||||
|
||||
sm_progress = ui32Progress;
|
||||
|
||||
return SBL_SUCCESS;
|
||||
}
|
||||
143
feeds/bluetooth-cc2652/cc2652/src/sbl_device.h
Executable file
143
feeds/bluetooth-cc2652/cc2652/src/sbl_device.h
Executable file
@@ -0,0 +1,143 @@
|
||||
#ifndef __SBL_DEVICE_H__
|
||||
#define __SBL_DEVICE_H__
|
||||
/******************************************************************************
|
||||
* Filename: sbl_device.h
|
||||
* Revised: $Date$
|
||||
* Revision: $Revision$
|
||||
*
|
||||
* Description: Serial Bootloader device header file.
|
||||
*
|
||||
* Copyright (C) 2014 Texas Instruments Incorporated - http://www.ti.com/
|
||||
*
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* Neither the name of Texas Instruments Incorporated nor the names of
|
||||
* its contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
******************************************************************************/
|
||||
#include "serialib.h"
|
||||
//
|
||||
// Typedefs for callback functions to report status and progress to application
|
||||
//
|
||||
typedef void (*tStatusFPTR)(char *pcText, bool bError);
|
||||
typedef void (*tProgressFPTR)(uint32_t ui32Value);
|
||||
|
||||
class SblDevice
|
||||
{
|
||||
public:
|
||||
// Constructor
|
||||
~SblDevice();
|
||||
|
||||
// Static functions
|
||||
static SblDevice *Create(uint32_t ui32ChipType);
|
||||
virtual uint32_t connect(std::string csPortNum, uint32_t ui32BaudRate, bool bEnableXosc = false);
|
||||
virtual uint32_t ping() = 0;
|
||||
virtual uint32_t readStatus(uint32_t *pui32Status) = 0;
|
||||
virtual uint32_t readDeviceId(uint32_t *pui32DeviceId) = 0;
|
||||
virtual uint32_t readFlashSize(uint32_t *pui32FlashSize) = 0;
|
||||
virtual uint32_t readRamSize(uint32_t *pui32RamSize) = 0;
|
||||
virtual uint32_t run(uint32_t ui32Address) { (void)ui32Address; return SBL_UNSUPPORTED_FUNCTION; };
|
||||
virtual uint32_t reset() = 0;
|
||||
virtual uint32_t eraseFlashRange(uint32_t ui32StartAddress, uint32_t ui32ByteCount) { (void)ui32StartAddress; (void)ui32ByteCount; return 0; };
|
||||
virtual uint32_t writeFlashRange(uint32_t ui32StartAddress, uint32_t ui32ByteCount, const char *pcData) { (void)ui32StartAddress; (void)ui32ByteCount; (void)pcData; return 0; };
|
||||
virtual uint32_t readMemory32(uint32_t ui32StartAddress, uint32_t ui32UnitCount, uint32_t *pui32Data) = 0;
|
||||
virtual uint32_t readMemory8(uint32_t ui32StartAddress, uint32_t ui32UnitCount, char *pcData) = 0;
|
||||
virtual uint32_t writeMemory32(uint32_t ui32StartAddress, uint32_t ui32UnitCount, const uint32_t *pui32Data) = 0;
|
||||
virtual uint32_t writeMemory8(uint32_t ui32StartAddress, uint32_t ui32UnitCount, const char *pcData) = 0;
|
||||
virtual uint32_t calculateCrc32(uint32_t ui32StartAddress, uint32_t ui32ByteCount, uint32_t *pui32Crc) = 0;
|
||||
|
||||
// CC2650 specific
|
||||
virtual uint32_t eraseFlashBank(){ return SBL_UNSUPPORTED_FUNCTION; };
|
||||
virtual uint32_t setCCFG(uint32_t ui32Field, uint32_t ui32FieldValue) { (void)ui32Field; (void)ui32FieldValue; return SBL_UNSUPPORTED_FUNCTION; };
|
||||
|
||||
// CC2538 specific
|
||||
virtual uint32_t setXosc() { return SBL_UNSUPPORTED_FUNCTION; };
|
||||
|
||||
// Utility functions
|
||||
bool isConnected();
|
||||
uint32_t getDeviceId() { return m_deviceId; }
|
||||
uint32_t getFlashSize() { return m_flashSize; }
|
||||
uint32_t getRamSize() { return m_ramSize; }
|
||||
uint32_t getBaudRate() { return m_baudRate; }
|
||||
uint32_t getLastStatus() {return m_lastSblStatus; }
|
||||
uint32_t getLastDeviceStatus() { return m_lastDeviceStatus; }
|
||||
uint32_t getPageEraseSize() { return m_pageEraseSize; }
|
||||
static std::string &getLastError(void) { return sm_csLastError;}
|
||||
static uint32_t getProgress() { return sm_progress; }
|
||||
static uint32_t setProgress(uint32_t ui32Progress);
|
||||
static void setCallBackStatusFunction(tStatusFPTR pSf) {sm_pStatusFunction = pSf; }
|
||||
static void setCallBackProgressFunction(tProgressFPTR pPf) {sm_pProgressFunction = pPf; }
|
||||
|
||||
protected:
|
||||
// Constructor
|
||||
SblDevice();
|
||||
|
||||
virtual uint32_t initCommunication(bool bSetXosc) = 0;
|
||||
virtual uint32_t sendCmd(uint32_t ui32Cmd, const char *pcSendData = NULL, uint32_t ui32SendLen = 0) = 0;
|
||||
virtual uint32_t sendAutoBaud(bool &bBaudSetOk);
|
||||
virtual uint32_t getCmdResponse(bool &bAck, uint32_t ui32MaxRetries = SBL_DEFAULT_RETRY_COUNT, bool bQuiet = false);
|
||||
virtual uint32_t sendCmdResponse(bool bAck);
|
||||
virtual uint32_t getResponseData(char *pcData, uint32_t &ui32MaxLen, uint32_t ui32MaxRetries = SBL_DEFAULT_RETRY_COUNT);
|
||||
|
||||
virtual uint8_t generateCheckSum(uint32_t ui32Cmd, const char *pcData, uint32_t ui32DataLen);
|
||||
virtual uint32_t addressToPage(uint32_t ui32Address) = 0;
|
||||
virtual bool addressInRam(uint32_t ui32StartAddress, uint32_t ui32ByteCount = 1) = 0;
|
||||
virtual bool addressInFlash(uint32_t ui32StartAddress, uint32_t ui32ByteCount = 1) = 0;
|
||||
|
||||
virtual uint32_t getBootloaderEnableAddress() = 0;
|
||||
|
||||
uint32_t setState(const uint32_t &ui32Status) { m_lastSblStatus = ui32Status; return m_lastSblStatus;}
|
||||
uint32_t setState(const uint32_t &ui32Status, char *pcFormat, ...);
|
||||
|
||||
// Utility
|
||||
static uint32_t charArrayToUL(const char *pcSrc);
|
||||
static void ulToCharArray(const uint32_t ui32Src, char *pcDst);
|
||||
static void byteSwap(char *pcArray);
|
||||
|
||||
serialib *m_pCom;
|
||||
std::string m_csComPort;
|
||||
bool m_bCommInitialized;
|
||||
uint32_t m_baudRate;
|
||||
|
||||
static uint32_t sm_chipType;
|
||||
uint32_t m_deviceId;
|
||||
uint32_t m_flashSize;
|
||||
uint32_t m_ramSize;
|
||||
uint32_t m_pageEraseSize;
|
||||
|
||||
// Status and progress variables
|
||||
int32_t m_lastDeviceStatus;
|
||||
int32_t m_lastSblStatus;
|
||||
static uint32_t sm_progress;
|
||||
static std::string sm_csLastError;
|
||||
static tProgressFPTR sm_pProgressFunction;
|
||||
static tStatusFPTR sm_pStatusFunction;
|
||||
|
||||
private:
|
||||
|
||||
};
|
||||
|
||||
#endif // __SBL_DEVICE_H__
|
||||
1762
feeds/bluetooth-cc2652/cc2652/src/sbl_device_cc2538.cpp
Executable file
1762
feeds/bluetooth-cc2652/cc2652/src/sbl_device_cc2538.cpp
Executable file
File diff suppressed because it is too large
Load Diff
126
feeds/bluetooth-cc2652/cc2652/src/sbl_device_cc2538.h
Executable file
126
feeds/bluetooth-cc2652/cc2652/src/sbl_device_cc2538.h
Executable file
@@ -0,0 +1,126 @@
|
||||
#ifndef __SBL_DEVICE_CC2538_H__
|
||||
#define __SBL_DEVICE_CC2538_H__
|
||||
/******************************************************************************
|
||||
* Filename: sbl_device_cc2538.h
|
||||
* Revised: $Date$
|
||||
* Revision: $Revision$
|
||||
*
|
||||
* Description: Serial Bootloader for CC2538 header file.
|
||||
*
|
||||
* Copyright (C) 2014 Texas Instruments Incorporated - http://www.ti.com/
|
||||
*
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* Neither the name of Texas Instruments Incorporated nor the names of
|
||||
* its contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
******************************************************************************/
|
||||
#include <sbl_device.h>
|
||||
|
||||
//
|
||||
// For more information about the CC2538 serial bootloader interface,
|
||||
// please refer to the CC2538 ROM User's guide (http://www.ti.com/lit/swru333)
|
||||
//
|
||||
|
||||
#define SBL_CC2538_PAGE_ERASE_SIZE 2048
|
||||
#define SBL_CC2538_FLASH_START_ADDRESS 0x00200000
|
||||
#define SBL_CC2538_RAM_START_ADDRESS 0x20000000
|
||||
#define SBL_CC2538_ACCESS_WIDTH_4B 4
|
||||
#define SBL_CC2538_ACCESS_WIDTH_1B 1
|
||||
#define SBL_CC2538_PAGE_ERASE_TIME_MS 20
|
||||
#define SBL_CC2538_MAX_BYTES_PER_TRANSFER 252
|
||||
#define SBL_CC2538_DIECFG0 0x400D3014
|
||||
#define SBL_CC2538_BL_CONFIG_PAGE_OFFSET 2007
|
||||
#define SBL_CC2538_BL_CONFIG_ENABLED_BM 0x10
|
||||
|
||||
class SblDeviceCC2538 : public SblDevice
|
||||
{
|
||||
public:
|
||||
SblDeviceCC2538(); // Constructor
|
||||
~SblDeviceCC2538(); // Destructor
|
||||
|
||||
enum {
|
||||
CMD_PING = 0x20,
|
||||
CMD_DOWNLOAD = 0x21,
|
||||
CMD_RUN = 0x22,
|
||||
CMD_GET_STATUS = 0x23,
|
||||
CMD_SEND_DATA = 0x24,
|
||||
CMD_RESET = 0x25,
|
||||
CMD_ERASE = 0x26,
|
||||
CMD_CRC32 = 0x27,
|
||||
CMD_GET_CHIP_ID = 0x28,
|
||||
CMD_SET_XOSC = 0x29,
|
||||
CMD_MEMORY_READ = 0x2A,
|
||||
CMD_MEMORY_WRITE = 0x2B,
|
||||
};
|
||||
|
||||
enum {
|
||||
CMD_RET_SUCCESS = 0x40,
|
||||
CMD_RET_UNKNOWN_CMD = 0x41,
|
||||
CMD_RET_INVALID_CMD = 0x42,
|
||||
CMD_RET_INVALID_ADR = 0x43,
|
||||
CMD_RET_FLASH_FAIL = 0x44,
|
||||
};
|
||||
|
||||
protected:
|
||||
|
||||
// Virtual functions from SblDevice
|
||||
uint32_t ping();
|
||||
|
||||
uint32_t readStatus(uint32_t *pui32Status);
|
||||
uint32_t readDeviceId(uint32_t *pui32DeviceId);
|
||||
uint32_t readFlashSize(uint32_t *pui32FlashSize);
|
||||
uint32_t readRamSize(uint32_t *pui32RamSize);
|
||||
|
||||
uint32_t run(uint32_t ui32Address);
|
||||
uint32_t reset();
|
||||
uint32_t eraseFlashRange(uint32_t ui32StartAddress, uint32_t ui32ByteCount);
|
||||
uint32_t writeFlashRange(uint32_t ui32StartAddress, uint32_t ui32ByteCount, const char *pcData);
|
||||
uint32_t readMemory32(uint32_t ui32StartAddress, uint32_t ui32UnitCount, uint32_t *pui32Data);
|
||||
uint32_t readMemory8(uint32_t ui32StartAddress, uint32_t ui32UnitCount, char *pcData);
|
||||
uint32_t writeMemory32(uint32_t ui32StartAddress, uint32_t ui32UnitCount, const uint32_t *pui32Data);
|
||||
uint32_t writeMemory8(uint32_t ui32StartAddress, uint32_t ui32UnitCount, const char *pcData);
|
||||
|
||||
uint32_t calculateCrc32(uint32_t ui32StartAddress, uint32_t ui32ByteCount, uint32_t *pui32Crc);
|
||||
|
||||
uint32_t sendCmd(uint32_t ui32Cmd, const char *pcSendData = NULL, uint32_t ui32SendLen = 0);
|
||||
uint32_t addressToPage(uint32_t ui32Address);
|
||||
bool addressInRam(uint32_t ui32StartAddress, uint32_t ui32ByteCount = 1);
|
||||
bool addressInFlash(uint32_t ui32StartAddress, uint32_t ui32ByteCount = 1);
|
||||
uint32_t setXosc();
|
||||
|
||||
private:
|
||||
uint32_t initCommunication(bool bSetXosc);
|
||||
uint32_t cmdDownload(uint32_t ui32Address, uint32_t ui32Size);
|
||||
uint32_t cmdSendData(const char *pcData, uint32_t ui32ByteCount);
|
||||
|
||||
uint32_t getBootloaderEnableAddress();
|
||||
|
||||
std::string getCmdString(uint32_t ui32Cmd);
|
||||
std::string getCmdStatusString(uint32_t ui32Status);
|
||||
};
|
||||
|
||||
#endif // __SBL_DEVICE_CC2538_H__
|
||||
1903
feeds/bluetooth-cc2652/cc2652/src/sbl_device_cc2650.cpp
Executable file
1903
feeds/bluetooth-cc2652/cc2652/src/sbl_device_cc2650.cpp
Executable file
File diff suppressed because it is too large
Load Diff
153
feeds/bluetooth-cc2652/cc2652/src/sbl_device_cc2650.h
Executable file
153
feeds/bluetooth-cc2652/cc2652/src/sbl_device_cc2650.h
Executable file
@@ -0,0 +1,153 @@
|
||||
#ifndef __SBL_DEVICE_CC2650_H__
|
||||
#define __SBL_DEVICE_CC2650_H__
|
||||
/******************************************************************************
|
||||
* Filename: sbl_device_cc2650.h
|
||||
* Revised: $Date: 2013-07-26 09:53:42 +0200 (fr, 26 jul 2013) $
|
||||
* Revision: $Revision: 26971 $
|
||||
*
|
||||
* Description: Serial Bootloader for CC2650 header file.
|
||||
*
|
||||
* Copyright (C) 2014 Texas Instruments Incorporated - http://www.ti.com/
|
||||
*
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* Neither the name of Texas Instruments Incorporated nor the names of
|
||||
* its contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
******************************************************************************/
|
||||
#include <sbl_device.h>
|
||||
|
||||
|
||||
#define SBL_CC2650_PAGE_ERASE_SIZE 4096
|
||||
#define SBL_CC2650_FLASH_START_ADDRESS 0x00000000
|
||||
#define SBL_CC2650_RAM_START_ADDRESS 0x20000000
|
||||
#define SBL_CC2650_ACCESS_WIDTH_32B 1
|
||||
#define SBL_CC2650_ACCESS_WIDTH_8B 0
|
||||
#define SBL_CC2650_PAGE_ERASE_TIME_MS 20
|
||||
#define SBL_CC2650_MAX_BYTES_PER_TRANSFER 252
|
||||
#define SBL_CC2650_MAX_MEMWRITE_BYTES 247
|
||||
#define SBL_CC2650_MAX_MEMWRITE_WORDS 61
|
||||
#define SBL_CC2650_MAX_MEMREAD_BYTES 253
|
||||
#define SBL_CC2650_MAX_MEMREAD_WORDS 63
|
||||
#define SBL_CC2650_FLASH_SIZE_CFG 0x4003002C
|
||||
#define SBL_CC2650_RAM_SIZE_CFG 0x40082250
|
||||
#define SBL_CC2650_BL_CONFIG_PAGE_OFFSET 0xFDB
|
||||
#define SBL_CC2650_BL_CONFIG_ENABLED_BM 0xC5
|
||||
#define SBL_CC2650_BL_WORK_MEMORY_START 0x20000000
|
||||
#define SBL_CC2650_BL_WORK_MEMORY_END 0x2000016F
|
||||
#define SBL_CC2650_BL_STACK_MEMORY_START 0x20000FC0
|
||||
#define SBL_CC2650_BL_STACK_MEMORY_END 0x20000FFF
|
||||
|
||||
class SblDeviceCC2650 : public SblDevice
|
||||
{
|
||||
public:
|
||||
SblDeviceCC2650(); // Constructor
|
||||
~SblDeviceCC2650(); // Destructor
|
||||
|
||||
enum {
|
||||
CMD_PING = 0x20,
|
||||
CMD_DOWNLOAD = 0x21,
|
||||
CMD_GET_STATUS = 0x23,
|
||||
CMD_SEND_DATA = 0x24,
|
||||
CMD_RESET = 0x25,
|
||||
CMD_SECTOR_ERASE = 0x26,
|
||||
CMD_CRC32 = 0x27,
|
||||
CMD_GET_CHIP_ID = 0x28,
|
||||
CMD_MEMORY_READ = 0x2A,
|
||||
CMD_MEMORY_WRITE = 0x2B,
|
||||
CMD_BANK_ERASE = 0x2C,
|
||||
CMD_SET_CCFG = 0x2D,
|
||||
};
|
||||
|
||||
/* Early samples had different command IDs */
|
||||
enum
|
||||
{
|
||||
REV1_CMD_BANK_ERASE = 0x2A,
|
||||
REV1_CMD_SET_CCFG = 0x2B,
|
||||
REV1_CMD_MEMORY_READ = 0x2C,
|
||||
REV1_CMD_MEMORY_WRITE = 0x2D,
|
||||
};
|
||||
|
||||
enum {
|
||||
CMD_RET_SUCCESS = 0x40,
|
||||
CMD_RET_UNKNOWN_CMD = 0x41,
|
||||
CMD_RET_INVALID_CMD = 0x42,
|
||||
CMD_RET_INVALID_ADR = 0x43,
|
||||
CMD_RET_FLASH_FAIL = 0x44,
|
||||
};
|
||||
|
||||
protected:
|
||||
|
||||
// Virtual functions from SblDevice
|
||||
uint32_t ping();
|
||||
|
||||
uint32_t readStatus(uint32_t *pui32Status);
|
||||
uint32_t readDeviceId(uint32_t *pui32DeviceId);
|
||||
virtual uint32_t readFlashSize(uint32_t *pui32FlashSize);
|
||||
virtual uint32_t readRamSize(uint32_t *pui32RamSize);
|
||||
|
||||
uint32_t reset();
|
||||
uint32_t eraseFlashRange(uint32_t ui32StartAddress, uint32_t ui32ByteCount);
|
||||
uint32_t writeFlashRange(uint32_t ui32StartAddress, uint32_t ui32ByteCount, const char *pcData);
|
||||
|
||||
|
||||
uint32_t readMemory32(uint32_t ui32StartAddress, uint32_t ui32UnitCount, uint32_t *pui32Data);
|
||||
uint32_t readMemory8(uint32_t ui32StartAddress, uint32_t ui32UnitCount, char *pcData);
|
||||
uint32_t writeMemory32(uint32_t ui32StartAddress, uint32_t ui32UnitCount, const uint32_t *pui32Data);
|
||||
uint32_t writeMemory8(uint32_t ui32StartAddress, uint32_t ui32UnitCount, const char *pcData);
|
||||
|
||||
uint32_t calculateCrc32(uint32_t ui32StartAddress, uint32_t ui32ByteCount, uint32_t *pui32Crc);
|
||||
|
||||
uint32_t sendCmd(uint32_t ui32Cmd, const char *pcSendData = NULL, uint32_t ui32SendLen = 0);
|
||||
std::string getCmdString(uint32_t ui32Cmd);
|
||||
uint32_t addressToPage(uint32_t ui32Address);
|
||||
bool addressInRam(uint32_t ui32StartAddress, uint32_t ui32ByteCount = 1);
|
||||
bool addressInFlash(uint32_t ui32StartAddress, uint32_t ui32ByteCount = 1);
|
||||
|
||||
uint32_t convertCmdForEarlySamples(uint32_t ui32Cmd);
|
||||
|
||||
virtual uint32_t getBootloaderEnableAddress();
|
||||
|
||||
// CC2650 specific
|
||||
uint32_t eraseFlashBank();
|
||||
uint32_t setCCFG(uint32_t ui32Field, uint32_t ui32FieldValue);
|
||||
|
||||
// Device revision. Used internally by SBL to handle early samples with different command IDs.
|
||||
uint32_t m_deviceRev;
|
||||
private:
|
||||
uint32_t initCommunication(bool bSetXosc);
|
||||
uint32_t cmdDownload(uint32_t ui32Address, uint32_t ui32Size);
|
||||
uint32_t cmdSendData(const char *pcData, uint32_t ui32ByteCount);
|
||||
|
||||
std::string getCmdStatusString(uint32_t ui32Status);
|
||||
|
||||
bool addressInBLWorkMemory(uint32_t ui32StartAddr, uint32_t ui32ByteCount = 1);
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
#endif // __SBL_DEVICE_CC2650_H__
|
||||
330
feeds/bluetooth-cc2652/cc2652/src/sbl_device_cc2652.cpp
Executable file
330
feeds/bluetooth-cc2652/cc2652/src/sbl_device_cc2652.cpp
Executable file
@@ -0,0 +1,330 @@
|
||||
/******************************************************************************
|
||||
* Filename: sbl_device_cc2652.cpp
|
||||
* Revised: $Date$
|
||||
* Revision: $Revision$
|
||||
*
|
||||
* Description: Serial Bootloader device file for CC13x2/CC26x2
|
||||
*
|
||||
* Copyright (C) 2018 Texas Instruments Incorporated - http://www.ti.com/
|
||||
*
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* Neither the name of Texas Instruments Incorporated nor the names of
|
||||
* its contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
#include <sbllib.h>
|
||||
#include "sbl_device.h"
|
||||
#include "sbl_device_cc2652.h"
|
||||
|
||||
#include "serialib.h"
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
/** \brief Constructor
|
||||
*/
|
||||
//-----------------------------------------------------------------------------
|
||||
SblDeviceCC2652::SblDeviceCC2652() : SblDeviceCC2650()
|
||||
{
|
||||
DEBUG_PRINT("\n");
|
||||
m_pageEraseSize = SBL_CC2652_PAGE_ERASE_SIZE;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
/** \brief Destructor
|
||||
*/
|
||||
//-----------------------------------------------------------------------------
|
||||
SblDeviceCC2652::~SblDeviceCC2652()
|
||||
{
|
||||
DEBUG_PRINT("\n");
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
/** \brief This function reads device FLASH size in bytes.
|
||||
*
|
||||
* \param[out] pui32FlashSize
|
||||
* Pointer to where FLASH size is stored.
|
||||
* \return
|
||||
* Returns SBL_SUCCESS, ...
|
||||
*/
|
||||
//-----------------------------------------------------------------------------
|
||||
uint32_t
|
||||
SblDeviceCC2652::readFlashSize(uint32_t *pui32FlashSize)
|
||||
{
|
||||
DEBUG_PRINT("\n");
|
||||
uint32_t retCode = SBL_SUCCESS;
|
||||
|
||||
//
|
||||
// Read CC2652 DIECFG0 (contains FLASH size information)
|
||||
//
|
||||
uint32_t addr = SBL_CC2652_FLASH_SIZE_CFG;
|
||||
uint32_t value;
|
||||
if ((retCode = readMemory32(addr, 1, &value)) != SBL_SUCCESS)
|
||||
{
|
||||
setState((tSblStatus)retCode, "Failed to read device FLASH size: %s", getLastError().c_str());
|
||||
return retCode;
|
||||
}
|
||||
|
||||
//
|
||||
// Calculate flash size (The number of flash sectors are at bits [7:0])
|
||||
//
|
||||
value &= 0xFF;
|
||||
*pui32FlashSize = value*SBL_CC2652_PAGE_ERASE_SIZE;
|
||||
|
||||
m_flashSize = *pui32FlashSize;
|
||||
|
||||
return SBL_SUCCESS;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
/** \brief This function reads device RAM size in bytes.
|
||||
*
|
||||
* \param[out] pui32RamSize
|
||||
* Pointer to where RAM size is stored.
|
||||
* \return
|
||||
* Returns SBL_SUCCESS, ...
|
||||
*/
|
||||
//-----------------------------------------------------------------------------
|
||||
uint32_t
|
||||
SblDeviceCC2652::readRamSize(uint32_t *pui32RamSize)
|
||||
{
|
||||
DEBUG_PRINT("\n");
|
||||
int retCode = SBL_SUCCESS;
|
||||
|
||||
uint32_t addr = SBL_CC2652_RAM_SIZE_CFG;
|
||||
uint32_t value;
|
||||
|
||||
if ((retCode = readMemory32(addr, 1, &value)) != SBL_SUCCESS)
|
||||
{
|
||||
setState(retCode, "Failed to read device RAM size: %s", getLastError().c_str());
|
||||
return retCode;
|
||||
}
|
||||
|
||||
uint32_t ramSizeInfo = (value & CHIP_SRAM_SIZE_INFO_M) >> CHIP_SRAM_SIZE_INFO_S;
|
||||
|
||||
m_ramSize = calculateRamSize(ramSizeInfo);
|
||||
|
||||
if (*pui32RamSize != NULL)
|
||||
{
|
||||
*pui32RamSize = m_ramSize;
|
||||
}
|
||||
|
||||
return retCode;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
/** \brief Calculate RAM size.
|
||||
*
|
||||
* \param[in] ramSizeInfo
|
||||
* Register value for RAM size configuration (TOP:PRCM:RAMHWOPT).
|
||||
* The argument is optional and the default value is 3 (RAM size 80 KB)
|
||||
* \returns uint32_t
|
||||
* Ram size
|
||||
*/
|
||||
//-----------------------------------------------------------------------------
|
||||
uint32_t SblDeviceCC2652::calculateRamSize(uint32_t ramSizeInfo)
|
||||
{
|
||||
DEBUG_PRINT("\n");
|
||||
uint32_t ramSize;
|
||||
|
||||
switch (ramSizeInfo)
|
||||
{
|
||||
case 0:
|
||||
ramSize = (32 * 1024);
|
||||
break;
|
||||
case 1:
|
||||
ramSize = (48 * 1024);
|
||||
break;
|
||||
case 2:
|
||||
ramSize = (64 * 1024);
|
||||
break;
|
||||
case 3:
|
||||
default:
|
||||
ramSize = (80 * 1024);
|
||||
break;
|
||||
}
|
||||
|
||||
return ramSize;
|
||||
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
/** \brief This function returns the FLASH address of the bootloader enable
|
||||
* configuration.
|
||||
*
|
||||
* \return
|
||||
* Returns true if the address/range is within the device RAM.
|
||||
*/
|
||||
//-----------------------------------------------------------------------------
|
||||
uint32_t SblDeviceCC2652::getBootloaderEnableAddress()
|
||||
{
|
||||
DEBUG_PRINT("\n");
|
||||
return SBL_CC2652_FLASH_START_ADDRESS + getFlashSize() - getPageEraseSize() + SBL_CC2652_BL_CONFIG_PAGE_OFFSET;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
/** \brief This function returns a string with the device command name of
|
||||
* \e ui32Cmd.
|
||||
*
|
||||
* \param[out] ui32Cmd
|
||||
* The serial bootloader command.
|
||||
* \return
|
||||
* Returns std::string with name of device command.
|
||||
*/
|
||||
//-----------------------------------------------------------------------------
|
||||
std::string
|
||||
SblDeviceCC2652::getCmdString(uint32_t ui32Cmd)
|
||||
{
|
||||
DEBUG_PRINT("\n");
|
||||
std::string cmd = SblDeviceCC2650::getCmdString(ui32Cmd);
|
||||
if (cmd.find("Unknown") != std::string::npos)
|
||||
{
|
||||
switch (ui32Cmd)
|
||||
{
|
||||
case SblDeviceCC2652::CMD_DOWNLOAD_CRC: cmd = "CMD_DOWNLOAD_CRC"; break;
|
||||
default: cmd = "Unknown command"; break;
|
||||
}
|
||||
}
|
||||
|
||||
return cmd;
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
/** \brief This function sends the CC2652 download CRC command and handles the
|
||||
* device response.
|
||||
*
|
||||
* \param[in] ui32Address
|
||||
* The start address in CC2652 flash.
|
||||
* \param[in] ui32Size
|
||||
* Number of bytes to be sent.
|
||||
* \param[in] ui32Crc
|
||||
* Total number of bytes to be programmed.
|
||||
*
|
||||
* \return
|
||||
* Returns SBL_SUCCESS if command and response was successful.
|
||||
*/
|
||||
//-----------------------------------------------------------------------------
|
||||
uint32_t SblDeviceCC2652::cmdDownloadCrc(uint32_t ui32Address, uint32_t ui32Size, uint32_t ui32Crc)
|
||||
{
|
||||
DEBUG_PRINT("\n");
|
||||
int retCode = SBL_SUCCESS;
|
||||
bool bSuccess = false;
|
||||
|
||||
//
|
||||
// Check input arguments
|
||||
//
|
||||
if (!addressInFlash(ui32Address, ui32Size) &&
|
||||
!addressInRam(ui32Address, ui32Size))
|
||||
{
|
||||
setState(SBL_ARGUMENT_ERROR, "Specified address range (0x%08X + %d bytes) is not in device FLASH nor RAM.\n", ui32Address, ui32Size);
|
||||
return SBL_ARGUMENT_ERROR;
|
||||
}
|
||||
|
||||
//
|
||||
// Generate payload
|
||||
// - 4B Program address
|
||||
// - 4B Program data
|
||||
// - 4B CRC
|
||||
//
|
||||
char pcPayload[12];
|
||||
ulToCharArray(ui32Address, &pcPayload[0]);
|
||||
ulToCharArray(ui32Size, &pcPayload[4]);
|
||||
ulToCharArray(ui32Crc, &pcPayload[8]);
|
||||
|
||||
//
|
||||
// Send command
|
||||
//
|
||||
if ((retCode = sendCmd(SblDeviceCC2652::CMD_DOWNLOAD_CRC, pcPayload, 12) != SBL_SUCCESS))
|
||||
{
|
||||
return retCode;
|
||||
}
|
||||
|
||||
//
|
||||
// Receive command response (ACK/NAK)
|
||||
//
|
||||
if ((retCode = getCmdResponse(bSuccess)) != SBL_SUCCESS)
|
||||
{
|
||||
return retCode;
|
||||
}
|
||||
|
||||
//
|
||||
// Return command response
|
||||
//
|
||||
return (bSuccess) ? SBL_SUCCESS : SBL_ERROR;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
/** \brief Send command.
|
||||
*
|
||||
* \param[in] ui32Cmd
|
||||
* The command to send.
|
||||
* \param[in] pcSendData
|
||||
* Pointer to the data to send with the command.
|
||||
* \param[in] ui32SendLen
|
||||
* The number of bytes to send from \e pcSendData.
|
||||
* \return
|
||||
* Returns SBL_SUCCESS, ...
|
||||
*/
|
||||
//-----------------------------------------------------------------------------
|
||||
uint32_t
|
||||
SblDeviceCC2652::sendCmd(uint32_t ui32Cmd, const char *pcSendData/* = NULL*/,
|
||||
uint32_t ui32SendLen/* = 0*/)
|
||||
{
|
||||
DEBUG_PRINT("\n");
|
||||
unsigned char pktLen = ui32SendLen + 3; // +3 => <1B Length>, <1B checksum>, <1B cmd>
|
||||
std::vector<char> pvPkt((pktLen));
|
||||
unsigned char pktSum = generateCheckSum(ui32Cmd, pcSendData, ui32SendLen);
|
||||
|
||||
//
|
||||
// Build packet
|
||||
//
|
||||
pvPkt.at(0) = pktLen;
|
||||
pvPkt.at(1) = pktSum;
|
||||
pvPkt.at(2) = (unsigned char)ui32Cmd;
|
||||
if (ui32SendLen)
|
||||
{
|
||||
memcpy(&pvPkt[3], pcSendData, ui32SendLen);
|
||||
}
|
||||
|
||||
//
|
||||
// Send packet
|
||||
//
|
||||
if (m_pCom->writeBytes(&pvPkt[0], pvPkt.size()) < 1)
|
||||
{
|
||||
setState(SBL_PORT_ERROR, "\nWriting to device failed (Command 0x%04x:'%s').\n", ui32Cmd,getCmdString(ui32Cmd).c_str());
|
||||
return SBL_PORT_ERROR;
|
||||
}
|
||||
//
|
||||
// Empty and deallocate vector
|
||||
//
|
||||
pvPkt.clear();
|
||||
std::vector<char>().swap(pvPkt);
|
||||
|
||||
return SBL_SUCCESS;
|
||||
}
|
||||
|
||||
77
feeds/bluetooth-cc2652/cc2652/src/sbl_device_cc2652.h
Executable file
77
feeds/bluetooth-cc2652/cc2652/src/sbl_device_cc2652.h
Executable file
@@ -0,0 +1,77 @@
|
||||
#ifndef __SBL_DEVICE_CC2652_H__
|
||||
#define __SBL_DEVICE_CC2652_H__
|
||||
/******************************************************************************
|
||||
* Filename: sbl_device_cc2652.h
|
||||
* Revised: $Date$
|
||||
* Revision: $Revision$
|
||||
*
|
||||
* Description: Serial Bootloader for CC13x2/CC26x2 header file.
|
||||
*
|
||||
* Copyright (C) 2018 Texas Instruments Incorporated - http://www.ti.com/
|
||||
*
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* Neither the name of Texas Instruments Incorporated nor the names of
|
||||
* its contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
******************************************************************************/
|
||||
#include "sbl_device_cc2650.h"
|
||||
|
||||
#define SBL_CC2652_PAGE_ERASE_SIZE 8192
|
||||
#define SBL_CC2652_FLASH_SIZE_CFG 0x4003002C
|
||||
#define SBL_CC2652_RAM_SIZE_CFG 0x40082250
|
||||
#define SBL_CC2652_RAM_SIZE_CFG 0x40082250
|
||||
#define SBL_CC2652_FLASH_START_ADDRESS SBL_CC2650_FLASH_START_ADDRESS
|
||||
#define SBL_CC2652_BL_CONFIG_PAGE_OFFSET 0x1FDB
|
||||
|
||||
#define CHIP_SRAM_SIZE_INFO 0x40082250
|
||||
#define CHIP_SRAM_SIZE_INFO_M 0x00000003
|
||||
#define CHIP_SRAM_SIZE_INFO_S 0
|
||||
|
||||
class SblDeviceCC2652 : public SblDeviceCC2650
|
||||
{
|
||||
public:
|
||||
SblDeviceCC2652(); // Constructor
|
||||
~SblDeviceCC2652(); // Destructor
|
||||
|
||||
enum {
|
||||
CMD_DOWNLOAD_CRC = 0x2F,
|
||||
};
|
||||
|
||||
protected:
|
||||
uint32_t readFlashSize(uint32_t *pui32FlashSize);
|
||||
uint32_t readRamSize(uint32_t *pui32RamSize);
|
||||
uint32_t calculateRamSize(uint32_t ramSizeInfo);
|
||||
uint32_t getBootloaderEnableAddress();
|
||||
|
||||
private:
|
||||
std::string getCmdString(uint32_t ui32Cmd);
|
||||
uint32_t sendCmd(uint32_t ui32Cmd, const char *pcSendData = NULL, uint32_t ui32SendLen = 0);
|
||||
uint32_t cmdDownloadCrc(uint32_t ui32Address, uint32_t ui32Size, uint32_t uiCrc);
|
||||
|
||||
};
|
||||
|
||||
#endif // __SBL_DEVICE_CC2652_H__
|
||||
66
feeds/bluetooth-cc2652/cc2652/src/sbl_eb_info.h
Executable file
66
feeds/bluetooth-cc2652/cc2652/src/sbl_eb_info.h
Executable file
@@ -0,0 +1,66 @@
|
||||
#ifndef __SBL_EB_INFO_H__
|
||||
#define __SBL_EB_INFO_H__
|
||||
/******************************************************************************
|
||||
* Filename: sbl_eb_info.h
|
||||
* Revised: $Date: 2013-07-09 15:06:47 +0200 (Tue, 09 Jul 2013) $
|
||||
* Revision: $Revision: 26800 $
|
||||
*
|
||||
* Description: Serial Bootloader EB info class header file.
|
||||
*
|
||||
* Copyright (C) 2014 Texas Instruments Incorporated - http://www.ti.com/
|
||||
*
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* Neither the name of Texas Instruments Incorporated nor the names of
|
||||
* its contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
******************************************************************************/
|
||||
#include <string.h>
|
||||
|
||||
class SblEbInfo
|
||||
{
|
||||
public:
|
||||
enum
|
||||
{
|
||||
DEVICE_NAME_SIZE = 15,
|
||||
EB_PORT_SIZE = 16,
|
||||
DESCRIPTION_SIZE = 256
|
||||
};
|
||||
|
||||
char ebPort[EB_PORT_SIZE]; // E.g. COM42
|
||||
char ebDescription[DESCRIPTION_SIZE];
|
||||
char devName[DEVICE_NAME_SIZE]; // E.g. CC2538 for CC2650
|
||||
|
||||
SblEbInfo& operator = (const SblEbInfo& other) {
|
||||
strncpy(ebPort, other.ebPort, EB_PORT_SIZE);
|
||||
strncpy(ebDescription, other.ebDescription, DESCRIPTION_SIZE);
|
||||
strncpy(devName, other.devName, DEVICE_NAME_SIZE);
|
||||
return *this;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif // __SBL_EB_INFO_H__
|
||||
39
feeds/bluetooth-cc2652/cc2652/src/sbllib.cpp
Executable file
39
feeds/bluetooth-cc2652/cc2652/src/sbllib.cpp
Executable file
@@ -0,0 +1,39 @@
|
||||
/******************************************************************************
|
||||
* Filename: sbllib.cpp
|
||||
* Revised: $Date$
|
||||
* Revision: $Revision$
|
||||
*
|
||||
* Description: Serial Bootloader Library main file.
|
||||
*
|
||||
* Copyright (C) 2014 Texas Instruments Incorporated - http://www.ti.com/
|
||||
*
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* Neither the name of Texas Instruments Incorporated nor the names of
|
||||
* its contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
69
feeds/bluetooth-cc2652/cc2652/src/sbllib.h
Executable file
69
feeds/bluetooth-cc2652/cc2652/src/sbllib.h
Executable file
@@ -0,0 +1,69 @@
|
||||
#ifndef __SBLLIB_H__
|
||||
#define __SBLLIB_H__
|
||||
/******************************************************************************
|
||||
* Filename: sbllib.h
|
||||
* Revised: $Date$
|
||||
* Revision: $Revision$
|
||||
*
|
||||
* Description: Serial Bootloader Library header file.
|
||||
*
|
||||
* Copyright (C) 2014 Texas Instruments Incorporated - http://www.ti.com/
|
||||
*
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* Neither the name of Texas Instruments Incorporated nor the names of
|
||||
* its contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
******************************************************************************/
|
||||
#include <string>
|
||||
#include <stdint.h>
|
||||
|
||||
#include "debug.h"
|
||||
#define SBL_MAX_DEVICES 20
|
||||
#define SBL_DEFAULT_RETRY_COUNT 1
|
||||
#define SBL_DEFAULT_READ_TIMEOUT 100 // in ms
|
||||
#define SBL_DEFAULT_WRITE_TIMEOUT 200 // in ms
|
||||
|
||||
typedef enum {
|
||||
SBL_SUCCESS = 0,
|
||||
SBL_ERROR,
|
||||
SBL_ARGUMENT_ERROR,
|
||||
SBL_TIMEOUT_ERROR,
|
||||
SBL_PORT_ERROR,
|
||||
SBL_ENUM_ERROR,
|
||||
SBL_UNSUPPORTED_FUNCTION,
|
||||
} tSblStatus;
|
||||
|
||||
#include "serialib.h"
|
||||
#include "sbl_device.h"
|
||||
#include "sbl_device_cc2538.h"
|
||||
#include "sbl_device_cc2650.h"
|
||||
#include "sbl_device_cc2652.h"
|
||||
#include "sbl_eb_info.h"
|
||||
|
||||
|
||||
|
||||
#endif // __SBLLIB_H__
|
||||
1019
feeds/bluetooth-cc2652/cc2652/src/serialib.cpp
Executable file
1019
feeds/bluetooth-cc2652/cc2652/src/serialib.cpp
Executable file
File diff suppressed because it is too large
Load Diff
220
feeds/bluetooth-cc2652/cc2652/src/serialib.h
Executable file
220
feeds/bluetooth-cc2652/cc2652/src/serialib.h
Executable file
@@ -0,0 +1,220 @@
|
||||
/*!
|
||||
\file serialib.h
|
||||
\brief Header file of the class serialib. This class is used for communication over a serial device.
|
||||
\author Philippe Lucidarme (University of Angers)
|
||||
\version 2.0
|
||||
\date december the 27th of 2019
|
||||
This Serial library is used to communicate through serial port.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM,
|
||||
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
This is a licence-free software, it can be used by anyone who try to build a better world.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef SERIALIB_H
|
||||
#define SERIALIB_H
|
||||
|
||||
|
||||
|
||||
// Used for TimeOut operations
|
||||
#include <sys/time.h>
|
||||
// Include for windows
|
||||
#if defined (_WIN32) || defined (_WIN64)
|
||||
// Accessing to the serial port under Windows
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
// Include for Linux
|
||||
#ifdef __linux__
|
||||
#include <stdlib.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/shm.h>
|
||||
#include <termios.h>
|
||||
#include <string.h>
|
||||
#include <iostream>
|
||||
// File control definitions
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <vector>
|
||||
#endif
|
||||
|
||||
|
||||
/*! To avoid unused parameters */
|
||||
#define UNUSED(x) (void)(x)
|
||||
|
||||
|
||||
/*! \class serialib
|
||||
\brief This class is used for communication over a serial device.
|
||||
*/
|
||||
class serialib
|
||||
{
|
||||
public:
|
||||
|
||||
//_____________________________________
|
||||
// ::: Constructors and destructors :::
|
||||
|
||||
|
||||
|
||||
// Constructor of the class
|
||||
serialib ();
|
||||
|
||||
// Destructor
|
||||
~serialib ();
|
||||
|
||||
|
||||
|
||||
//_________________________________________
|
||||
// ::: Configuration and initialization :::
|
||||
|
||||
|
||||
// Open a device
|
||||
char openDevice (const char *Device,const unsigned int Bauds);
|
||||
|
||||
// Close the current device
|
||||
void closeDevice();
|
||||
|
||||
|
||||
|
||||
|
||||
//___________________________________________
|
||||
// ::: Read/Write operation on characters :::
|
||||
|
||||
|
||||
// Write a char
|
||||
char writeChar (char);
|
||||
|
||||
// Read a char (with timeout)
|
||||
char readChar (char *pByte,const unsigned int timeOut_ms=0);
|
||||
|
||||
|
||||
|
||||
|
||||
//________________________________________
|
||||
// ::: Read/Write operation on strings :::
|
||||
|
||||
|
||||
// Write a string
|
||||
char writeString (const char *String);
|
||||
|
||||
// Read a string (with timeout)
|
||||
int readString ( char *receivedString,
|
||||
char finalChar,
|
||||
unsigned int maxNbBytes,
|
||||
const unsigned int timeOut_ms=0);
|
||||
|
||||
|
||||
|
||||
// _____________________________________
|
||||
// ::: Read/Write operation on bytes :::
|
||||
|
||||
|
||||
// Write an array of bytes
|
||||
int writeBytes (const void *Buffer, const unsigned int NbBytes);
|
||||
|
||||
// Read an array of byte (with timeout)
|
||||
int readBytes (void *buffer,unsigned int maxNbBytes,const unsigned int timeOut_ms=100, unsigned int sleepDuration_us=100);
|
||||
|
||||
|
||||
|
||||
|
||||
// _________________________
|
||||
// ::: Special operation :::
|
||||
|
||||
|
||||
// Empty the received buffer
|
||||
char flushReceiver();
|
||||
|
||||
// Return the number of bytes in the received buffer
|
||||
int available();
|
||||
|
||||
|
||||
|
||||
|
||||
// _________________________
|
||||
// ::: Access to IO bits :::
|
||||
|
||||
|
||||
// Set CTR status (Data Terminal Ready, pin 4)
|
||||
bool DTR(bool status);
|
||||
bool setDTR();
|
||||
bool clearDTR();
|
||||
|
||||
// Set RTS status (Request To Send, pin 7)
|
||||
bool RTS(bool status);
|
||||
bool setRTS();
|
||||
bool clearRTS();
|
||||
|
||||
// Get RI status (Ring Indicator, pin 9)
|
||||
bool isRI();
|
||||
|
||||
// Get DCD status (Data Carrier Detect, pin 1)
|
||||
bool isDCD();
|
||||
|
||||
// Get CTS status (Clear To Send, pin 8)
|
||||
bool isCTS();
|
||||
|
||||
// Get DSR status (Data Set Ready, pin 9)
|
||||
bool isDSR();
|
||||
|
||||
// Get RTS status (Request To Send, pin 7)
|
||||
bool isRTS();
|
||||
|
||||
// Get CTR status (Data Terminal Ready, pin 4)
|
||||
bool isDTR();
|
||||
|
||||
|
||||
private:
|
||||
// Read a string (no timeout)
|
||||
int readStringNoTimeOut (char *String,char FinalChar,unsigned int MaxNbBytes);
|
||||
|
||||
// Current DTR and RTS state (can't be read on WIndows)
|
||||
bool currentStateRTS;
|
||||
bool currentStateDTR;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#if defined (_WIN32) || defined( _WIN64)
|
||||
// Handle on serial device
|
||||
HANDLE hSerial;
|
||||
// For setting serial port timeouts
|
||||
COMMTIMEOUTS timeouts;
|
||||
#endif
|
||||
#ifdef __linux__
|
||||
int fd;
|
||||
#endif
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
/*! \class timeOut
|
||||
\brief This class can manage a timer which is used as a timeout.
|
||||
*/
|
||||
// Class timeOut
|
||||
class timeOut
|
||||
{
|
||||
public:
|
||||
|
||||
// Constructor
|
||||
timeOut();
|
||||
|
||||
// Init the timer
|
||||
void initTimer();
|
||||
|
||||
// Return the elapsed time since initialization
|
||||
unsigned long int elapsedTime_ms();
|
||||
|
||||
private:
|
||||
// Used to store the previous time (for computing timeout)
|
||||
struct timeval previousTime;
|
||||
};
|
||||
|
||||
#endif // serialib_H
|
||||
162
feeds/bluetooth-csr/bluez/Makefile
Normal file
162
feeds/bluetooth-csr/bluez/Makefile
Normal file
@@ -0,0 +1,162 @@
|
||||
#
|
||||
# Copyright (C) 2006-2016 OpenWrt.org
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=bluez
|
||||
PKG_VERSION:=5.37
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
|
||||
PKG_SOURCE_URL:=@KERNEL/linux/bluetooth/
|
||||
PKG_MD5SUM:=33177e5743e24b2b3738f72be64e3ffb
|
||||
|
||||
PKG_LICENSE:=GPL-2.0+
|
||||
PKG_LICENSE_FILES:=COPYING
|
||||
PKG_MAINTAINER:=Nicolas Thill <nico@openwrt.org>
|
||||
|
||||
PKG_INSTALL:=1
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(INCLUDE_DIR)/nls.mk
|
||||
|
||||
define Package/bluez/Default
|
||||
TITLE:=Bluetooth
|
||||
URL:=http://www.bluez.org/
|
||||
endef
|
||||
|
||||
define Package/bluez-examples
|
||||
$(call Package/bluez/Default)
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE+= python example apps
|
||||
DEPENDS:=
|
||||
endef
|
||||
|
||||
define Package/bluez-examples/description
|
||||
contains many examples apps for bluetooth, requiring python
|
||||
endef
|
||||
|
||||
define Package/bluez-libs
|
||||
$(call Package/bluez/Default)
|
||||
SECTION:=libs
|
||||
CATEGORY:=Libraries
|
||||
TITLE+= library
|
||||
DEPENDS:=+libpthread +kmod-bluetooth
|
||||
endef
|
||||
|
||||
define Package/bluez-utils
|
||||
$(call Package/bluez/Default)
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE+= utilities
|
||||
DEPENDS:=+bluez-libs +libpthread +librt +glib2 +libncurses +libreadline $(INTL_DEPENDS) $(ICONV_DEPENDS)
|
||||
endef
|
||||
|
||||
define Package/bluez-daemon
|
||||
$(call Package/bluez/Default)
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE+= daemon
|
||||
DEPENDS:=+bluez-libs +bluez-utils +dbus +libical $(INTL_DEPENDS) $(ICONV_DEPENDS)
|
||||
endef
|
||||
|
||||
define Package/bluez-daemon/conffiles
|
||||
/etc/bluetooth/main.conf
|
||||
/etc/bluetooth/network.conf
|
||||
/etc/bluetooth/input.conf
|
||||
/etc/bluetooth/proximity.conf
|
||||
/etc/config/bluetooth
|
||||
endef
|
||||
|
||||
CONFIGURE_ARGS += \
|
||||
--enable-static \
|
||||
--enable-shared \
|
||||
--enable-client \
|
||||
--enable-datafiles \
|
||||
--enable-experimental \
|
||||
--enable-library \
|
||||
--enable-monitor \
|
||||
--enable-obex \
|
||||
--enable-threads \
|
||||
--enable-tools \
|
||||
--disable-android \
|
||||
--disable-cups \
|
||||
--disable-manpages \
|
||||
--disable-sixaxis \
|
||||
--disable-systemd \
|
||||
--disable-test \
|
||||
--disable-udev \
|
||||
|
||||
TARGET_CPPFLAGS += \
|
||||
-D_GNU_SOURCE
|
||||
|
||||
define Build/InstallDev
|
||||
$(INSTALL_DIR) $(1)/usr/include
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/include/bluetooth $(1)/usr/include/
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libbluetooth.{a,so*} $(1)/usr/lib/
|
||||
$(INSTALL_DIR) $(1)/usr/lib/pkgconfig
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/bluez.pc $(1)/usr/lib/pkgconfig/
|
||||
endef
|
||||
|
||||
define Package/bluez-examples/install
|
||||
$(INSTALL_DIR) $(1)/usr/bin/bluez
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/test/* $(1)/usr/bin/bluez/
|
||||
endef
|
||||
|
||||
define Package/bluez-libs/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libbluetooth.so.* $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
define Package/bluez-utils/install
|
||||
$(INSTALL_DIR) $(1)/usr/bin
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/bin/bccmd $(1)/usr/bin/
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/bin/bluemoon $(1)/usr/bin/
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/bin/btmon $(1)/usr/bin/
|
||||
$(CP) $(PKG_BUILD_DIR)/tools/btmgmt $(1)/usr/bin/
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/bin/ciptool $(1)/usr/bin/
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/bin/hciattach $(1)/usr/bin/
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/bin/hciconfig $(1)/usr/bin/
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/bin/hcidump $(1)/usr/bin/
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/bin/hcitool $(1)/usr/bin/
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/bin/hex2hcd $(1)/usr/bin/
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/bin/l2ping $(1)/usr/bin/
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/bin/l2test $(1)/usr/bin/
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/bin/rctest $(1)/usr/bin/
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/bin/rfcomm $(1)/usr/bin/
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/bin/sdptool $(1)/usr/bin/
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/attrib/gatttool $(1)/usr/bin/
|
||||
endef
|
||||
|
||||
define Package/bluez-daemon/install
|
||||
$(INSTALL_DIR) $(1)/usr/bin
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/lib/bluetooth/bluetoothd $(1)/usr/bin/
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/bin/bluetoothctl $(1)/usr/bin/
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/lib/bluetooth/obexd $(1)/usr/bin/
|
||||
$(INSTALL_DIR) $(1)/etc/config
|
||||
$(INSTALL_DATA) ./files/bluetooth.config $(1)/etc/config/bluetooth
|
||||
$(INSTALL_DIR) $(1)/etc/dbus-1/system.d/
|
||||
$(INSTALL_DATA) ./files/bluetooth.dbus $(1)/etc/dbus-1/system.d/bluetooth.conf
|
||||
$(INSTALL_DIR) $(1)/etc/bluetooth
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/src/main.conf $(1)/etc/bluetooth/main.conf
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/profiles/network/network.conf $(1)/etc/bluetooth/network.conf
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/profiles/input/input.conf $(1)/etc/bluetooth/input.conf
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/profiles/proximity/proximity.conf $(1)/etc/bluetooth/proximity.conf
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_BIN) ./files/bluetoothd.init $(1)/etc/init.d/bluetoothd
|
||||
$(INSTALL_BIN) ./files/bluez-bccmd.init $(1)/etc/init.d/bluez-bccmd
|
||||
$(INSTALL_DIR) $(1)/etc/bluetooth
|
||||
$(INSTALL_DATA) ./files/csr8x11-a12-bt4.2-patch.psr $(1)/etc/bluetooth/
|
||||
$(INSTALL_DATA) ./files/csr8x11-coex.psr $(1)/etc/bluetooth/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,bluez-examples))
|
||||
$(eval $(call BuildPackage,bluez-libs))
|
||||
$(eval $(call BuildPackage,bluez-utils))
|
||||
$(eval $(call BuildPackage,bluez-daemon))
|
||||
15
feeds/bluetooth-csr/bluez/files/bluetooth.config
Normal file
15
feeds/bluetooth-csr/bluez/files/bluetooth.config
Normal file
@@ -0,0 +1,15 @@
|
||||
config bluetoothd
|
||||
# option config /etc/bluetooth/main.conf
|
||||
option enabled 1
|
||||
|
||||
config hciattach
|
||||
option initspeed 115200
|
||||
option tty ttyS1
|
||||
option type csr
|
||||
option speed 115200
|
||||
option flow noflow
|
||||
option enabled 0
|
||||
|
||||
config rfcomm
|
||||
# option config /etc/bluetooth/rfcomm.conf
|
||||
option enabled 0
|
||||
37
feeds/bluetooth-csr/bluez/files/bluetooth.dbus
Normal file
37
feeds/bluetooth-csr/bluez/files/bluetooth.dbus
Normal file
@@ -0,0 +1,37 @@
|
||||
<!-- This configuration file specifies the required security policies
|
||||
for Bluetooth core daemon to work. -->
|
||||
|
||||
<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
|
||||
"http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
|
||||
<busconfig>
|
||||
|
||||
<!-- ../system.conf have denied everything, so we just punch some holes -->
|
||||
|
||||
<policy user="root">
|
||||
<allow own="org.bluez"/>
|
||||
</policy>
|
||||
|
||||
<policy at_console="true">
|
||||
<allow send_path="/"/>
|
||||
<allow send_path="/org/bluez"/>
|
||||
|
||||
<allow send_destination="org.bluez.Manager"/>
|
||||
<allow receive_sender="org.bluez.Manager"/>
|
||||
|
||||
<allow send_destination="org.bluez.Adapter"/>
|
||||
<allow receive_sender="org.bluez.Adapter"/>
|
||||
|
||||
<allow send_destination="org.bluez.Device"/>
|
||||
<allow receive_sender="org.bluez.Device"/>
|
||||
|
||||
<allow send_destination="org.bluez.Service"/>
|
||||
<allow receive_sender="org.bluez.Service"/>
|
||||
|
||||
<allow send_destination="org.bluez.Database"/>
|
||||
<allow receive_sender="org.bluez.Database"/>
|
||||
|
||||
<allow send_destination="org.bluez.Security"/>
|
||||
<allow receive_sender="org.bluez.Security"/>
|
||||
</policy>
|
||||
|
||||
</busconfig>
|
||||
13
feeds/bluetooth-csr/bluez/files/bluetoothd.init
Normal file
13
feeds/bluetooth-csr/bluez/files/bluetoothd.init
Normal file
@@ -0,0 +1,13 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
# Copyright (C) 2007 OpenWrt.org
|
||||
|
||||
#start after dbus (60)
|
||||
START=62
|
||||
USE_PROCD=1
|
||||
PROG=/usr/bin/bluetoothd
|
||||
|
||||
start_service() {
|
||||
procd_open_instance
|
||||
procd_set_param command "$PROG" -n
|
||||
procd_close_instance
|
||||
}
|
||||
43
feeds/bluetooth-csr/bluez/files/bluez-bccmd.init
Normal file
43
feeds/bluetooth-csr/bluez/files/bluez-bccmd.init
Normal file
@@ -0,0 +1,43 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
. /lib/ar71xx.sh
|
||||
|
||||
START=63
|
||||
|
||||
bt_up(){
|
||||
hciconfig hci0 up
|
||||
|
||||
count=5
|
||||
while [ $count -gt 0 ]
|
||||
do
|
||||
if hciconfig hci0 lestates >/dev/null; then
|
||||
break;
|
||||
fi
|
||||
let count=$count-1
|
||||
sleep 1
|
||||
done
|
||||
|
||||
if [ $count -eq 0 ];then
|
||||
echo "Failed to enable hci0" >> /tmp/log/bccmd
|
||||
fi
|
||||
}
|
||||
|
||||
bccmd_init_csr8x11() {
|
||||
bt_up
|
||||
bccmd -t hci -d hci0 psload /etc/bluetooth/csr8x11-a12-bt4.2-patch.psr
|
||||
bccmd -t hci -d hci0 psload /etc/bluetooth/csr8x11-coex.psr
|
||||
bccmd -t hci -d hci0 warmreset
|
||||
bt_up
|
||||
}
|
||||
|
||||
start() {
|
||||
board_name=$(ar71xx_board_name)
|
||||
|
||||
case "$board_name" in
|
||||
cus531mp3|\
|
||||
cus531mp3-dual|\
|
||||
cus531mp3-nand)
|
||||
bccmd_init_csr8x11
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
50
feeds/bluetooth-csr/bluez/files/csr8x11-a12-bt4.2-patch.psr
Executable file
50
feeds/bluetooth-csr/bluez/files/csr8x11-a12-bt4.2-patch.psr
Executable file
@@ -0,0 +1,50 @@
|
||||
// explicit, PSKEY_HCI_LMP_LOCAL_VERSION (0x010d, 269), 1 words
|
||||
&010d = 0808
|
||||
|
||||
// explicit, PSKEY_LMP_REMOTE_VERSION (0x010e, 270), 1 words
|
||||
&010e = 0008
|
||||
|
||||
// patch_hardware_0, PSKEY_PATCH50 (0x212c, 8492), 56 words
|
||||
&212c = 0000 f001 0617 0513 0118 ff2b ff0e 1a00 2818 009e 081b f100 8888 24f0 f925 f821 0a17 0184 0cf0 0117 0013 0009 02a4 fb25 fa21 f915 f811 fb55 fa61 09e0 ff84 10f0 0117 0013 0009 02a4 f935 f841 f925 f821 0f1b 0712 10a4 0494 0712 e151 0722 f915 f811 0018 ff2b ff0e f000 0518 00e2 5a79
|
||||
|
||||
// patch_hardware_1, PSKEY_PATCH51 (0x212d, 8493), 21 words
|
||||
&212d = 0002 968a 0863 f925 f821 0757 0663 e099 02ec 05e0 f915 0727 f815 0627 0218 ff2b ff0e 9700 8d18 00e2 7e34
|
||||
|
||||
// patch_hardware_2, PSKEY_PATCH52 (0x212e, 8494), 16 words
|
||||
&212e = 0002 0b5a 0100 7834 0040 0327 0223 f815 e311 0218 ff2b ff0e 0b00 5e18 00e2 59c1
|
||||
|
||||
// patch_hardware_3, PSKEY_PATCH53 (0x212f, 8495), 17 words
|
||||
&212f = 0000 7315 0084 04f0 0800 0014 03e0 f800 1215 0b27 0018 ff2b ff0e 7300 1818 00e2 0549
|
||||
|
||||
// patch_hardware_4, PSKEY_PATCH54 (0x2130, 8496), 21 words
|
||||
&2130 = 0001 53f8 0817 0e27 0c00 6384 07f0 0118 ff2b ff0e 5400 0918 00e2 0917 0118 ff2b ff0e 5400 fb18 00e2 91f6
|
||||
|
||||
// patch_hardware_5, PSKEY_PATCH55 (0x2131, 8497), 49 words
|
||||
&2131 = 0002 c0d5 0423 05f4 031b 0012 0280 1df0 021b 0916 1000 00c4 1ef0 0916 03c4 1bf4 031b 0012 0280 17f4 0380 15f4 0480 13f4 0580 11f4 0680 0ff4 0b80 0df4 0d80 0bf4 019c fb00 6719 0d9e 0218 ff2b ff0e c200 8c18 00e2 0218 ff2b ff0e c100 de18 00e2 c5cf
|
||||
|
||||
// patch_hardware_6, PSKEY_PATCH56 (0x2132, 8498), 42 words
|
||||
&2132 = 0003 243f f40b 0827 0923 e019 0916 01b4 0926 0318 ff2b ff0e 2400 4218 00e2 fa0b 3d14 0327 0114 0227 0014 0127 0027 081b 0816 0218 ff2b ff0e f700 fd18 009e e111 081b 0816 0218 ff2b ff0e 3300 ff18 009e fa0f 40f2
|
||||
|
||||
// patch_hardware_7, PSKEY_PATCH57 (0x2133, 8499), 23 words
|
||||
&2133 = 0003 254e 02c0 0916 1000 00c4 02f4 02b0 0916 fec4 e1b1 0922 0816 0318 ff2b ff0e 2500 5218 8000 00c0 08f2 00e2 e402
|
||||
|
||||
// patch_hardware_8, PSKEY_PATCH58 (0x2134, 8500), 16 words
|
||||
&2134 = 0003 21ca fa0b 0227 0323 e019 0916 01b4 0926 0318 ff2b ff0e 2200 cd18 00e2 22dc
|
||||
|
||||
// patch_hardware_9, PSKEY_PATCH59 (0x2135, 8501), 18 words
|
||||
&2135 = 0000 55e2 09f4 0218 ff2b ff0e 2c00 a718 009e 0314 fc0f 0018 ff2b ff0e 5600 0118 00e2 a008
|
||||
|
||||
// patch_hardware_10, PSKEY_PATCH60 (0x2136, 8502), 30 words
|
||||
&2136 = 0004 0d80 1aa4 0418 ff2b ff0e 1d00 ba18 009e 0184 0d2c 0013 8f00 89d0 0117 bf00 d6d4 0318 ff2b ff0e 2700 4218 009e 0418 ff2b ff0e 0e00 8418 00e2 6855
|
||||
|
||||
// patch_hardware_11, PSKEY_PATCH61 (0x2137, 8503), 22 words
|
||||
&2137 = 0002 4da5 0118 ff2b ff0e 6200 c518 009e 031b 2b22 fcc4 2c26 0114 e700 f025 0218 ff2b ff0e 4e00 a818 00e2 8dfc
|
||||
|
||||
// patch_sched_get_or_peek_message, PSKEY_PATCH123 (0x220b, 8715), 49 words
|
||||
&220b = fa0b 0717 0484 2cf0 0617 0690 e119 0c00 d438 041a 001a 022b 23f4 0116 0184 20f0 0216 0327 1df4 e119 0016 0784 19f0 e500 ab15 8000 0054 0100 c018 ff2b fe27 0317 ff0e fe9f e199 0cf4 7d00 f214 0127 0014 0027 0317 000e 019f 0014 021b 0226 fa0f 8392
|
||||
|
||||
// patch_spare1, PSKEY_PATCH155 (0x222b, 8747), 60 words
|
||||
&222b = e70b 1627 a100 8514 0227 0214 0127 6b00 d814 0427 0214 0327 0417 fe27 0317 ff27 1613 0230 0814 0027 e415 0534 ff0e fe9f 0513 0009 01a4 e015 7fc4 7f84 1bf0 0617 1584 18f0 161b 0116 010e 029f e119 049a 11f4 0116 4184 0ef0 e500 ac11 8000 0050 0100 c014 ff27 fe23 0816 ff0e fe9f 0114 02e0 0014 e70f 4d65
|
||||
|
||||
// patch_spare2, PSKEY_PATCH156 (0x222c, 8748), 40 words
|
||||
&222c = f40b 0927 2900 d414 0427 0314 0327 3500 ea14 0627 0314 0527 2900 9614 0827 0414 0727 0917 0110 070e 089f 0917 030e 049f 0617 fe27 0517 ff27 7f14 0027 1514 0127 2a14 0227 0114 0913 ff0e fe9f f40f 3478
|
||||
38
feeds/bluetooth-csr/bluez/files/csr8x11-coex.psr
Executable file
38
feeds/bluetooth-csr/bluez/files/csr8x11-coex.psr
Executable file
@@ -0,0 +1,38 @@
|
||||
// Set the crystal frequency to 26MHz
|
||||
&01fe = 6590
|
||||
|
||||
// PSKEY_COEX_SCHEME
|
||||
// 7 = Use Unity-e.
|
||||
&2480 = 0007
|
||||
|
||||
// Signal Configuration
|
||||
// --------------------
|
||||
// PSKEY_COEX_PIO_UNITY_3_BT_ACTIVE
|
||||
// BT_ACTIVE (PIO=0, polarity=active high)
|
||||
&2483 = 0000 0001
|
||||
|
||||
// PSKEY_COEX_PIO_UNITY_3_BT_STATUS
|
||||
// BT_STATUS (PIO=5, polarity=active high)
|
||||
&2484 = 0005 0001
|
||||
|
||||
// PSKEY_COEX_PIO_UNITY_3_WLAN_DENY
|
||||
// WLAN_DENY (PIO=1, polarity=active high)
|
||||
&2485 = 0001 0001
|
||||
|
||||
// Priority Configuration
|
||||
// ----------------------
|
||||
// PSKEY_coex_transaction_priority_table
|
||||
&2488 = 0000 0000 0000 0000 0000 0001 0001 0000 0000 0000 0000 0000 0000 0000 0000 0000 0001
|
||||
|
||||
// PSKEY_COEX_BLE_TRANSACTION_PRIORITY_TABLE
|
||||
&2493 = 0000 0000 0000 0000 0000 0000 0000 0000 0001 0001 0001 0000 0000 0000 0000 0001
|
||||
|
||||
// PSKEY_COEX_UNITY_EXPRESS_TIMINGS
|
||||
// BT_ACTIVE lead time - 20 us
|
||||
// BT_STATUS lead time - 12 us
|
||||
&248a = 0014 000c
|
||||
|
||||
|
||||
//Disable clock request on PIO2
|
||||
&0246 = 0000
|
||||
|
||||
14
feeds/bluetooth-csr/bluez/files/givepin
Normal file
14
feeds/bluetooth-csr/bluez/files/givepin
Normal file
@@ -0,0 +1,14 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Write bluetooth PIN number here:
|
||||
pin=
|
||||
|
||||
if [ -z "$pin" ]; then
|
||||
msg="Set bluetooth PIN in file $0"
|
||||
logger -p user.err "$msg"
|
||||
for i in /dev/pts/* ; do
|
||||
[ -w $i ] && echo "$msg" > $i
|
||||
done
|
||||
else
|
||||
echo "PIN:$pin"
|
||||
fi
|
||||
40
feeds/bluetooth-csr/bluez/patches/200-uart-speed.patch
Normal file
40
feeds/bluetooth-csr/bluez/patches/200-uart-speed.patch
Normal file
@@ -0,0 +1,40 @@
|
||||
--- a/tools/hciattach.c
|
||||
+++ b/tools/hciattach.c
|
||||
@@ -101,20 +101,37 @@ int uart_speed(int s)
|
||||
return B230400;
|
||||
case 460800:
|
||||
return B460800;
|
||||
+/* FIX: Not all platform support this high serial speed
|
||||
+ claudyus84 @gamil.com
|
||||
+*/
|
||||
+#ifdef B500000
|
||||
case 500000:
|
||||
return B500000;
|
||||
+#endif
|
||||
+#ifdef B576000
|
||||
case 576000:
|
||||
return B576000;
|
||||
+#endif
|
||||
+#ifdef B921600
|
||||
case 921600:
|
||||
return B921600;
|
||||
+#endif
|
||||
+#ifdef B1000000
|
||||
case 1000000:
|
||||
return B1000000;
|
||||
+#endif
|
||||
+#ifdef B1152000
|
||||
case 1152000:
|
||||
return B1152000;
|
||||
+#endif
|
||||
+#ifdef B1500000
|
||||
case 1500000:
|
||||
return B1500000;
|
||||
+#endif
|
||||
+#ifdef B2000000
|
||||
case 2000000:
|
||||
return B2000000;
|
||||
+#endif
|
||||
#ifdef B2500000
|
||||
case 2500000:
|
||||
return B2500000;
|
||||
48
feeds/bluetooth-csr/bluez/patches/201-readline.patch
Normal file
48
feeds/bluetooth-csr/bluez/patches/201-readline.patch
Normal file
@@ -0,0 +1,48 @@
|
||||
--- a/Makefile.in
|
||||
+++ b/Makefile.in
|
||||
@@ -2441,7 +2441,7 @@ unit_tests = $(am__append_35) unit/test-
|
||||
@CLIENT_TRUE@ monitor/uuid.h monitor/uuid.c
|
||||
|
||||
@CLIENT_TRUE@client_bluetoothctl_LDADD = gdbus/libgdbus-internal.la @GLIB_LIBS@ @DBUS_LIBS@ \
|
||||
-@CLIENT_TRUE@ -lreadline
|
||||
+@CLIENT_TRUE@ -lreadline -lncurses
|
||||
|
||||
@MONITOR_TRUE@monitor_btmon_SOURCES = monitor/main.c monitor/bt.h \
|
||||
@MONITOR_TRUE@ monitor/display.h monitor/display.c \
|
||||
@@ -2691,13 +2691,13 @@ unit_tests = $(am__append_35) unit/test-
|
||||
@READLINE_TRUE@ client/display.h
|
||||
|
||||
@READLINE_TRUE@attrib_gatttool_LDADD = lib/libbluetooth-internal.la \
|
||||
-@READLINE_TRUE@ src/libshared-glib.la @GLIB_LIBS@ -lreadline
|
||||
+@READLINE_TRUE@ src/libshared-glib.la @GLIB_LIBS@ -lreadline -lncurses
|
||||
|
||||
@READLINE_TRUE@tools_obex_client_tool_SOURCES = $(gobex_sources) $(btio_sources) \
|
||||
@READLINE_TRUE@ tools/obex-client-tool.c
|
||||
|
||||
@READLINE_TRUE@tools_obex_client_tool_LDADD = lib/libbluetooth-internal.la \
|
||||
-@READLINE_TRUE@ @GLIB_LIBS@ -lreadline
|
||||
+@READLINE_TRUE@ @GLIB_LIBS@ -lreadline -lncurses
|
||||
|
||||
@READLINE_TRUE@tools_obex_server_tool_SOURCES = $(gobex_sources) $(btio_sources) \
|
||||
@READLINE_TRUE@ tools/obex-server-tool.c
|
||||
@@ -2707,17 +2707,17 @@ unit_tests = $(am__append_35) unit/test-
|
||||
@READLINE_TRUE@ client/display.h client/display.c
|
||||
|
||||
@READLINE_TRUE@tools_bluetooth_player_LDADD = gdbus/libgdbus-internal.la \
|
||||
-@READLINE_TRUE@ @GLIB_LIBS@ @DBUS_LIBS@ -lreadline
|
||||
+@READLINE_TRUE@ @GLIB_LIBS@ @DBUS_LIBS@ -lreadline -lncurses
|
||||
|
||||
@READLINE_TRUE@tools_obexctl_SOURCES = tools/obexctl.c \
|
||||
@READLINE_TRUE@ client/display.h client/display.c
|
||||
|
||||
@READLINE_TRUE@tools_obexctl_LDADD = gdbus/libgdbus-internal.la \
|
||||
-@READLINE_TRUE@ @GLIB_LIBS@ @DBUS_LIBS@ -lreadline
|
||||
+@READLINE_TRUE@ @GLIB_LIBS@ @DBUS_LIBS@ -lreadline -lncurses
|
||||
|
||||
@READLINE_TRUE@tools_btmgmt_SOURCES = tools/btmgmt.c src/uuid-helper.c client/display.c
|
||||
@READLINE_TRUE@tools_btmgmt_LDADD = lib/libbluetooth-internal.la src/libshared-mainloop.la \
|
||||
-@READLINE_TRUE@ -lreadline
|
||||
+@READLINE_TRUE@ -lreadline -lncurses
|
||||
|
||||
@EXPERIMENTAL_TRUE@tools_gatt_service_SOURCES = tools/gatt-service.c
|
||||
@EXPERIMENTAL_TRUE@tools_gatt_service_LDADD = @GLIB_LIBS@ @DBUS_LIBS@ gdbus/libgdbus-internal.la
|
||||
@@ -0,0 +1,14 @@
|
||||
--- a/profiles/audio/a2dp-codecs.h
|
||||
+++ b/profiles/audio/a2dp-codecs.h
|
||||
@@ -234,6 +234,11 @@ typedef struct {
|
||||
uint8_t channel_mode:4;
|
||||
} __attribute__ ((packed)) a2dp_aptx_t;
|
||||
|
||||
+typedef struct {
|
||||
+ a2dp_vendor_codec_t info;
|
||||
+ uint8_t unknown[2];
|
||||
+} __attribute__ ((packed)) a2dp_ldac_t;
|
||||
+
|
||||
#else
|
||||
#error "Unknown byte order"
|
||||
#endif
|
||||
@@ -0,0 +1,14 @@
|
||||
--- a/tools/bccmd.c
|
||||
+++ b/tools/bccmd.c
|
||||
@@ -48,7 +48,7 @@
|
||||
#define CSR_STORES_PSF (0x0002)
|
||||
#define CSR_STORES_PSROM (0x0004)
|
||||
#define CSR_STORES_PSRAM (0x0008)
|
||||
-#define CSR_STORES_DEFAULT (CSR_STORES_PSI | CSR_STORES_PSF)
|
||||
+#define CSR_STORES_DEFAULT 0
|
||||
|
||||
#define CSR_TYPE_NULL 0
|
||||
#define CSR_TYPE_COMPLEX 1
|
||||
--
|
||||
2.1.4
|
||||
|
||||
93
feeds/bluetooth-csr/bluez/patches/204-Add-PIO32-setting-oparation.patch
Executable file
93
feeds/bluetooth-csr/bluez/patches/204-Add-PIO32-setting-oparation.patch
Executable file
@@ -0,0 +1,93 @@
|
||||
diff --git a/tools/bccmd.c b/tools/bccmd.c
|
||||
old mode 100644
|
||||
new mode 100755
|
||||
index 6bc28da..1605d1c
|
||||
--- a/tools/bccmd.c
|
||||
+++ b/tools/bccmd.c
|
||||
@@ -636,6 +636,78 @@ static int opt_pskey(int argc, char *argv[], uint16_t *stores, int *reset, int *
|
||||
return optind;
|
||||
}
|
||||
|
||||
+int inline serialize_u32(uint8_t *array, uint32_t val32)
|
||||
+{
|
||||
+ if (NULL == array)
|
||||
+ return -1;
|
||||
+
|
||||
+ array[0] = (val32 & 0xff0000) >> 16;
|
||||
+ array[1] = val32 >> 24;
|
||||
+ array[2] = val32 & 0xff;
|
||||
+ array[3] = (val32 & 0xff00) >> 8;
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+int inline deserialize_u32(uint8_t *array, uint32_t *pval32)
|
||||
+{
|
||||
+ if (NULL == array || NULL == pval32)
|
||||
+ return -1;
|
||||
+
|
||||
+ *pval32 = (array[1]<<24)
|
||||
+ | (array[0]<<16)
|
||||
+ | (array[3]<<8)
|
||||
+ | array[2];
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static int setpio32(int transport, uint32_t varID, uint32_t mask, uint32_t bits)
|
||||
+{
|
||||
+ uint8_t array[32];
|
||||
+ uint8_t *ptr = NULL;
|
||||
+ uint32_t result = 0;
|
||||
+ int err;
|
||||
+
|
||||
+ memset(array, 0, sizeof(array));
|
||||
+ ptr = array;
|
||||
+
|
||||
+ serialize_u32(ptr, mask);
|
||||
+ ptr += 4;
|
||||
+
|
||||
+ serialize_u32(ptr, bits);
|
||||
+
|
||||
+ err = transport_write(transport, varID, array, 12);
|
||||
+ if (err < 0)
|
||||
+ return err;
|
||||
+
|
||||
+ deserialize_u32(&array[8], &result);
|
||||
+ printf("result: 0x%x\n", result);
|
||||
+
|
||||
+ return 0;
|
||||
+
|
||||
+}
|
||||
+
|
||||
+
|
||||
+static int cmd_pio32set(int transport, int argc, char *argv[])
|
||||
+{
|
||||
+ uint32_t varID;
|
||||
+ uint32_t mask;
|
||||
+ uint32_t bits;
|
||||
+
|
||||
+ argc--;
|
||||
+ argv++;
|
||||
+
|
||||
+ if (3 != argc)
|
||||
+ return -1;
|
||||
+
|
||||
+ varID = strtol(argv[0] + 2, NULL, 16);
|
||||
+ mask = strtol(argv[1] + 2, NULL, 16);
|
||||
+ bits = strtol(argv[2] + 2, NULL, 16);
|
||||
+
|
||||
+ return setpio32(transport, varID, mask, bits);
|
||||
+}
|
||||
+
|
||||
+
|
||||
#define OPT_PSKEY(min, max, stores, reset, help) \
|
||||
opt_pskey(argc, argv, (stores), (reset), (help)); \
|
||||
argc -= optind; argv += optind; optind = 0; \
|
||||
@@ -1112,6 +1184,7 @@ static struct {
|
||||
{ "psread", cmd_psread, NULL, "Read all PS keys" },
|
||||
{ "psload", cmd_psload, "<file>", "Load all PS keys from PSR file" },
|
||||
{ "pscheck", cmd_pscheck, "<file>", "Check PSR file" },
|
||||
+ { "pio32set", cmd_pio32set, "<VarID> <mask> <bits>","Set value for PIO32 register" },
|
||||
{ "adc", cmd_adc, "<mux>", "Read ADC value of <mux> input" },
|
||||
{ NULL }
|
||||
};
|
||||
50
feeds/bluetooth-csr/bluez/patches/205-Support-full-radio-test.patch
Executable file
50
feeds/bluetooth-csr/bluez/patches/205-Support-full-radio-test.patch
Executable file
@@ -0,0 +1,50 @@
|
||||
diff --git a/tools/bccmd.c b/tools/bccmd.c
|
||||
index 1605d1c..5655bb5 100755
|
||||
--- a/tools/bccmd.c
|
||||
+++ b/tools/bccmd.c
|
||||
@@ -555,6 +555,37 @@ static int cmd_radiotest(int transport, int argc, char *argv[])
|
||||
return transport_write(transport, CSR_VARID_RADIOTEST, array, 8);
|
||||
}
|
||||
|
||||
+static int cmd_fullradiotest(int transport, int argc, char *argv[])
|
||||
+{
|
||||
+ uint8_t array[8];
|
||||
+ uint16_t testID;
|
||||
+ uint16_t word1;
|
||||
+ uint16_t word2;
|
||||
+ uint16_t word3;
|
||||
+
|
||||
+ OPT_HELP(4, NULL);
|
||||
+
|
||||
+ testID = atoi(argv[0]);
|
||||
+ word1 = atoi(argv[1]);
|
||||
+ word2 = atoi(argv[2]);
|
||||
+ word3 = atoi(argv[3]);
|
||||
+
|
||||
+ printf("TestID %u, word1 %u, word2 %u, word3 %u\n",
|
||||
+ testID, word1, word2, word3);
|
||||
+
|
||||
+ memset(array, 0, sizeof(array));
|
||||
+ array[0] = testID & 0xff;
|
||||
+ array[1] = testID >> 8;
|
||||
+ array[2] = word1 & 0xff;
|
||||
+ array[3] = word1 >> 8;
|
||||
+ array[4] = word2 & 0xff;
|
||||
+ array[5] = word2 >> 8;
|
||||
+ array[6] = word3 & 0xff;
|
||||
+ array[7] = word3 >> 8;
|
||||
+
|
||||
+ return transport_write(transport, CSR_VARID_RADIOTEST, array, 8);
|
||||
+}
|
||||
+
|
||||
static int cmd_memtypes(int transport, int argc, char *argv[])
|
||||
{
|
||||
uint8_t array[8];
|
||||
@@ -1176,6 +1207,7 @@ static struct {
|
||||
{ "hoppingon", cmd_hoppingon, "", "Revert to channel hopping" },
|
||||
{ "rttxdata1", cmd_rttxdata1, "<freq> <level>", "TXData1 radio test" },
|
||||
{ "radiotest", cmd_radiotest, "<freq> <level> <id>", "Run radio tests" },
|
||||
+ { "fullradiotest", cmd_fullradiotest,"<id> <w1> <w2> <w3>", "Run full radio tests" },
|
||||
{ "memtypes", cmd_memtypes, NULL, "Get memory types" },
|
||||
{ "psget", cmd_psget, "<key>", "Get value for PS key" },
|
||||
{ "psset", cmd_psset, "<key> <value>", "Set value for PS key" },
|
||||
@@ -0,0 +1,29 @@
|
||||
Index: bluez-5.37/profiles/input/hog.c
|
||||
===================================================================
|
||||
--- bluez-5.37.orig/profiles/input/hog.c
|
||||
+++ bluez-5.37/profiles/input/hog.c
|
||||
@@ -107,8 +107,13 @@ static struct hog_device *hog_device_new
|
||||
product, version);
|
||||
|
||||
dev = new0(struct hog_device, 1);
|
||||
- dev->device = btd_device_ref(device);
|
||||
dev->hog = bt_hog_new_default(name, vendor, product, version, prim);
|
||||
+ if (!dev->hog) {
|
||||
+ free(dev);
|
||||
+ return NULL;
|
||||
+ }
|
||||
+
|
||||
+ dev->device = btd_device_ref(device);
|
||||
|
||||
/*
|
||||
* TODO: Remove attio callback and use .accept once using
|
||||
@@ -189,6 +194,9 @@ static int hog_probe(struct btd_service
|
||||
continue;
|
||||
|
||||
dev = hog_device_new(device, prim);
|
||||
+ if (!dev)
|
||||
+ break;
|
||||
+
|
||||
btd_service_set_user_data(service, dev);
|
||||
return 0;
|
||||
}
|
||||
29
feeds/bluetooth-csr/csr8811/Makefile
Normal file
29
feeds/bluetooth-csr/csr8811/Makefile
Normal file
@@ -0,0 +1,29 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=csr8811
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_MAINTAINER:=John Crispin <john@phrozen.org>
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/csr8811
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=TIP CSR8811 support package
|
||||
endef
|
||||
|
||||
define Build/Prepare
|
||||
mkdir -p $(PKG_BUILD_DIR)
|
||||
endef
|
||||
|
||||
define Build/Compile/Default
|
||||
|
||||
endef
|
||||
Build/Compile = $(Build/Compile/Default)
|
||||
|
||||
define Package/csr8811/install
|
||||
$(CP) ./files/* $(1)
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,csr8811))
|
||||
9
feeds/bluetooth-csr/csr8811/files/etc/init.d/csr8811
Executable file
9
feeds/bluetooth-csr/csr8811/files/etc/init.d/csr8811
Executable file
@@ -0,0 +1,9 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=80
|
||||
|
||||
boot() {
|
||||
bccmd -t bcsp -b 115200 -d /dev/ttyMSM1 psload -r /lib/firmware/CSR8811/pb-207-csr8x11-rev8.psr
|
||||
sleep 1
|
||||
hciattach -s 115200 /dev/ttyMSM1 any 115200
|
||||
}
|
||||
@@ -0,0 +1,320 @@
|
||||
// =============================================================================
|
||||
//
|
||||
// Copyright (c) 2015 - 2017 Qualcomm Technologies International, Ltd.
|
||||
// All Rights Reserved.
|
||||
// Qualcomm Technologies International, Ltd. Confidential and Proprietary.
|
||||
// report this in case of problems:
|
||||
// $Revision: #8 $
|
||||
// Built Mon Feb 20 11:33:32 2017 GMT
|
||||
// Checked-in $DateTime: 2017/02/20 11:36:26 $
|
||||
// $File: //depot/bc/gemini-a12/dev/patches/10520/pb-207.psr $
|
||||
//
|
||||
// Patch is for build 10520 gem_5hci_rom_bt4.1_gemA12_1407301204_dspm_encr128
|
||||
//
|
||||
// Issues patched: B-158094, B-169261, B-171616, B-174351, B-176411,
|
||||
// B-179448, B-180762, B-184008, B-206751, B-208678,
|
||||
// B-216310, B-220605, B-223811
|
||||
//
|
||||
// Documentation from pb-207.pb
|
||||
// ----------------------------
|
||||
//
|
||||
// General purpose patch and PSKEY bundle for CSR8811
|
||||
// and CSR8311 A12 BT4.2 (build ID 10520).
|
||||
//
|
||||
// Documentation from pb-173-common.pb
|
||||
// -----------------------------------
|
||||
//
|
||||
// General patch bundle for Gemini-A12 (build ID 10520)
|
||||
// Patches and keys in here should be common to all
|
||||
// package variants.
|
||||
//
|
||||
// Documentation from report_bt4p2.pb
|
||||
// ----------------------------------
|
||||
//
|
||||
// Issues patched: B-174351
|
||||
//
|
||||
// Report BT version 4.2
|
||||
//
|
||||
// Documentation from patch_ulp_adv_avg_to_calc.xap
|
||||
// ------------------------------------------------
|
||||
//
|
||||
// Issues patched: B-171616
|
||||
//
|
||||
// BlueCore can be configured through BCCMDVARID_BLE_CONFIG_ADV_RSSI_AVG_PARAM
|
||||
// to report the advertising rssi average through LE ADVERTISING REPORT to the
|
||||
// host for a given PEER LE device.
|
||||
// For more information, See CS-317256-AN.
|
||||
//
|
||||
// If the BlueCore is unable to receive a LE ADVERTISING REPORT from the PEER
|
||||
// before a configured average rssi supervision timeout, then the BlueCore
|
||||
// should send a LE ADVERTISING REPORT with rssi value equal to -127 conveying
|
||||
// that the PEER is out of the range; however, it fails to do this.
|
||||
//
|
||||
// Documentation from patch_ble_scan_deaf.xap
|
||||
// ------------------------------------------
|
||||
//
|
||||
// Issues patched: B-158094
|
||||
//
|
||||
// When BlueCore is asked to do BLE scanning, it scans for a window
|
||||
// approximately 2.5% shorter than asked for. Generally, this does
|
||||
// not cause noticeable effects; sometimes BLE adverts can be missed
|
||||
// making connection initialisation between two BLE devices take
|
||||
// somewhat longer than expected. In pathological cases, especially
|
||||
// if the scan window is long, connections may fail to be made entirely.
|
||||
//
|
||||
// Documentation from patch_usb_suspend_deep_sleep.xap
|
||||
// ---------------------------------------------------
|
||||
//
|
||||
// Issues patched: B-176411
|
||||
//
|
||||
// When BlueCore device is bus powered and is in USB suspend mode,
|
||||
// the current consumption is approximately 8 mA which is higher
|
||||
// than the expected current of 250 uA
|
||||
//
|
||||
// Documentation from patch_tx_if_reduction.xap
|
||||
// --------------------------------------------
|
||||
//
|
||||
// Issues patched: B-169261
|
||||
//
|
||||
// When a BlueCore7 device is configured to use a +/-500 kHz transmit IF, this
|
||||
// can be overridden and a +/-375 kHz IF used instead. This reduces the
|
||||
// bandwidthof the transmit spectrum providing a greater margin in a Chinese
|
||||
// regulatory test.
|
||||
// Only transmit IFs of +/-500 kHz may be reduced; if BlueCore7 is configured to
|
||||
// use a TX IF of +/-1 MHz IF that will remain unchanged.
|
||||
//
|
||||
// Documentation from coex_shutdown.xap
|
||||
// ------------------------------------
|
||||
//
|
||||
// Issues patched: B-208678
|
||||
//
|
||||
// With Coexistence Unity-3 scheme, If the WLAN_DENY signal is asserted during
|
||||
// the initial phase of an adaptive frequency hopping(AFH) scan, the Bluecore
|
||||
// device fails to deassert its BT_ACTIVE signal
|
||||
//
|
||||
// Documentation from patch_access_address.xap
|
||||
// -------------------------------------------
|
||||
//
|
||||
// Issues patched: B-206751
|
||||
//
|
||||
// BlueCore devices may generate access addresses that only
|
||||
// have one bit transition in the 6 most significant bits.
|
||||
// The problem is seen on access addresses that have the most
|
||||
// significant bit set to one and only have one bit transition
|
||||
// in the 6 most significant bits.
|
||||
//
|
||||
// Furthermore, the access address, whilst not identical to the
|
||||
// advertising channel packets’ Access Address, may differ by
|
||||
// only one bit.
|
||||
//
|
||||
// Documentation from patch_sched_get_or_peek_message.c
|
||||
// ----------------------------------------------------
|
||||
//
|
||||
// Issues patched: B-220605
|
||||
//
|
||||
// During the crossover of a locally initiated
|
||||
// LMP_unsniff_req and peer initiated LMP_sniff_subrate_req,
|
||||
// Bluecore responds with LMP_Sniff_Subrate_Rsp even if it
|
||||
// has initiated LMP_unsniff. This probably confuses peer and
|
||||
// peer stops responding, leading to a timeout.
|
||||
//
|
||||
// Documentation from patch_sched_get_or_peek_message_part2.c
|
||||
// ----------------------------------------------------------
|
||||
//
|
||||
// Issues patched: B-220605
|
||||
//
|
||||
// During the crossover of a locally initiated
|
||||
// LMP_unsniff_req and peer initiated LMP_sniff_subrate_req,
|
||||
// Bluecore responds with LMP_Sniff_Subrate_Rsp even if it
|
||||
// has initiated LMP_unsniff. This probably confuses peer and
|
||||
// peer stops responding, leading to a timeout.
|
||||
//
|
||||
// Documentation from patch_ble_advt_restart.xap
|
||||
// ---------------------------------------------
|
||||
//
|
||||
// Issues patched: B-223811
|
||||
//
|
||||
// When advertisements are disabled before the expiry of the interval
|
||||
// and enabled immediately the advertisements are not sent before the
|
||||
// expiry of the advertising interval
|
||||
//
|
||||
// Documentation from patch_whitelist_connection_status.xap
|
||||
// --------------------------------------------------------
|
||||
//
|
||||
// Issues patched: B-180762
|
||||
//
|
||||
// If a BlueCore device attempts but fails to form a Low Energy (LE) connection
|
||||
// to a remote slave using the whitelist, it will make no further attempts to
|
||||
// initiate a connection to that slave until either the BlueCore is reset or the
|
||||
// slave is removed and re-added to the whitelist.
|
||||
//
|
||||
// Documentation from patch_semp2.xap
|
||||
// ----------------------------------
|
||||
//
|
||||
// Issues patched: B-184008
|
||||
//
|
||||
// If HCI_SET_EVENT_MASK_PAGE_2 command is sent with wrong parameters
|
||||
// to Bluecore device, it returns error code
|
||||
// 'INVALID_HCI_COMMAND_PARAMETERS'. It should return error code
|
||||
// 'UNKNOWN_HCI_COMMAND'.
|
||||
//
|
||||
// Documentation from patch_disc_ll_pdu.xap
|
||||
// ----------------------------------------
|
||||
//
|
||||
// Issues patched: B-179448
|
||||
//
|
||||
// If a BlueCore device in the Connection State (regardless if in master or
|
||||
// slave role) receives an unexpected Data Channel PDU from the peer Link Layer
|
||||
// during the encryption start or encryption pause procedure, it does not exit
|
||||
// the Connection State and does not notify the Host with error code
|
||||
// "Connection Terminated Due to MIC Failure (0x3d)".
|
||||
//
|
||||
// Documentation from patch_fsm_shared_patchpoint.c
|
||||
// ------------------------------------------------
|
||||
//
|
||||
// Issues patched: B-216310
|
||||
//
|
||||
// In a particular scenario where the peer device retries a Role Switch
|
||||
// (after a failed Role Switch) without EPR sequence, the Hydra/BlueCore
|
||||
// Devices do not handle the user data Start/Stop operation properly.
|
||||
// As a result the user data does not resume after the procedure is finished.
|
||||
//
|
||||
// Version information for input files
|
||||
// -----------------------------------
|
||||
//
|
||||
// Created by patchmaker.pl Revision: #68 Date: 2016/01/18
|
||||
//
|
||||
// Input file: pb-207.pb
|
||||
// Depot file: //depot/bc/gemini-a12/dev/patches/10520/pb-207.pb
|
||||
// File revision: 4
|
||||
//
|
||||
// Input file: pb-173-common.pb
|
||||
// Depot file: //depot/bc/gemini-a12/dev/patches/10520/pb-173-common.pb
|
||||
// File revision: 7
|
||||
//
|
||||
// Input file: report_bt4p2.pb
|
||||
// Depot file: //depot/bc/gemini-a12/dev/patches/10520/report_bt4p2.pb
|
||||
// File revision: 1
|
||||
//
|
||||
// Input file: patch_ulp_adv_avg_to_calc.xap
|
||||
// Depot file: //depot/bc/gemini-a12/dev/patches/10520/patch_ulp_adv_avg_to_calc.xap
|
||||
// File revision: 4
|
||||
//
|
||||
// Input file: ../patch_utils.inc
|
||||
// Depot file: //depot/bc/gemini-a12/dev/patches/patch_utils.inc
|
||||
// File revision: 1
|
||||
//
|
||||
// Input file: patch_ble_scan_deaf.xap
|
||||
// Depot file: //depot/bc/gemini-a12/dev/patches/10520/patch_ble_scan_deaf.xap
|
||||
// File revision: 3
|
||||
//
|
||||
// Input file: patch_usb_suspend_deep_sleep.xap
|
||||
// Depot file: //depot/bc/gemini-a12/dev/patches/10520/patch_usb_suspend_deep_sleep.xap
|
||||
// File revision: 3
|
||||
//
|
||||
// Input file: patch_tx_if_reduction.xap
|
||||
// Depot file: //depot/bc/gemini-a12/dev/patches/10520/patch_tx_if_reduction.xap
|
||||
// File revision: 1
|
||||
//
|
||||
// Input file: coex_shutdown.xap
|
||||
// Depot file: //depot/bc/gemini-a12/dev/patches/10520/coex_shutdown.xap
|
||||
// File revision: 3
|
||||
//
|
||||
// Input file: patch_access_address.xap
|
||||
// Depot file: //depot/bc/gemini-a12/dev/patches/10520/patch_access_address.xap
|
||||
// File revision: 2
|
||||
//
|
||||
// Input file: patch_sched_get_or_peek_message.c
|
||||
// Depot file: //depot/bc/gemini-a12/dev/patches/10520/patch_sched_get_or_peek_message.c
|
||||
// File revision: 3
|
||||
//
|
||||
// Input file: patch_sched_get_or_peek_message_part2.c
|
||||
// Depot file: //depot/bc/gemini-a12/dev/patches/10520/patch_sched_get_or_peek_message_part2.c
|
||||
// File revision: 2
|
||||
//
|
||||
// Input file: patch_ble_advt_restart.xap
|
||||
// Depot file: //depot/bc/gemini-a12/dev/patches/10520/patch_ble_advt_restart.xap
|
||||
// File revision: 2
|
||||
//
|
||||
// Input file: patch_whitelist_connection_status.xap
|
||||
// Depot file: //depot/bc/gemini-a12/dev/patches/10520/patch_whitelist_connection_status.xap
|
||||
// File revision: 4
|
||||
//
|
||||
// Input file: patch_semp2.xap
|
||||
// Depot file: //depot/bc/gemini-a12/dev/patches/10520/patch_semp2.xap
|
||||
// File revision: 3
|
||||
//
|
||||
// Input file: patch_disc_ll_pdu.xap
|
||||
// Depot file: //depot/bc/gemini-a12/dev/patches/10520/patch_disc_ll_pdu.xap
|
||||
// File revision: 4
|
||||
//
|
||||
// Input file: patch_fsm_shared_patchpoint.c
|
||||
// Depot file: //depot/bc/gemini-a12/dev/patches/10520/patch_fsm_shared_patchpoint.c
|
||||
// File revision: 3
|
||||
|
||||
// explicit, PSKEY_HCI_LMP_LOCAL_VERSION (0x010d, 269), 1 words
|
||||
&010d = 0808
|
||||
|
||||
// explicit, PSKEY_LMP_REMOTE_VERSION (0x010e, 270), 1 words
|
||||
&010e = 0008
|
||||
|
||||
// patch_hardware_0, PSKEY_PATCH50 (0x212c, 8492), 56 words
|
||||
&212c = 0000 f001 0617 0513 0118 ff2b ff0e 1a00 2818 009e 081b f100 8888 24f0 f925 f821 0a17 0184 0cf0 0117 0013 0009 02a4 fb25 fa21 f915 f811 fb55 fa61 09e0 ff84 10f0 0117 0013 0009 02a4 f935 f841 f925 f821 0f1b 0712 10a4 0494 0712 e151 0722 f915 f811 0018 ff2b ff0e f000 0518 00e2 5a79
|
||||
|
||||
// patch_hardware_1, PSKEY_PATCH51 (0x212d, 8493), 21 words
|
||||
&212d = 0002 968a 0863 f925 f821 0757 0663 e099 02ec 05e0 f915 0727 f815 0627 0218 ff2b ff0e 9700 8d18 00e2 7e34
|
||||
|
||||
// patch_hardware_2, PSKEY_PATCH52 (0x212e, 8494), 16 words
|
||||
&212e = 0002 0b5a 0100 7834 0040 0327 0223 f815 e311 0218 ff2b ff0e 0b00 5e18 00e2 59c1
|
||||
|
||||
// patch_hardware_3, PSKEY_PATCH53 (0x212f, 8495), 17 words
|
||||
&212f = 0000 7315 0084 04f0 0800 0014 03e0 f800 1215 0b27 0018 ff2b ff0e 7300 1818 00e2 0549
|
||||
|
||||
// patch_hardware_4, PSKEY_PATCH54 (0x2130, 8496), 21 words
|
||||
&2130 = 0001 53f8 0817 0e27 0c00 6384 07f0 0118 ff2b ff0e 5400 0918 00e2 0917 0118 ff2b ff0e 5400 fb18 00e2 91f6
|
||||
|
||||
// patch_hardware_5, PSKEY_PATCH55 (0x2131, 8497), 49 words
|
||||
&2131 = 0002 c0d5 0423 05f4 031b 0012 0280 1df0 021b 0916 1000 00c4 1ef0 0916 03c4 1bf4 031b 0012 0280 17f4 0380 15f4 0480 13f4 0580 11f4 0680 0ff4 0b80 0df4 0d80 0bf4 019c fb00 6719 0d9e 0218 ff2b ff0e c200 8c18 00e2 0218 ff2b ff0e c100 de18 00e2 c5cf
|
||||
|
||||
// patch_hardware_6, PSKEY_PATCH56 (0x2132, 8498), 42 words
|
||||
&2132 = 0003 243f f40b 0827 0923 e019 0916 01b4 0926 0318 ff2b ff0e 2400 4218 00e2 fa0b 3d14 0327 0114 0227 0014 0127 0027 081b 0816 0218 ff2b ff0e f700 fd18 009e e111 081b 0816 0218 ff2b ff0e 3300 ff18 009e fa0f 40f2
|
||||
|
||||
// patch_hardware_7, PSKEY_PATCH57 (0x2133, 8499), 23 words
|
||||
&2133 = 0003 254e 02c0 0916 1000 00c4 02f4 02b0 0916 fec4 e1b1 0922 0816 0318 ff2b ff0e 2500 5218 8000 00c0 08f2 00e2 e402
|
||||
|
||||
// patch_hardware_8, PSKEY_PATCH58 (0x2134, 8500), 16 words
|
||||
&2134 = 0003 21ca fa0b 0227 0323 e019 0916 01b4 0926 0318 ff2b ff0e 2200 cd18 00e2 22dc
|
||||
|
||||
// patch_hardware_9, PSKEY_PATCH59 (0x2135, 8501), 18 words
|
||||
&2135 = 0000 55e2 09f4 0218 ff2b ff0e 2c00 a718 009e 0314 fc0f 0018 ff2b ff0e 5600 0118 00e2 a008
|
||||
|
||||
// patch_hardware_10, PSKEY_PATCH60 (0x2136, 8502), 30 words
|
||||
&2136 = 0004 0d80 1aa4 0418 ff2b ff0e 1d00 ba18 009e 0184 0d2c 0013 8f00 89d0 0117 bf00 d6d4 0318 ff2b ff0e 2700 4218 009e 0418 ff2b ff0e 0e00 8418 00e2 6855
|
||||
|
||||
// patch_hardware_11, PSKEY_PATCH61 (0x2137, 8503), 22 words
|
||||
&2137 = 0002 4da5 0118 ff2b ff0e 6200 c518 009e 031b 2b22 fcc4 2c26 0114 e700 f025 0218 ff2b ff0e 4e00 a818 00e2 8dfc
|
||||
|
||||
// patch_hardware_12, PSKEY_PATCH62 (0x2138, 8504), 19 words
|
||||
&2138 = 0002 0f22 0310 081b 0100 8022 0100 b012 04f4 0114 e019 0426 0218 ff2b ff0e 0f00 2618 00e2 bc41
|
||||
|
||||
// patch_hardware_13, PSKEY_PATCH63 (0x2139, 8505), 12 words
|
||||
&2139 = 0002 0d95 0513 0100 b022 0218 ff2b ff0e 0f00 db18 00e2 7a40
|
||||
|
||||
// patch_fsm_shared_patchpoint, PSKEY_PATCH121 (0x2209, 8713), 36 words
|
||||
&2209 = fc0b 0b13 0717 1d00 c184 1df0 081b 0016 6384 05f0 1380 17f0 0114 13e0 6084 13f0 0100 da80 0df0 0d1b 5d9a 0af4 b900 f014 0127 0214 0027 e315 0010 000e 019f 0014 0d1b 5d26 fc0f a1a6
|
||||
|
||||
// patch_sched_get_or_peek_message, PSKEY_PATCH123 (0x220b, 8715), 49 words
|
||||
&220b = fa0b 0717 0484 2cf0 0617 0690 e119 0c00 d438 041a 001a 022b 23f4 0116 0184 20f0 0216 0327 1df4 e119 0016 0784 19f0 e500 ab15 8000 0054 0100 c018 ff2b fe27 0317 ff0e fe9f e199 0cf4 7d00 f214 0127 0014 0027 0317 000e 019f 0014 021b 0226 fa0f 8392
|
||||
|
||||
// patch_spare1, PSKEY_PATCH155 (0x222b, 8747), 60 words
|
||||
&222b = e70b 1627 a100 8514 0227 0214 0127 6b00 d814 0427 0214 0327 0417 fe27 0317 ff27 1613 0230 0814 0027 e415 0534 ff0e fe9f 0513 0009 01a4 e015 7fc4 7f84 1bf0 0617 1584 18f0 161b 0116 010e 029f e119 049a 11f4 0116 4184 0ef0 e500 ac11 8000 0050 0100 c014 ff27 fe23 0816 ff0e fe9f 0114 02e0 0014 e70f 4d65
|
||||
|
||||
// patch_spare2, PSKEY_PATCH156 (0x222c, 8748), 40 words
|
||||
&222c = f40b 0927 2900 d414 0427 0314 0327 3500 ea14 0627 0314 0527 2900 9614 0827 0414 0727 0917 0110 070e 089f 0917 030e 049f 0617 fe27 0517 ff27 7f14 0027 1514 0127 2a14 0227 0114 0913 ff0e fe9f f40f 3478
|
||||
&01fe = 6590
|
||||
//Interface, BCSP
|
||||
//&01f9 = 0001
|
||||
//Interface, H4
|
||||
&01f9 = 0003
|
||||
//Bit rate for 8811, 115200
|
||||
&01ea = 0001 c200
|
||||
53
feeds/bluetooth/bluetooth-6lowpand/Makefile
Normal file
53
feeds/bluetooth/bluetooth-6lowpand/Makefile
Normal file
@@ -0,0 +1,53 @@
|
||||
#
|
||||
# Copyright (C) 2016 Nordic Semiconductor ASA.
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=bluetooth-6lowpand
|
||||
PKG_VERSION:=0.0.1
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_SOURCE_URL:=https://github.com/NordicSemiconductor/Linux-ble-6lowpan-joiner.git
|
||||
PKG_SOURCE_VERSION:=5ce5b248846a6d4ac4a609eb0e8d023cf920b247
|
||||
PKG_SOURCE_PROTO:=git
|
||||
|
||||
BLUEZ_DIR:=$(wildcard $(BUILD_DIR)/bluez-*)
|
||||
|
||||
TARGET_CFLAGS += -I$(BLUEZ_DIR)
|
||||
TARGET_LDFLAGS += -L$(BLUEZ_DIR)/lib/.libs/ -L$(BLUEZ_DIR)/src/.libs/ -lshared-mainloop -lbluetooth-internal
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/bluetooth-6lowpand
|
||||
SECTION:=base
|
||||
CATEGORY:=Network
|
||||
TITLE:=Bluetooth LE 6lowpan joiner daemon
|
||||
URL:=http://www.nordicsemi.com/
|
||||
DEPENDS:=+libusb-1.0 +bluez-libs
|
||||
endef
|
||||
|
||||
define Package/bluetooth-6lowpand/description
|
||||
Bluetooth Low Energy IPSP device scanner and connection daemon.
|
||||
The Daemon can be used to whitelist certain IPSP Bluetooth LE MAC
|
||||
addresses, or autoconnect using SSID and Key derived from Wifi AP
|
||||
setup to authenticate the devices in order to connect. Also, manual
|
||||
configuration of software SSID and Key can be used.
|
||||
endef
|
||||
|
||||
define Package/bluetooth-6lowpand/install
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_BIN) ./files/bluetooth_6lowpand.init $(1)/etc/init.d/bluetooth_6lowpand
|
||||
|
||||
$(INSTALL_DIR) $(1)/etc/bluetooth
|
||||
$(INSTALL_DATA) ./files/bluetooth_6lowpand.conf $(1)/etc/bluetooth
|
||||
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/bluetooth_6lowpand $(1)/usr/sbin
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,bluetooth-6lowpand))
|
||||
@@ -0,0 +1,24 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=63
|
||||
PROG=/usr/sbin/bluetooth_6lowpand
|
||||
HCICONFIG=/usr/bin/hciconfig
|
||||
|
||||
start() {
|
||||
config_load btle
|
||||
config_get enable bluetooth_6lowpand enable 0
|
||||
[ "$enable" -eq 1 ] || return
|
||||
echo "start bluetooth_6lowpand"
|
||||
sleep 1
|
||||
echo 1 > /sys/kernel/debug/bluetooth/6lowpan_enable
|
||||
sleep 1
|
||||
killall bluetoothd
|
||||
sleep 1
|
||||
$HCICONFIG hci0 reset
|
||||
$PROG -w 3 -t 5 -a -d
|
||||
}
|
||||
|
||||
stop() {
|
||||
echo "stop bluetooth_6lowpand"
|
||||
killall -9 bluetooth_6lowpand
|
||||
}
|
||||
33
feeds/bluetooth/bluez-ibeacon/Makefile
Normal file
33
feeds/bluetooth/bluez-ibeacon/Makefile
Normal file
@@ -0,0 +1,33 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=bluez-ibeacon
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_URL=https://github.com/blogic/bluez-ibeacon
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_DATE:=2022-10-31
|
||||
PKG_SOURCE_VERSION:=07c082bf3e139ce061ff62a42b7876860256f4ea
|
||||
|
||||
PKG_MAINTAINER:=John Crispin <john@phrozen.org>
|
||||
PKG_LICENSE:=MIT
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/bluez-ibeacon
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=bluez-ibeacon
|
||||
DEPENDS:=+bluez-libs
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
$(MAKE_VARS) $(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR)/bluez-beacon $(MAKE_FLAGS)
|
||||
endef
|
||||
|
||||
define Package/bluez-ibeacon/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/init.d
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/bluez-beacon/ibeacon $(1)/usr/sbin/
|
||||
$(INSTALL_BIN) ./files/ibeacon $(1)/etc/init.d/ibeacon
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,bluez-ibeacon))
|
||||
25
feeds/bluetooth/bluez-ibeacon/files/ibeacon
Normal file
25
feeds/bluetooth/bluez-ibeacon/files/ibeacon
Normal file
@@ -0,0 +1,25 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=80
|
||||
|
||||
USE_PROCD=1
|
||||
PROG=/usr/sbin/ibeacon
|
||||
|
||||
service_triggers() {
|
||||
procd_add_reload_trigger btle
|
||||
}
|
||||
|
||||
start_service() {
|
||||
config_load btle
|
||||
config_get enable ibeacon enable 0
|
||||
config_get uuid ibeacon uuid 0
|
||||
config_get major ibeacon major 0
|
||||
config_get minor ibeacon minor 0
|
||||
|
||||
[ "$enable" -eq 1 ] || return
|
||||
|
||||
procd_open_instance
|
||||
procd_set_param command "$PROG" 200 "${uuid}" "${major}" "${minor}" -29
|
||||
procd_set_param respawn
|
||||
procd_close_instance
|
||||
}
|
||||
29
feeds/bluetooth/nrf52840/Makefile
Normal file
29
feeds/bluetooth/nrf52840/Makefile
Normal file
@@ -0,0 +1,29 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=nrf52840
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_MAINTAINER:=John Crispin <john@phrozen.org>
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/nrf52840
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=TIP NRF52840 support package
|
||||
endef
|
||||
|
||||
define Build/Prepare
|
||||
mkdir -p $(PKG_BUILD_DIR)
|
||||
endef
|
||||
|
||||
define Build/Compile/Default
|
||||
|
||||
endef
|
||||
Build/Compile = $(Build/Compile/Default)
|
||||
|
||||
define Package/nrf52840/install
|
||||
$(CP) ./files/* $(1)
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,nrf52840))
|
||||
20
feeds/bluetooth/nrf52840/files/etc/init.d/nrf52840
Executable file
20
feeds/bluetooth/nrf52840/files/etc/init.d/nrf52840
Executable file
@@ -0,0 +1,20 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=80
|
||||
|
||||
boot() {
|
||||
. /lib/functions/system.sh
|
||||
case $(board_name) in
|
||||
edgecore,eap102|\
|
||||
edgecore,oap102)
|
||||
echo 54 > /sys/class/gpio/export
|
||||
echo out > /sys/class/gpio/gpio54/direction
|
||||
echo 0 > /sys/class/gpio/gpio54/value
|
||||
echo 1 > /sys/class/gpio/gpio54/value
|
||||
btmgmt --index 0 static-addr FF:02:03:04:05:FF
|
||||
btmgmt --index 0 auto-power
|
||||
hciconfig hci0 up
|
||||
hcitool -i hci0 cmd 0x3f 0x006
|
||||
;;
|
||||
esac
|
||||
}
|
||||
@@ -0,0 +1,320 @@
|
||||
// =============================================================================
|
||||
//
|
||||
// Copyright (c) 2015 - 2017 Qualcomm Technologies International, Ltd.
|
||||
// All Rights Reserved.
|
||||
// Qualcomm Technologies International, Ltd. Confidential and Proprietary.
|
||||
// report this in case of problems:
|
||||
// $Revision: #8 $
|
||||
// Built Mon Feb 20 11:33:32 2017 GMT
|
||||
// Checked-in $DateTime: 2017/02/20 11:36:26 $
|
||||
// $File: //depot/bc/gemini-a12/dev/patches/10520/pb-207.psr $
|
||||
//
|
||||
// Patch is for build 10520 gem_5hci_rom_bt4.1_gemA12_1407301204_dspm_encr128
|
||||
//
|
||||
// Issues patched: B-158094, B-169261, B-171616, B-174351, B-176411,
|
||||
// B-179448, B-180762, B-184008, B-206751, B-208678,
|
||||
// B-216310, B-220605, B-223811
|
||||
//
|
||||
// Documentation from pb-207.pb
|
||||
// ----------------------------
|
||||
//
|
||||
// General purpose patch and PSKEY bundle for CSR8811
|
||||
// and CSR8311 A12 BT4.2 (build ID 10520).
|
||||
//
|
||||
// Documentation from pb-173-common.pb
|
||||
// -----------------------------------
|
||||
//
|
||||
// General patch bundle for Gemini-A12 (build ID 10520)
|
||||
// Patches and keys in here should be common to all
|
||||
// package variants.
|
||||
//
|
||||
// Documentation from report_bt4p2.pb
|
||||
// ----------------------------------
|
||||
//
|
||||
// Issues patched: B-174351
|
||||
//
|
||||
// Report BT version 4.2
|
||||
//
|
||||
// Documentation from patch_ulp_adv_avg_to_calc.xap
|
||||
// ------------------------------------------------
|
||||
//
|
||||
// Issues patched: B-171616
|
||||
//
|
||||
// BlueCore can be configured through BCCMDVARID_BLE_CONFIG_ADV_RSSI_AVG_PARAM
|
||||
// to report the advertising rssi average through LE ADVERTISING REPORT to the
|
||||
// host for a given PEER LE device.
|
||||
// For more information, See CS-317256-AN.
|
||||
//
|
||||
// If the BlueCore is unable to receive a LE ADVERTISING REPORT from the PEER
|
||||
// before a configured average rssi supervision timeout, then the BlueCore
|
||||
// should send a LE ADVERTISING REPORT with rssi value equal to -127 conveying
|
||||
// that the PEER is out of the range; however, it fails to do this.
|
||||
//
|
||||
// Documentation from patch_ble_scan_deaf.xap
|
||||
// ------------------------------------------
|
||||
//
|
||||
// Issues patched: B-158094
|
||||
//
|
||||
// When BlueCore is asked to do BLE scanning, it scans for a window
|
||||
// approximately 2.5% shorter than asked for. Generally, this does
|
||||
// not cause noticeable effects; sometimes BLE adverts can be missed
|
||||
// making connection initialisation between two BLE devices take
|
||||
// somewhat longer than expected. In pathological cases, especially
|
||||
// if the scan window is long, connections may fail to be made entirely.
|
||||
//
|
||||
// Documentation from patch_usb_suspend_deep_sleep.xap
|
||||
// ---------------------------------------------------
|
||||
//
|
||||
// Issues patched: B-176411
|
||||
//
|
||||
// When BlueCore device is bus powered and is in USB suspend mode,
|
||||
// the current consumption is approximately 8 mA which is higher
|
||||
// than the expected current of 250 uA
|
||||
//
|
||||
// Documentation from patch_tx_if_reduction.xap
|
||||
// --------------------------------------------
|
||||
//
|
||||
// Issues patched: B-169261
|
||||
//
|
||||
// When a BlueCore7 device is configured to use a +/-500 kHz transmit IF, this
|
||||
// can be overridden and a +/-375 kHz IF used instead. This reduces the
|
||||
// bandwidthof the transmit spectrum providing a greater margin in a Chinese
|
||||
// regulatory test.
|
||||
// Only transmit IFs of +/-500 kHz may be reduced; if BlueCore7 is configured to
|
||||
// use a TX IF of +/-1 MHz IF that will remain unchanged.
|
||||
//
|
||||
// Documentation from coex_shutdown.xap
|
||||
// ------------------------------------
|
||||
//
|
||||
// Issues patched: B-208678
|
||||
//
|
||||
// With Coexistence Unity-3 scheme, If the WLAN_DENY signal is asserted during
|
||||
// the initial phase of an adaptive frequency hopping(AFH) scan, the Bluecore
|
||||
// device fails to deassert its BT_ACTIVE signal
|
||||
//
|
||||
// Documentation from patch_access_address.xap
|
||||
// -------------------------------------------
|
||||
//
|
||||
// Issues patched: B-206751
|
||||
//
|
||||
// BlueCore devices may generate access addresses that only
|
||||
// have one bit transition in the 6 most significant bits.
|
||||
// The problem is seen on access addresses that have the most
|
||||
// significant bit set to one and only have one bit transition
|
||||
// in the 6 most significant bits.
|
||||
//
|
||||
// Furthermore, the access address, whilst not identical to the
|
||||
// advertising channel packets’ Access Address, may differ by
|
||||
// only one bit.
|
||||
//
|
||||
// Documentation from patch_sched_get_or_peek_message.c
|
||||
// ----------------------------------------------------
|
||||
//
|
||||
// Issues patched: B-220605
|
||||
//
|
||||
// During the crossover of a locally initiated
|
||||
// LMP_unsniff_req and peer initiated LMP_sniff_subrate_req,
|
||||
// Bluecore responds with LMP_Sniff_Subrate_Rsp even if it
|
||||
// has initiated LMP_unsniff. This probably confuses peer and
|
||||
// peer stops responding, leading to a timeout.
|
||||
//
|
||||
// Documentation from patch_sched_get_or_peek_message_part2.c
|
||||
// ----------------------------------------------------------
|
||||
//
|
||||
// Issues patched: B-220605
|
||||
//
|
||||
// During the crossover of a locally initiated
|
||||
// LMP_unsniff_req and peer initiated LMP_sniff_subrate_req,
|
||||
// Bluecore responds with LMP_Sniff_Subrate_Rsp even if it
|
||||
// has initiated LMP_unsniff. This probably confuses peer and
|
||||
// peer stops responding, leading to a timeout.
|
||||
//
|
||||
// Documentation from patch_ble_advt_restart.xap
|
||||
// ---------------------------------------------
|
||||
//
|
||||
// Issues patched: B-223811
|
||||
//
|
||||
// When advertisements are disabled before the expiry of the interval
|
||||
// and enabled immediately the advertisements are not sent before the
|
||||
// expiry of the advertising interval
|
||||
//
|
||||
// Documentation from patch_whitelist_connection_status.xap
|
||||
// --------------------------------------------------------
|
||||
//
|
||||
// Issues patched: B-180762
|
||||
//
|
||||
// If a BlueCore device attempts but fails to form a Low Energy (LE) connection
|
||||
// to a remote slave using the whitelist, it will make no further attempts to
|
||||
// initiate a connection to that slave until either the BlueCore is reset or the
|
||||
// slave is removed and re-added to the whitelist.
|
||||
//
|
||||
// Documentation from patch_semp2.xap
|
||||
// ----------------------------------
|
||||
//
|
||||
// Issues patched: B-184008
|
||||
//
|
||||
// If HCI_SET_EVENT_MASK_PAGE_2 command is sent with wrong parameters
|
||||
// to Bluecore device, it returns error code
|
||||
// 'INVALID_HCI_COMMAND_PARAMETERS'. It should return error code
|
||||
// 'UNKNOWN_HCI_COMMAND'.
|
||||
//
|
||||
// Documentation from patch_disc_ll_pdu.xap
|
||||
// ----------------------------------------
|
||||
//
|
||||
// Issues patched: B-179448
|
||||
//
|
||||
// If a BlueCore device in the Connection State (regardless if in master or
|
||||
// slave role) receives an unexpected Data Channel PDU from the peer Link Layer
|
||||
// during the encryption start or encryption pause procedure, it does not exit
|
||||
// the Connection State and does not notify the Host with error code
|
||||
// "Connection Terminated Due to MIC Failure (0x3d)".
|
||||
//
|
||||
// Documentation from patch_fsm_shared_patchpoint.c
|
||||
// ------------------------------------------------
|
||||
//
|
||||
// Issues patched: B-216310
|
||||
//
|
||||
// In a particular scenario where the peer device retries a Role Switch
|
||||
// (after a failed Role Switch) without EPR sequence, the Hydra/BlueCore
|
||||
// Devices do not handle the user data Start/Stop operation properly.
|
||||
// As a result the user data does not resume after the procedure is finished.
|
||||
//
|
||||
// Version information for input files
|
||||
// -----------------------------------
|
||||
//
|
||||
// Created by patchmaker.pl Revision: #68 Date: 2016/01/18
|
||||
//
|
||||
// Input file: pb-207.pb
|
||||
// Depot file: //depot/bc/gemini-a12/dev/patches/10520/pb-207.pb
|
||||
// File revision: 4
|
||||
//
|
||||
// Input file: pb-173-common.pb
|
||||
// Depot file: //depot/bc/gemini-a12/dev/patches/10520/pb-173-common.pb
|
||||
// File revision: 7
|
||||
//
|
||||
// Input file: report_bt4p2.pb
|
||||
// Depot file: //depot/bc/gemini-a12/dev/patches/10520/report_bt4p2.pb
|
||||
// File revision: 1
|
||||
//
|
||||
// Input file: patch_ulp_adv_avg_to_calc.xap
|
||||
// Depot file: //depot/bc/gemini-a12/dev/patches/10520/patch_ulp_adv_avg_to_calc.xap
|
||||
// File revision: 4
|
||||
//
|
||||
// Input file: ../patch_utils.inc
|
||||
// Depot file: //depot/bc/gemini-a12/dev/patches/patch_utils.inc
|
||||
// File revision: 1
|
||||
//
|
||||
// Input file: patch_ble_scan_deaf.xap
|
||||
// Depot file: //depot/bc/gemini-a12/dev/patches/10520/patch_ble_scan_deaf.xap
|
||||
// File revision: 3
|
||||
//
|
||||
// Input file: patch_usb_suspend_deep_sleep.xap
|
||||
// Depot file: //depot/bc/gemini-a12/dev/patches/10520/patch_usb_suspend_deep_sleep.xap
|
||||
// File revision: 3
|
||||
//
|
||||
// Input file: patch_tx_if_reduction.xap
|
||||
// Depot file: //depot/bc/gemini-a12/dev/patches/10520/patch_tx_if_reduction.xap
|
||||
// File revision: 1
|
||||
//
|
||||
// Input file: coex_shutdown.xap
|
||||
// Depot file: //depot/bc/gemini-a12/dev/patches/10520/coex_shutdown.xap
|
||||
// File revision: 3
|
||||
//
|
||||
// Input file: patch_access_address.xap
|
||||
// Depot file: //depot/bc/gemini-a12/dev/patches/10520/patch_access_address.xap
|
||||
// File revision: 2
|
||||
//
|
||||
// Input file: patch_sched_get_or_peek_message.c
|
||||
// Depot file: //depot/bc/gemini-a12/dev/patches/10520/patch_sched_get_or_peek_message.c
|
||||
// File revision: 3
|
||||
//
|
||||
// Input file: patch_sched_get_or_peek_message_part2.c
|
||||
// Depot file: //depot/bc/gemini-a12/dev/patches/10520/patch_sched_get_or_peek_message_part2.c
|
||||
// File revision: 2
|
||||
//
|
||||
// Input file: patch_ble_advt_restart.xap
|
||||
// Depot file: //depot/bc/gemini-a12/dev/patches/10520/patch_ble_advt_restart.xap
|
||||
// File revision: 2
|
||||
//
|
||||
// Input file: patch_whitelist_connection_status.xap
|
||||
// Depot file: //depot/bc/gemini-a12/dev/patches/10520/patch_whitelist_connection_status.xap
|
||||
// File revision: 4
|
||||
//
|
||||
// Input file: patch_semp2.xap
|
||||
// Depot file: //depot/bc/gemini-a12/dev/patches/10520/patch_semp2.xap
|
||||
// File revision: 3
|
||||
//
|
||||
// Input file: patch_disc_ll_pdu.xap
|
||||
// Depot file: //depot/bc/gemini-a12/dev/patches/10520/patch_disc_ll_pdu.xap
|
||||
// File revision: 4
|
||||
//
|
||||
// Input file: patch_fsm_shared_patchpoint.c
|
||||
// Depot file: //depot/bc/gemini-a12/dev/patches/10520/patch_fsm_shared_patchpoint.c
|
||||
// File revision: 3
|
||||
|
||||
// explicit, PSKEY_HCI_LMP_LOCAL_VERSION (0x010d, 269), 1 words
|
||||
&010d = 0808
|
||||
|
||||
// explicit, PSKEY_LMP_REMOTE_VERSION (0x010e, 270), 1 words
|
||||
&010e = 0008
|
||||
|
||||
// patch_hardware_0, PSKEY_PATCH50 (0x212c, 8492), 56 words
|
||||
&212c = 0000 f001 0617 0513 0118 ff2b ff0e 1a00 2818 009e 081b f100 8888 24f0 f925 f821 0a17 0184 0cf0 0117 0013 0009 02a4 fb25 fa21 f915 f811 fb55 fa61 09e0 ff84 10f0 0117 0013 0009 02a4 f935 f841 f925 f821 0f1b 0712 10a4 0494 0712 e151 0722 f915 f811 0018 ff2b ff0e f000 0518 00e2 5a79
|
||||
|
||||
// patch_hardware_1, PSKEY_PATCH51 (0x212d, 8493), 21 words
|
||||
&212d = 0002 968a 0863 f925 f821 0757 0663 e099 02ec 05e0 f915 0727 f815 0627 0218 ff2b ff0e 9700 8d18 00e2 7e34
|
||||
|
||||
// patch_hardware_2, PSKEY_PATCH52 (0x212e, 8494), 16 words
|
||||
&212e = 0002 0b5a 0100 7834 0040 0327 0223 f815 e311 0218 ff2b ff0e 0b00 5e18 00e2 59c1
|
||||
|
||||
// patch_hardware_3, PSKEY_PATCH53 (0x212f, 8495), 17 words
|
||||
&212f = 0000 7315 0084 04f0 0800 0014 03e0 f800 1215 0b27 0018 ff2b ff0e 7300 1818 00e2 0549
|
||||
|
||||
// patch_hardware_4, PSKEY_PATCH54 (0x2130, 8496), 21 words
|
||||
&2130 = 0001 53f8 0817 0e27 0c00 6384 07f0 0118 ff2b ff0e 5400 0918 00e2 0917 0118 ff2b ff0e 5400 fb18 00e2 91f6
|
||||
|
||||
// patch_hardware_5, PSKEY_PATCH55 (0x2131, 8497), 49 words
|
||||
&2131 = 0002 c0d5 0423 05f4 031b 0012 0280 1df0 021b 0916 1000 00c4 1ef0 0916 03c4 1bf4 031b 0012 0280 17f4 0380 15f4 0480 13f4 0580 11f4 0680 0ff4 0b80 0df4 0d80 0bf4 019c fb00 6719 0d9e 0218 ff2b ff0e c200 8c18 00e2 0218 ff2b ff0e c100 de18 00e2 c5cf
|
||||
|
||||
// patch_hardware_6, PSKEY_PATCH56 (0x2132, 8498), 42 words
|
||||
&2132 = 0003 243f f40b 0827 0923 e019 0916 01b4 0926 0318 ff2b ff0e 2400 4218 00e2 fa0b 3d14 0327 0114 0227 0014 0127 0027 081b 0816 0218 ff2b ff0e f700 fd18 009e e111 081b 0816 0218 ff2b ff0e 3300 ff18 009e fa0f 40f2
|
||||
|
||||
// patch_hardware_7, PSKEY_PATCH57 (0x2133, 8499), 23 words
|
||||
&2133 = 0003 254e 02c0 0916 1000 00c4 02f4 02b0 0916 fec4 e1b1 0922 0816 0318 ff2b ff0e 2500 5218 8000 00c0 08f2 00e2 e402
|
||||
|
||||
// patch_hardware_8, PSKEY_PATCH58 (0x2134, 8500), 16 words
|
||||
&2134 = 0003 21ca fa0b 0227 0323 e019 0916 01b4 0926 0318 ff2b ff0e 2200 cd18 00e2 22dc
|
||||
|
||||
// patch_hardware_9, PSKEY_PATCH59 (0x2135, 8501), 18 words
|
||||
&2135 = 0000 55e2 09f4 0218 ff2b ff0e 2c00 a718 009e 0314 fc0f 0018 ff2b ff0e 5600 0118 00e2 a008
|
||||
|
||||
// patch_hardware_10, PSKEY_PATCH60 (0x2136, 8502), 30 words
|
||||
&2136 = 0004 0d80 1aa4 0418 ff2b ff0e 1d00 ba18 009e 0184 0d2c 0013 8f00 89d0 0117 bf00 d6d4 0318 ff2b ff0e 2700 4218 009e 0418 ff2b ff0e 0e00 8418 00e2 6855
|
||||
|
||||
// patch_hardware_11, PSKEY_PATCH61 (0x2137, 8503), 22 words
|
||||
&2137 = 0002 4da5 0118 ff2b ff0e 6200 c518 009e 031b 2b22 fcc4 2c26 0114 e700 f025 0218 ff2b ff0e 4e00 a818 00e2 8dfc
|
||||
|
||||
// patch_hardware_12, PSKEY_PATCH62 (0x2138, 8504), 19 words
|
||||
&2138 = 0002 0f22 0310 081b 0100 8022 0100 b012 04f4 0114 e019 0426 0218 ff2b ff0e 0f00 2618 00e2 bc41
|
||||
|
||||
// patch_hardware_13, PSKEY_PATCH63 (0x2139, 8505), 12 words
|
||||
&2139 = 0002 0d95 0513 0100 b022 0218 ff2b ff0e 0f00 db18 00e2 7a40
|
||||
|
||||
// patch_fsm_shared_patchpoint, PSKEY_PATCH121 (0x2209, 8713), 36 words
|
||||
&2209 = fc0b 0b13 0717 1d00 c184 1df0 081b 0016 6384 05f0 1380 17f0 0114 13e0 6084 13f0 0100 da80 0df0 0d1b 5d9a 0af4 b900 f014 0127 0214 0027 e315 0010 000e 019f 0014 0d1b 5d26 fc0f a1a6
|
||||
|
||||
// patch_sched_get_or_peek_message, PSKEY_PATCH123 (0x220b, 8715), 49 words
|
||||
&220b = fa0b 0717 0484 2cf0 0617 0690 e119 0c00 d438 041a 001a 022b 23f4 0116 0184 20f0 0216 0327 1df4 e119 0016 0784 19f0 e500 ab15 8000 0054 0100 c018 ff2b fe27 0317 ff0e fe9f e199 0cf4 7d00 f214 0127 0014 0027 0317 000e 019f 0014 021b 0226 fa0f 8392
|
||||
|
||||
// patch_spare1, PSKEY_PATCH155 (0x222b, 8747), 60 words
|
||||
&222b = e70b 1627 a100 8514 0227 0214 0127 6b00 d814 0427 0214 0327 0417 fe27 0317 ff27 1613 0230 0814 0027 e415 0534 ff0e fe9f 0513 0009 01a4 e015 7fc4 7f84 1bf0 0617 1584 18f0 161b 0116 010e 029f e119 049a 11f4 0116 4184 0ef0 e500 ac11 8000 0050 0100 c014 ff27 fe23 0816 ff0e fe9f 0114 02e0 0014 e70f 4d65
|
||||
|
||||
// patch_spare2, PSKEY_PATCH156 (0x222c, 8748), 40 words
|
||||
&222c = f40b 0927 2900 d414 0427 0314 0327 3500 ea14 0627 0314 0527 2900 9614 0827 0414 0727 0917 0110 070e 089f 0917 030e 049f 0617 fe27 0517 ff27 7f14 0027 1514 0127 2a14 0227 0114 0913 ff0e fe9f f40f 3478
|
||||
&01fe = 6590
|
||||
//Interface, BCSP
|
||||
//&01f9 = 0001
|
||||
//Interface, H4
|
||||
&01f9 = 0003
|
||||
//Bit rate for 8811, 115200
|
||||
&01ea = 0001 c200
|
||||
32
feeds/bluetooth/ubtled/Makefile
Normal file
32
feeds/bluetooth/ubtled/Makefile
Normal file
@@ -0,0 +1,32 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=ubtled
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_URL=https://github.com/blogic/ubtled.git
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_DATE:=2022-10-31
|
||||
PKG_SOURCE_VERSION:=7e01ab86c562fc8ab3777d04e60b8dce596a4c5f
|
||||
|
||||
PKG_MAINTAINER:=John Crispin <john@phrozen.org>
|
||||
PKG_LICENSE:=GPL-2.0
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(INCLUDE_DIR)/cmake.mk
|
||||
|
||||
define Package/ubtled
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=OpenWrt BTLE daemon
|
||||
DEPENDS:=+libubox +libubus +bluez-libs
|
||||
endef
|
||||
|
||||
define Package/ubtled/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/{config,init.d,uci-defaults}
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/ubtled $(1)/usr/sbin/
|
||||
$(INSTALL_BIN) ./files/ubtled.init $(1)/etc/init.d/ubtled
|
||||
$(INSTALL_DATA) ./files/btle.config $(1)/etc/config/btle
|
||||
$(INSTALL_DATA) ./files/99-btle $(1)/etc/uci-defaults/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,ubtled))
|
||||
8
feeds/bluetooth/ubtled/files/99-btle
Normal file
8
feeds/bluetooth/ubtled/files/99-btle
Normal file
@@ -0,0 +1,8 @@
|
||||
#!/bin/sh
|
||||
|
||||
cat >> /etc/bluetooth/main.conf <<EOF
|
||||
[General]
|
||||
Name = TIP AP
|
||||
[GATT]
|
||||
[Policy]
|
||||
EOF
|
||||
11
feeds/bluetooth/ubtled/files/btle.config
Normal file
11
feeds/bluetooth/ubtled/files/btle.config
Normal file
@@ -0,0 +1,11 @@
|
||||
config ubtled ubtled
|
||||
option enable 0
|
||||
|
||||
config bluetooth_6lowpand bluetooth_6lowpand
|
||||
option enable 0
|
||||
|
||||
config ubtled ibeacon
|
||||
option enable 0
|
||||
option uuid 0
|
||||
option major 0
|
||||
option minor 0
|
||||
24
feeds/bluetooth/ubtled/files/ubtled.init
Normal file
24
feeds/bluetooth/ubtled/files/ubtled.init
Normal file
@@ -0,0 +1,24 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=80
|
||||
|
||||
USE_PROCD=1
|
||||
PROG=/usr/sbin/ubtled
|
||||
|
||||
service_triggers() {
|
||||
procd_add_reload_trigger btle
|
||||
}
|
||||
|
||||
start_service() {
|
||||
config_load btle
|
||||
config_get enable ubtled enable 0
|
||||
|
||||
[ "$enable" -eq 1 ] || return
|
||||
|
||||
hciconfig hci0 up
|
||||
|
||||
procd_open_instance
|
||||
procd_set_param command "$PROG"
|
||||
procd_set_param respawn
|
||||
procd_close_instance
|
||||
}
|
||||
29
feeds/edgecore/eltt2/Makefile
Normal file
29
feeds/edgecore/eltt2/Makefile
Normal file
@@ -0,0 +1,29 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=eltt2
|
||||
PKG_VERSION:=1.0
|
||||
PKG_BUILD_DIR:= $(BUILD_DIR)/$(PKG_NAME)
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/eltt2
|
||||
SECTION:=base
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=eltt2
|
||||
endef
|
||||
|
||||
define Build/Prepare
|
||||
mkdir -p $(PKG_BUILD_DIR)
|
||||
$(CP) ./src/* $(PKG_BUILD_DIR)/
|
||||
endef
|
||||
|
||||
define Package/eltt2/install
|
||||
$(INSTALL_DIR) $(1)/bin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/eltt2 $(1)/bin/
|
||||
endef
|
||||
|
||||
define Package/eltt2/extra_provides
|
||||
echo "libc.so.6";
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,eltt2))
|
||||
27
feeds/edgecore/eltt2/src/License.txt
Normal file
27
feeds/edgecore/eltt2/src/License.txt
Normal file
@@ -0,0 +1,27 @@
|
||||
Copyright (c) 2014, Infineon Technologies AG
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification,
|
||||
are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
3. Neither the name of the copyright holder nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
|
||||
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
15
feeds/edgecore/eltt2/src/Makefile
Normal file
15
feeds/edgecore/eltt2/src/Makefile
Normal file
@@ -0,0 +1,15 @@
|
||||
# Makefile for Embedded Linux TPM Toolbox 2 (ELTT2)
|
||||
# Copyright (c) Infineon Technologies AG
|
||||
|
||||
#CROSS-COMPILE:=../../../../../qsdk/staging_dir/toolchain-arm/bin/arm-openwrt-linux-
|
||||
#CC:=$(CROSS-COMPILE)gcc
|
||||
CC = gcc
|
||||
CFLAGS=-Wall -Wextra -std=c99 -g
|
||||
|
||||
all: eltt2
|
||||
|
||||
eltt2: eltt2.c eltt2.h
|
||||
$(CC) $(CFLAGS) eltt2.c -o eltt2
|
||||
|
||||
clean:
|
||||
rm -rf eltt2
|
||||
230
feeds/edgecore/eltt2/src/README.md
Normal file
230
feeds/edgecore/eltt2/src/README.md
Normal file
@@ -0,0 +1,230 @@
|
||||
# ELTT2 - Infineon Embedded Linux TPM Toolbox 2 for TPM 2.0
|
||||
|
||||
|
||||
All information in this document is Copyright (c) 2014-2022, Infineon Technologies AG <br>
|
||||
All rights reserved.
|
||||
|
||||
|
||||
# 1. Welcome
|
||||
|
||||
Welcome to Embedded Linux TPM Toolbox 2 (ELTT2). ELTT2 is a single-file executable program intended for testing, performing diagnosis and basic state changes of the Infineon Technologies TPM 2.0.
|
||||
|
||||
|
||||
## 1.1 Prerequisites
|
||||
|
||||
To build and run ELTT2 you need GCC and a Linux system capable of hosting a TPM.
|
||||
|
||||
ELTT2 may run on many other little-endian hardware and software configurations capable of running Linux and hosting a TPM, but this has not been tested.
|
||||
|
||||
ELTT2 does not support machines with a big-endian CPU.
|
||||
|
||||
## 1.2 Getting Started
|
||||
|
||||
A TPM 2.0 evaluation board can be ordered in the [Hitex Webshop](https://www.ehitex.de/evaluation-boards/infineon/2564/iridium-9670-tpm2.0-spi).
|
||||
|
||||
|
||||
<p align="center">
|
||||
<img src="https://cloud.githubusercontent.com/assets/19730245/25651091/77a84744-2fe1-11e7-91bd-a2e39678202d.JPG" width="350"/>
|
||||
</p>
|
||||
|
||||
In order to execute ELTT2, you need to compile it first:
|
||||
1. Switch to the directory with the ELTT2 source code
|
||||
2. Compile the source code by typing the following command:
|
||||
make
|
||||
|
||||
Due to hardware (and thus TPM) access restrictions for normal users, ELTT2 requires root (aka superuser or administrator) privileges. They can be obtained e.g. by using the 'sudo' command on Debian Linux derivates.
|
||||
|
||||
The Infineon [TPM 2.0 Application Note](https://www.infineon.com/dgdl/Infineon-App-Note-SLx9670-TPM2.0_Embedded_RPi_DI_SLx-AN-v01_20-EN.pdf?fileId=5546d46267c74c9a01684b96e69f5d7b) shows how the TPM device driver can be set up (e.g. for Linux Kernel 4.14).
|
||||
|
||||
|
||||
|
||||
# 2. Usage of ELTT2
|
||||
|
||||
## 2.1 Generic Usage
|
||||
|
||||
ELTT2 is operated as follows:
|
||||
|
||||
Call: `./eltt2 <option(s)>`
|
||||
|
||||
For example: `./eltt2 -g` or `./eltt2 -gc`
|
||||
|
||||
For getting an overview of the possible commands, run `./eltt2 -h`
|
||||
|
||||
Some options require the TPM to be in a specific state. This state is shown in brackets ("[]") behind each command line option in the list below:
|
||||
|
||||
\[-\]: none <br>
|
||||
\[\*\]: the TPM platform hierarchy authorization value is not set (i.e., empty buffer) <br>
|
||||
\[l\]: the required PCR bank is allocated <br>
|
||||
\[u\]: started <br>
|
||||
|
||||
To get the TPM into the required state, call ELTT2 with the corresponding commands ("x" for a state means that whether this state is required or not depends on the actual command or the command parameters sent eventually to the TPM).
|
||||
|
||||
Command line option | Explanation | Precondition
|
||||
--- | --- | ---
|
||||
`-a [hash algorithm] <data bytes>` | Hash Sequence SHA-1/256/384 \[default: SHA-1\] | \[u\]
|
||||
`-A <data bytes>` | Hash Sequence SHA-256 | \[u\]
|
||||
`-b <command bytes>` | Enter your own TPM command | \[u\]
|
||||
`-c` | Read Clock | \[u\]
|
||||
`-d <shutdown type>` | Shutdown | \[u\]
|
||||
`-e [hash algorithm] <PCR index> <PCR digest>` | PCR Extend SHA-1/256/384 \[default: SHA-1\] | \[u\], \[l\]
|
||||
`-E <PCR index> <PCR digest>` | PCR Extend SHA-256 | \[u\], \[l\]
|
||||
`-g` | Get fixed capability values | \[u\]
|
||||
`-v` | Get variable capability values | \[u\]
|
||||
`-G <data length>` | Get Random | \[u\]
|
||||
`-h` | Help | \[-\]
|
||||
`-l <hash algorithm>` | PCR Allocate SHA-1/256/384 | \[u\], \[\*\]
|
||||
`-r [hash algorithm] <PCR index>` | PCR Read SHA-1/256/384 \[default: SHA-1\] | \[u\], \[l\]
|
||||
`-R <PCR index>` | PCR Read SHA-256 | \[u\], \[l\]
|
||||
`-s [hash algorithm] <data bytes>` | Hash SHA-1/256/384 \[default: SHA-1\] | \[u\]
|
||||
`-S <data bytes>` | Hash SHA-256 | \[u\]
|
||||
`-t <test type>` | Self Test | \[u\]
|
||||
`-T` | Get Test Result | \[u\]
|
||||
`-u <startup type>` | Startup | \[-\]
|
||||
`-z <PCR index>` | PCR Reset | \[u\]
|
||||
|
||||
|
||||
Additional information:
|
||||
|
||||
`-a`: <br>
|
||||
With the "-a" command you can hash given data with the SHA-1/256/384 hash algorithm. This hash sequence sends 3 commands \[start, update, complete\] to the TPM and allows to hash an arbitrary amount of data. For example, use the following command to hash the byte sequence {0x41, 0x62, 0x43, 0x64}: <br>
|
||||
`./eltt2 -a 41624364` Hash given data with SHA-1 hash algorithm. <br>
|
||||
or <br>
|
||||
`./eltt2 -a sha1 41624364` Hash given data with SHA-1 hash algorithm. <br>
|
||||
`./eltt2 -a sha256 41624364` Hash given data with SHA-256 hash algorithm. <br>
|
||||
`./eltt2 -a sha384 41624364` Hash given data with SHA-384 hash algorithm. <br>
|
||||
|
||||
`-A`: <br>
|
||||
With the "-A" command you can hash given data with the SHA-256 hash algorithm. This hash sequence sends 3 commands \[start, update, complete\] to the TPM and allows to hash an arbitrary amount of data. For example, use the following command to hash the byte sequence {0x41, 0x62, 0x43, 0x64}: <br>
|
||||
`./eltt2 -A 41624364`
|
||||
|
||||
`-b`: <br>
|
||||
With the "-b" command you can enter your own TPM command bytes and read the TPM response. For example, use the following command to send a TPM2_Startup with startup type CLEAR to the TPM: <br>
|
||||
`./eltt2 -b 80010000000C000001440000`
|
||||
|
||||
`-c`: <br>
|
||||
With the "-c" command you can read the clock values of the TPM.
|
||||
|
||||
`-d`: <br>
|
||||
With the "-d" command you can issue a TPM shutdown. It has 2 options: <br>
|
||||
`./eltt2 -d` <br>
|
||||
or <br>
|
||||
`./eltt2 -d clear` send a TPM2_Shutdown command with shutdown type CLEAR to the TPM. <br>
|
||||
`./eltt2 -d state` send a TPM2_Shutdown command with shutdown type STATE to the TPM. <br>
|
||||
|
||||
`-e`: <br>
|
||||
With the "-e" command you can extend bytes in the selected PCR with SHA-1/256/384. To do so, you have to enter the index of PCR in hexadecimal that you like to extend and the digest you want to extend the selected PCR with. Note that you can only extend PCRs with index 0 to 16 and PCR 23 and that the digest must have a length of 20/32/48 bytes (will be padded with 0 if necessary). The TPM then builds an SHA-1/256/384 hash over the PCR data in the selected PCR and the digest you provided and writes the result back to the selected PCR. For example, use the following command to extend PCR 23 (0x17) with the byte sequence {0x41, 0x62, 0x43, 0x64, 0x00, ... (will be filled with 0x00)}: <br>
|
||||
`./eltt2 -e 17 41624364` Extend bytes in PCR 23 with SHA-1. <br>
|
||||
or <br>
|
||||
`./eltt2 -e sha1 17 41624364` Extend bytes in PCR 23 with SHA-1. <br>
|
||||
`./eltt2 -e sha256 17 41624364` Extend bytes in PCR 23 with SHA-256. <br>
|
||||
`./eltt2 -e sha384 17 41624364` Extend bytes in PCR 23 with SHA-384. <br>
|
||||
|
||||
`-E`: <br>
|
||||
With the "-E" command you can extend bytes in the selected PCR with SHA-256. To do so, you have to enter the index of PCR in hexadecimal that you like to extend and the digest you want to extend the selected PCR with. Note that you can only extend PCRs with index 0 to 16 and PCR 23 and that the digest must have a length of 32 bytes (will be padded with 0 if necessary). The TPM then builds an SHA-256 hash over the PCR data in the selected PCR and the digest you provided and writes the result back to the selected PCR. For example, use the following command to extend PCR 23 (0x17) with the byte sequence {0x41, 0x62, 0x43, 0x64, 0x00, ... (will be filled with 0x00)}: <br>
|
||||
`./eltt2 -E 17 41624364`
|
||||
|
||||
`-g`: <br>
|
||||
With the "-g" command you can read the TPM's fixed properties.
|
||||
|
||||
`-v`: <br>
|
||||
With the "-v" command you can read the TPM's variable properties.
|
||||
|
||||
`-G`: <br>
|
||||
With the "-G" command you can get a given amount of random bytes. Note that you can only request a maximum amount of 32 random bytes at once. For example, use the following command to get 20 (0x14) random bytes: <br>
|
||||
`./eltt2 -G 14`
|
||||
|
||||
`-l`: <br>
|
||||
With the "-l" command you can allocate the SHA-1/256/384 PCR bank. Take note of two things. Firstly, the command requires a platform authorization value and it is set to an empty buffer; hence the command cannot be used if the TPM platform authorization value is set (e.g., by UEFI). Secondly, when the command is executed successfully a TPM reset has to follow for it to take effect. For example, use the following command to allocate a PCR bank: <br>
|
||||
`./eltt2 -l sha1` Allocate SHA-1 PCR bank. <br>
|
||||
`./eltt2 -l sha256` Allocate SHA-256 PCR bank. <br>
|
||||
`./eltt2 -l sha384` Allocate SHA-384 PCR bank. <br>
|
||||
|
||||
`-r`: <br>
|
||||
With the "-r" command you can read data from a selected SHA-1/256/384 PCR. For example, use the following command to read data from PCR 23 (0x17): <br>
|
||||
`./eltt2 -r 17` Read data from SHA-1 PCR 23. <br>
|
||||
or <br>
|
||||
`./eltt2 -r sha1 17` Read data from SHA-1 PCR 23. <br>
|
||||
`./eltt2 -r sha256 17` Read data from SHA-256 PCR 23. <br>
|
||||
`./eltt2 -r sha384 17` Read data from SHA-384 PCR 23. <br>
|
||||
|
||||
`-R`: <br>
|
||||
With the "-R" command you can read data from a selected SHA-256 PCR. For example, use the following command to read data from PCR 23 (0x17): <br>
|
||||
`./eltt2 -R 17`
|
||||
|
||||
`-s`: <br>
|
||||
With the "-s" command you can hash given data with the SHA-1/256/384 hash algorithm. This command only allows a limited amount of data to be hashed (depending on the TPM's maximum input buffer size). For example, use the following command to hash the byte sequence {0x41, 0x62, 0x43, 0x64}: <br>
|
||||
`./eltt2 -s 41624364` Hash given data with SHA-1 hash algorithm. <br>
|
||||
or <br>
|
||||
`./eltt2 -s sha1 41624364` Hash given data with SHA-1 hash algorithm. <br>
|
||||
`./eltt2 -s sha256 41624364` Hash given data with SHA-256 hash algorithm. <br>
|
||||
`./eltt2 -s sha384 41624364` Hash given data with SHA-384 hash algorithm. <br>
|
||||
|
||||
`-S`: <br>
|
||||
With the "-S" command you can hash given data with the SHA-256 hash algorithm. This command only allows a limited amount of data to be hashed (depending on the TPM input buffer size). For example, use the following command to hash the byte sequence {0x41, 0x62, 0x43, 0x64}: <br>
|
||||
`./eltt2 -S 41624364`
|
||||
|
||||
`-t`: <br>
|
||||
With the "-t" command you can issue a TPM selftest. It has 3 options: <br>
|
||||
`./eltt2 -t` <br>
|
||||
or<br>
|
||||
`./eltt2 -t not_full` Perform a partial TPM2_Selftest to test previously untested TPM capabilities. <br>
|
||||
`./eltt2 -t full` Perform a full TPM2_Selftest to test all TPM capabilities. <br>
|
||||
`./eltt2 -t incremental` Perform a test of selected algorithms.
|
||||
|
||||
`-T`: <br>
|
||||
With the "-T" command you can read the results of a previously run selftest.
|
||||
|
||||
`-u`: <br>
|
||||
With the "-u" command you can issue a TPM startup command. It has 2 options: <br>
|
||||
`./eltt2 -u` <br>
|
||||
or <br>
|
||||
`./eltt2 -u clear` send a TPM2_Startup with startup type CLEAR to the TPM. <br>
|
||||
`./eltt2 -u state` send a TPM2_Startup with startup type STATE to the TPM.
|
||||
|
||||
`-z`: <br>
|
||||
With the "-z" command you can reset a selected PCR. Note that you can only reset PCRs 16 and 23. For example, use the following command to reset PCR 23 (0x17): <br>
|
||||
`./eltt2 -z 17`
|
||||
|
||||
## 2.2 Examples:
|
||||
|
||||
In order to work with the TPM, perform the following steps:
|
||||
- Send the TPM2_Startup command: `./eltt2 -u`
|
||||
|
||||
|
||||
# 3. If you have questions
|
||||
|
||||
If you have any questions or problems, please read the section "FAQ and
|
||||
Troubleshooting" in this document.
|
||||
In case you still have questions, contact your local Infineon
|
||||
Representative.
|
||||
Further information is available at <https://www.infineon.com/tpm>.
|
||||
|
||||
|
||||
# 4. FAQ and Troubleshooting
|
||||
|
||||
If you encounter any error, please make sure that
|
||||
- the TPM is properly connected.
|
||||
- the TPM driver is loaded, i.e. check that "/dev/tpm0" exists. In case of driver loading problems (e.g. shown by "Error opening device"), reboot your system and try to load the driver again.
|
||||
- ELTT2 has been started with root permissions. Please note that ELTT2 needs root permissions for all commands.
|
||||
- the TPM is started. (See section 2.2 in this document on how to do this.)
|
||||
|
||||
|
||||
The following list shows the most common errors and their solution:
|
||||
|
||||
The ELTT2 response is "Error opening the device.":
|
||||
- You need to load a TPM driver before you can work with ELTT2.
|
||||
- You need to start ELTT2 with root permissions.
|
||||
|
||||
The ELTT2 responds with error code 0x100.
|
||||
- You need to send the TPM2_Startup command, or you did send it twice. In
|
||||
case you have not sent it yet, do so with `./eltt2 -u`.
|
||||
|
||||
The TPM does not change any of the permanent flags shown by sending the "-g"
|
||||
command , e.g. after a force clear.
|
||||
- The TPM requires a reset in order to change any of the permanent flags.
|
||||
Press the reset button or disconnect the TPM to do so.
|
||||
|
||||
The value of a PCR does not change after sending PCR extend or reset.
|
||||
- With the application permissions you cannot modify every PCR. For more
|
||||
details, please refer to the description for the different PCR commands
|
||||
in this file.
|
||||
362
feeds/edgecore/eltt2/src/README.txt
Normal file
362
feeds/edgecore/eltt2/src/README.txt
Normal file
@@ -0,0 +1,362 @@
|
||||
--------------------------------------------------------------------------------
|
||||
Infineon Embedded Linux TPM Toolbox 2 (ELTT2) for TPM 2.0 v1.1
|
||||
Infineon Technologies AG
|
||||
|
||||
All information in this document is Copyright (c) 2014, Infineon Technologies AG
|
||||
All rights reserved.
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
Contents:
|
||||
|
||||
1. Welcome
|
||||
1.1 Prerequisites
|
||||
1.2 Contents of the package
|
||||
1.3 Getting Started
|
||||
|
||||
2. Usage of Embedded Linux TPM Toolbox 2 (ELTT2)
|
||||
2.1 Generic Usage
|
||||
2.2 Examples
|
||||
|
||||
3. If you have questions
|
||||
|
||||
4. Release Info
|
||||
|
||||
5. FAQ
|
||||
|
||||
================================================================================
|
||||
|
||||
|
||||
|
||||
1. Welcome
|
||||
|
||||
Welcome to Embedded Linux TPM Toolbox 2 (ELTT2).
|
||||
ELTT2 is a single-file executable program intended for testing, performing
|
||||
diagnosis and basic state changes of the Infineon Technologies TPM 2.0.
|
||||
|
||||
|
||||
1.1 Prerequisites
|
||||
|
||||
To build and run ELTT2 you need GCC and a Linux system capable of hosting a
|
||||
TPM 2.0.
|
||||
|
||||
Tested PC Platforms (x86):
|
||||
- Ubuntu (R) Linux 12.04 LTS - 64 bit (modified Kernel 3.15.4)
|
||||
with Infineon TPM 2.0 SLB9665 Firmware 5.22
|
||||
|
||||
Tested Embedded Platforms (ARM):
|
||||
- Android 6.0 "Marshmallow" - 64 bit (modified Kernel 3.18.0+) on HiKey
|
||||
with Prototype Infineon I2C TPM 2.0 for Embedded Platforms
|
||||
|
||||
ELTT2 may run on many other little-endian hardware and software
|
||||
configurations capable of running Linux and hosting a TPM 2.0, but this has
|
||||
not been tested.
|
||||
|
||||
ELTT2 does not support machines with a big-endian CPU.
|
||||
|
||||
|
||||
1.2 Contents of Package
|
||||
|
||||
ELTT2 consists of the following files:
|
||||
- eltt2.c
|
||||
Contains all method implementations of ELTT2.
|
||||
- eltt2.h
|
||||
Contains all constant definitions, method and command byte declarations
|
||||
for the operation of ELTT2.
|
||||
- License.txt
|
||||
Contains the license agreement for ELTT2.
|
||||
- Makefile
|
||||
Contains the command to compile ELTT2.
|
||||
- README.txt
|
||||
This file.
|
||||
|
||||
|
||||
1.3 Getting Started
|
||||
|
||||
In order to execute ELTT2, you need to compile it first:
|
||||
1. Switch to the directory with the ELTT2 source code
|
||||
2. Compile the source code by typing the following command:
|
||||
make
|
||||
|
||||
Due to hardware (and thus TPM) access restrictions for normal users, ELTT2
|
||||
requires root (aka superuser or administrator) privileges. They can be
|
||||
obtained e.g. by using the 'sudo' command on Debian Linux derivates.
|
||||
|
||||
|
||||
2. Usage of ELTT2
|
||||
|
||||
|
||||
2.1 Generic Usage
|
||||
|
||||
ELTT2 is operated as follows:
|
||||
|
||||
Call: ./eltt2 <option(s)>
|
||||
|
||||
For example: ./eltt2 -g or ./eltt2 -gc
|
||||
|
||||
For getting an overview of the possible commands, run ./eltt2 -h
|
||||
|
||||
Some options require the TPM to be in a specific state. This state is shown
|
||||
in brackets ("[]") behind each command line option in the list below:
|
||||
|
||||
[-]: none
|
||||
[*]: the TPM platform hierarchy authorization value is not set (i.e., empty buffer)
|
||||
[l]: the required PCR bank is allocated
|
||||
[u]: started
|
||||
|
||||
To get the TPM into the required state, call ELTT2 with the corresponding
|
||||
commands ("x" for a state means that whether this state is required or not
|
||||
depends on the actual command or the command parameters sent eventually to
|
||||
the TPM).
|
||||
|
||||
|
||||
Command line options: Preconditions:
|
||||
|
||||
-a [hash algorithm] <data bytes>: Hash Sequence SHA-1/256/384 [default: SHA-1] [u]
|
||||
|
||||
-A <data bytes>: Hash Sequence SHA-256 [u]
|
||||
|
||||
-b <command bytes>: Enter your own TPM command [u]
|
||||
|
||||
-c: Read Clock [u]
|
||||
|
||||
-d <shutdown type>: Shutdown [u]
|
||||
|
||||
-e [hash algorithm] <PCR index> <PCR digest>: PCR Extend SHA-1/256/384 [default: SHA-1] [u], [l]
|
||||
|
||||
-E <PCR index> <PCR digest>: PCR Extend SHA-256 [u], [l]
|
||||
|
||||
-g: Get fixed capability values [u]
|
||||
|
||||
-v: Get variable capability values [u]
|
||||
|
||||
-G <data length>: Get Random [u]
|
||||
|
||||
-h: Help [-]
|
||||
|
||||
-l <hash algorithm>: PCR Allocate SHA-1/256/384 [u], [*]
|
||||
|
||||
-r [hash algorithm] <PCR index>: PCR Read SHA-1/256/384 [default: SHA-1] [u], [l]
|
||||
|
||||
-R <PCR index>: PCR Read SHA-256 [u], [l]
|
||||
|
||||
-s [hash algorithm] <data bytes>: Hash SHA-1/SHA256 [default: SHA-1] [u]
|
||||
|
||||
-S <data bytes>: Hash SHA-256 [u]
|
||||
|
||||
-t <test type>: Self Test [u]
|
||||
|
||||
-T: Get Test Result [u]
|
||||
|
||||
-u <startup type>: Startup [-]
|
||||
|
||||
-z <PCR index>: PCR Reset [u]
|
||||
|
||||
|
||||
Additional information:
|
||||
|
||||
-a:
|
||||
With the "-a" command you can hash given data with the SHA-1/256/384 hash
|
||||
algorithm. This hash sequence sends 3 commands [start, update, complete]
|
||||
to the TPM and allows to hash an arbitrary amount of data.
|
||||
For example, use the following command to hash the byte sequence {0x41,
|
||||
0x62, 0x43, 0x64}:
|
||||
./eltt2 -a 41624364 Hash given data with SHA-1 hash algorithm.
|
||||
or
|
||||
./eltt2 -a sha1 41624364 Hash given data with SHA-1 hash algorithm.
|
||||
./eltt2 -a sha256 41624364 Hash given data with SHA-256 hash algorithm.
|
||||
|
||||
-A:
|
||||
With the "-A" command you can hash given data with the SHA-256 hash
|
||||
algorithm. This hash sequence sends 3 commands [start, update, complete] to
|
||||
the TPM and allows to hash an arbitrary amount of data.
|
||||
For example, use the following command to hash the byte sequence {0x41,
|
||||
0x62, 0x43, 0x64}:
|
||||
./eltt2 -A 41624364
|
||||
|
||||
-b:
|
||||
With the "-b" command you can enter your own TPM command bytes and read the
|
||||
TPM response.
|
||||
For example, use the following command to send a TPM2_Startup with startup
|
||||
type CLEAR to the TPM:
|
||||
./eltt2 -b 80010000000C000001440000
|
||||
|
||||
-c:
|
||||
With the "-c" command you can read the clock values of the TPM.
|
||||
|
||||
-d:
|
||||
With the "-d" command you can issue a TPM shutdown. It has 2 options:
|
||||
./eltt2 -d
|
||||
or
|
||||
./eltt2 -d clear send a TPM2_Shutdown command with shutdown type CLEAR to
|
||||
the TPM.
|
||||
./eltt2 -d state send a TPM2_Shutdown command with shutdown type STATE to
|
||||
the TPM.
|
||||
|
||||
-e:
|
||||
With the "-e" command you can extend bytes in the selected PCR with SHA-1/256/384.
|
||||
To do so, you have to enter the index of PCR in hexadecimal that you like to
|
||||
extend and the digest you want to extend the selected PCR with. Note that
|
||||
you can only extend PCRs with index 0 to 16 and PCR 23 and that the digest
|
||||
must have a length of 20/32/48 bytes (will be padded with 0 if necessary).
|
||||
The TPM then builds an SHA-1/256/384 hash over the PCR data in the selected PCR
|
||||
and the digest you provided and writes the result back to the selected PCR.
|
||||
For example, use the following command to extend PCR 23 (0x17) with the byte
|
||||
sequence {0x41, 0x62, 0x43, 0x64, 0x00, ... (will be filled with 0x00)}:
|
||||
./eltt2 -e 17 41624364 Extend bytes in PCR 23 with SHA-1.
|
||||
or
|
||||
./eltt2 -e sha1 17 41624364 Extend bytes in PCR 23 with SHA-1.
|
||||
./eltt2 -e sha256 17 41624364 Extend bytes in PCR 23 with SHA-256.
|
||||
|
||||
-E:
|
||||
With the "-E" command you can extend bytes in the selected PCR with SHA-256.
|
||||
To do so, you have to enter the index of PCR in hexadecimal that you like to
|
||||
extend and the digest you want to extend the selected PCR with. Note that
|
||||
you can only extend PCRs with index 0 to 16 and PCR 23 and that the digest
|
||||
must have a length of 32 bytes (will be padded with 0 if necessary).
|
||||
The TPM then builds an SHA-256 hash over the PCR data in the selected PCR
|
||||
and the digest you provided and writes the result back to the selected PCR.
|
||||
For example, use the following command to extend PCR 23 (0x17) with the byte
|
||||
sequence {0x41, 0x62, 0x43, 0x64, 0x00, ... (will be filled with 0x00)}:
|
||||
./eltt2 -E 17 41624364
|
||||
|
||||
-g:
|
||||
With the "-g" command you can read the TPM's fixed properties.
|
||||
|
||||
-v:
|
||||
With the "-v" command you can read the TPM's variable properties.
|
||||
|
||||
-G:
|
||||
With the "-G" command you can get a given amount of random bytes. Note that
|
||||
you can only request a maximum amount of 32 random bytes at once.
|
||||
For example, use the following command to get 20 (0x14) random bytes:
|
||||
./eltt2 -G 14
|
||||
|
||||
-l:
|
||||
With the "-l" command you can allocate the SHA-1/256/384 PCR bank.
|
||||
Take note of two things. Firstly, the command requires a platform
|
||||
authorization value and it is set to an empty buffer; hence the command
|
||||
cannot be used if the TPM platform authorization value is set (e.g., by UEFI).
|
||||
Secondly, when the command is executed successfully a TPM reset has to
|
||||
follow for it to take effect. For example, use the following command to
|
||||
allocate a PCR bank:
|
||||
./eltt2 -l sha1 Allocate SHA-1 PCR bank.
|
||||
./eltt2 -l sha256 Allocate SHA-256 PCR bank.
|
||||
./eltt2 -l sha384 Allocate SHA-384 PCR bank.
|
||||
|
||||
-r:
|
||||
With the "-r" command you can read data from a selected SHA-1/256/384 PCR.
|
||||
For example, use the following command to read data from PCR 23 (0x17):
|
||||
./eltt2 -r 17 Read data from SHA-1 PCR 23.
|
||||
or
|
||||
./eltt2 -r sha1 17 Read data from SHA-1 PCR 23.
|
||||
./eltt2 -r sha256 17 Read data from SHA-256 PCR 23.
|
||||
|
||||
-R:
|
||||
With the "-R" command you can read data from a selected SHA-256 PCR.
|
||||
For example, use the following command to read data from PCR 23 (0x17):
|
||||
./eltt2 -R 17
|
||||
|
||||
-s:
|
||||
With the "-s" command you can hash given data with the SHA-1/256/384 hash
|
||||
algorithm. This command only allows a limited amount of data to be hashed
|
||||
(depending on the TPM's maximum input buffer size).
|
||||
For example, use the following command to hash the byte sequence {0x41,
|
||||
0x62, 0x43, 0x64}:
|
||||
./eltt2 -s 41624364 Hash given data with SHA-1 hash algorithm.
|
||||
or
|
||||
./eltt2 -s sha1 41624364 Hash given data with SHA-1 hash algorithm.
|
||||
./eltt2 -s sha256 41624364 Hash given data with SHA-256 hash algorithm.
|
||||
|
||||
-S:
|
||||
With the "-S" command you can hash given data with the SHA-256 hash
|
||||
algorithm. This command only allows a limited amount of data to be hashed
|
||||
(depending on the TPM input buffer size).
|
||||
For example, use the following command to hash the byte sequence {0x41,
|
||||
0x62, 0x43, 0x64}:
|
||||
./eltt2 -S 41624364
|
||||
|
||||
-t:
|
||||
With the "-t" command you can issue a TPM selftest. It has 3 options:
|
||||
./eltt2 -t
|
||||
or
|
||||
./eltt2 -t not_full Perform a partial TPM2_Selftest to test previously
|
||||
untested TPM capabilities.
|
||||
./eltt2 -t full Perform a full TPM2_Selftest to test all TPM
|
||||
capabilities.
|
||||
./eltt2 -t incremental Perform a test of selected algorithms.
|
||||
|
||||
-T:
|
||||
With the "-T" command you can read the results of a previously run selftest.
|
||||
|
||||
-u:
|
||||
With the "-u" command you can issue a TPM startup command. It has 2 options:
|
||||
./eltt2 -u
|
||||
or
|
||||
./eltt2 -u clear send a TPM2_Startup with startup type CLEAR to the TPM.
|
||||
./eltt2 -u state send a TPM2_Startup with startup type STATE to the TPM.
|
||||
|
||||
-z:
|
||||
With the "-z" command you can reset a selected PCR. Note that you can only
|
||||
reset PCRs 16 and 23 and that the PCR is going to be reset in both banks
|
||||
(SHA-1 and SHA-256).
|
||||
For example, use the following command to reset PCR 23 (0x17):
|
||||
./eltt2 -z 17
|
||||
|
||||
|
||||
2.2 Examples:
|
||||
|
||||
In order to work with the TPM, perform the following steps:
|
||||
- Send the TPM2_Startup command: ./eltt2 -u
|
||||
|
||||
|
||||
|
||||
3. If you have questions
|
||||
|
||||
If you have any questions or problems, please read the section "FAQ and
|
||||
Troubleshooting" in this document.
|
||||
In case you still have questions, contact your local Infineon
|
||||
Representative.
|
||||
Further information is available at http://www.infineon.com/tpm.
|
||||
|
||||
|
||||
|
||||
4. Release Info
|
||||
|
||||
This is version 1.1. This version is a general release.
|
||||
|
||||
|
||||
|
||||
5. FAQ and Troubleshooting
|
||||
|
||||
If you encounter any error, please make sure that
|
||||
- the TPM is properly connected.
|
||||
- the TPM driver is loaded, i.e. check that "/dev/tpm0" exists. In case of
|
||||
driver loading problems (e.g. shown by "Error opening device"), reboot
|
||||
your system and try to load the driver again.
|
||||
- ELTT2 has been started with root permissions. Please note that ELTT2 needs
|
||||
root permissions for all commands.
|
||||
- the TPM is started. (See section 2.2 in this document on how to do this.)
|
||||
- Trousers do not run anymore. In some cases the Kernel starts Trousers by
|
||||
booting.
|
||||
Shut down Trousers by entering the following command:
|
||||
sudo pkill tcsd
|
||||
|
||||
The following list shows the most common errors and their solution:
|
||||
|
||||
The ELTT2 response is "Error opening the device.":
|
||||
- You need to load a TPM driver before you can work with ELTT2.
|
||||
- You need to start ELTT2 with root permissions.
|
||||
|
||||
The ELTT2 responds with error code 0x100.
|
||||
- You need to send the TPM2_Startup command, or you did send it twice. In
|
||||
case you have not sent it yet, do so with "./eltt2 -u".
|
||||
|
||||
The TPM does not change any of the permanent flags shown by sending the "-g"
|
||||
command , e.g. after a force clear.
|
||||
- The TPM requires a reset in order to change any of the permanent flags.
|
||||
Press the reset button or disconnect the TPM to do so.
|
||||
|
||||
The value of a PCR does not change after sending PCR extend or reset.
|
||||
- With the application permissions you cannot modify every PCR. For more
|
||||
details, please refer to the description for the different PCR commands
|
||||
in this file.
|
||||
1742
feeds/edgecore/eltt2/src/eltt2.c
Normal file
1742
feeds/edgecore/eltt2/src/eltt2.c
Normal file
File diff suppressed because it is too large
Load Diff
634
feeds/edgecore/eltt2/src/eltt2.h
Normal file
634
feeds/edgecore/eltt2/src/eltt2.h
Normal file
@@ -0,0 +1,634 @@
|
||||
#ifndef _ELTT2_H_
|
||||
#define _ELTT2_H_
|
||||
/**
|
||||
* @brief Infineon Embedded Linux TPM Toolbox 2 (ELTT2) for TPM 2.0
|
||||
* @details eltt2.h implements all TPM byte commands and the prototype declarations for eltt2.c.
|
||||
* @file eltt2.h
|
||||
* @date 2014/06/26
|
||||
* @copyright Copyright (c) 2014 - 2017 Infineon Technologies AG ( www.infineon.com ).\n
|
||||
* All rights reserved.\n
|
||||
* \n
|
||||
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following
|
||||
* conditions are met:\n
|
||||
* \n
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following
|
||||
* disclaimer.\n
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following
|
||||
* disclaimer in the documentation and/or other materials provided with the distribution.\n
|
||||
* 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.\n
|
||||
* \n
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
||||
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
// this is the main page for doxygen documentation.
|
||||
/** @mainpage Infineon Embedded Linux TPM Toolbox 2 (ELTT2) for TPM 2.0 Documentation
|
||||
*
|
||||
* @section Welcome
|
||||
* Welcome to Infineon TPM 2.0 Software-Tool "Embedded Linux TPM Toolbox 2 (ELTT2)".\n
|
||||
* \n
|
||||
* @section Introduction
|
||||
* ELTT2 is a single file-executable program
|
||||
* intended for test, diagnosis and basic state changes of the Infineon
|
||||
* Technologies TPM 2.0.\n
|
||||
* \n
|
||||
* @section Copyright
|
||||
* Copyright (c) 2014 - 2017 Infineon Technologies AG ( www.infineon.com ).\n
|
||||
* All rights reserved.\n
|
||||
* \n
|
||||
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following
|
||||
* conditions are met:\n
|
||||
* \n
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following
|
||||
* disclaimer.\n
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following
|
||||
* disclaimer in the documentation and/or other materials provided with the distribution.\n
|
||||
* 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.\n
|
||||
* \n
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
||||
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
#include <fcntl.h>
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
#include <getopt.h>
|
||||
#include <ctype.h>
|
||||
#include <string.h>
|
||||
#include <strings.h>
|
||||
#include <inttypes.h>
|
||||
|
||||
//-------------"Defines"-------------
|
||||
#define TPM_RESP_MAX_SIZE 4096 ///< This is the maximum possible TPM response size in bytes.
|
||||
#define TPM_REQ_MAX_SIZE 1024 ///< This is the maximum possible TPM request size in bytes. TBD: Find out correct value.
|
||||
#define ERR_COMMUNICATION -1 ///< Return error check for read and write to the TPM.
|
||||
#define ERR_BAD_CMD -2 ///< Error code for a bad command line argument or option.
|
||||
#define TPM_SHA1_DIGEST_SIZE 20 ///< For all SHA-1 operations the digest's size is always 20 bytes.
|
||||
#define TPM_SHA256_DIGEST_SIZE 32 ///< For all SHA-256 operations the digest's size is always 32 bytes.
|
||||
#define TPM_SHA384_DIGEST_SIZE 48 ///< For all SHA-384 operations the digest's size is always 48 bytes.
|
||||
#define TPM_CMD_HEADER_SIZE 10 ///< The size of a standard TPM command header is 10 bytes.
|
||||
#define TPM_CMD_SIZE_OFFSET 2 ///< The offset of a TPM command's size value is 2 bytes.
|
||||
#define HEX_BYTE_STRING_LENGTH 2 ///< A byte can be represented by two hexadecimal characters.
|
||||
#ifndef INT_MAX
|
||||
#define INT_MAX 0x7FFFFFF ///< The maximum value of a signed 32-bit integer.
|
||||
#endif
|
||||
// TPM Return codes
|
||||
#define TPM_RC_SUCCESS 0x00000000 ///< The response error code for TPM_SUCCESS.
|
||||
#define TPM_RC_BAD_TAG 0x0000001E ///< The response error code for TPM_RC_BAD_TAG.
|
||||
#define TPM_RC_SIZE 0x00000095 ///< The response error code for TPM_RC_SIZE.
|
||||
#define TPM_RC_INITIALIZE 0x00000100 ///< The response error code for TPM_RC_INITIALIZE.
|
||||
#define TPM_RC_FAILURE 0x00000101 ///< The response error code for TPM_RC_FAILURE.
|
||||
#define TPM_RC_LOCALITY 0x00000907 ///< The response error code for TPM_RC_LOCALITY.
|
||||
#define FU_FIRMWARE_VALID_FLAG 4 ///< If this flag is set, the firmware is valid.
|
||||
#define FU_OWNER_FLAG 1 ///< If this flag is set, the owner is set.
|
||||
// print_response_buf options
|
||||
#define PRINT_RESPONSE_CLEAR 1 ///< Prints response unformatted.
|
||||
#define PRINT_RESPONSE_HEADERBLOCKS 2 ///< Prints response in commented blocks.
|
||||
#define PRINT_RESPONSE_HEX_BLOCK 3 ///< Prints response in rows of 16 bytes and shows the line number.
|
||||
#define PRINT_RESPONSE_HASH 4 ///< Prints response of Hash
|
||||
#define PRINT_RESPONSE_WITHOUT_HEADER 12 ///< Prints the response buffer from byte 12.
|
||||
#define PRINT_RESPONSE_HASH_WITHOUT_HEADER 16 ///< Prints the response buffer from byte 16.
|
||||
#define PRINT_RESPONSE_WITH_HEADER 0 ///< Prints the response buffer from byte 0.
|
||||
#define PRINT_RESPONSE_PCR_WITHOUT_HEADER 30 ///< Prints the pcr buffer from pcr_read.
|
||||
// time conversion
|
||||
#define YEAR_SECONDS 31536000 ///< Number of seconds in one year
|
||||
#define DAY_SECONDS 86400 ///< Number of seconds in one day
|
||||
#define HOUR_SECONDS 3600 ///< Number of seconds in one hour
|
||||
#define MINUTE_SECONDS 60 ///< Number of seconds in one minute
|
||||
#define MILISECOND_TO_SECOND 1000 ///< Convertion from miliseconds to seconds
|
||||
// hash
|
||||
#define STD_CC_HASH_SIZE 18 ///< Hash command size
|
||||
// TPM_PT constants
|
||||
#define PT_FIXED_SELECTOR 1 ///< Fixed GetCapability Flags
|
||||
#define PT_VAR_SELECTOR 2 ///< Variable GetCapability Flags
|
||||
|
||||
//-------------"Macros"-------------
|
||||
// Null pointer check
|
||||
#define NULL_POINTER_CHECK(x) if (NULL == x) { ret_val = EINVAL; fprintf(stderr, "Error: Invalid argument.\n"); break; } ///< Argument NULL check.
|
||||
#define MALLOC_ERROR_CHECK(x) if (NULL == x) { ret_val = errno; fprintf(stderr, "Error (re)allocating memory.\n"); break; } ///< Malloc error check.
|
||||
#define MEMSET_FREE(x, y) if (NULL != x) { memset(x, 0, y); free(x); x = NULL; } ///< Sets memory to 0, frees memory and sets pointer to NULL.
|
||||
// Return value check
|
||||
#define RET_VAL_CHECK(x) if (EXIT_SUCCESS != x) { break; } ///< Return value check
|
||||
// Command line option parser for hash algorithm
|
||||
#define HASH_ALG_PARSER(o, c) \
|
||||
do { \
|
||||
if (o == option) \
|
||||
{ \
|
||||
if (c == argc) \
|
||||
{ \
|
||||
hash_algo = ALG_SHA1; \
|
||||
} \
|
||||
else \
|
||||
{ \
|
||||
if (0 == strcasecmp(optarg, "sha1")) \
|
||||
{ \
|
||||
hash_algo = ALG_SHA1; \
|
||||
} \
|
||||
else if (0 == strcasecmp(optarg, "sha256")) \
|
||||
{ \
|
||||
hash_algo = ALG_SHA256; \
|
||||
} \
|
||||
else if (0 == strcasecmp(optarg, "sha384")) \
|
||||
{ \
|
||||
hash_algo = ALG_SHA384; \
|
||||
} \
|
||||
else \
|
||||
{ \
|
||||
ret_val = ERR_BAD_CMD; \
|
||||
fprintf(stderr, "Unknown option. Use '-h' for more information.\n"); \
|
||||
break; \
|
||||
} \
|
||||
if (argc > optind) \
|
||||
{ \
|
||||
optarg = argv[optind++]; \
|
||||
} \
|
||||
} \
|
||||
} \
|
||||
else \
|
||||
{ \
|
||||
hash_algo = ALG_SHA256; \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
//--------------"Enums"--------------
|
||||
// Hash algorithms
|
||||
typedef enum hash_algo_enum
|
||||
{
|
||||
ALG_NULL,
|
||||
ALG_SHA1,
|
||||
ALG_SHA256,
|
||||
ALG_SHA384,
|
||||
} hash_algo_enum;
|
||||
|
||||
//-------------"Methods"-------------
|
||||
/**
|
||||
* @brief Convert (max.) 8 byte buffer to an unsigned 64-bit integer.
|
||||
* @param [in] *input_buffer Input buffer. Make sure that its size is at least as high as offset + length.
|
||||
* @param [in] offset Start byte for conversion.
|
||||
* @param [in] length Amount of bytes to be converted.
|
||||
* @param [out] *output_value Return the converted unsigned 64-bit integer.
|
||||
* @param [in] input_buffer_size Size of input_buffer in bytes.
|
||||
* @return One of the listed return codes.
|
||||
* @retval EINVAL In case of a NULL pointer or length is greater than 8.
|
||||
* @retval EXIT_SUCCESS In case of success.
|
||||
* @date 2014/06/26
|
||||
*/
|
||||
static int buf_to_uint64(uint8_t *input_buffer, uint32_t offset, uint32_t length, uint64_t *output_value, uint32_t input_buffer_size);
|
||||
|
||||
/**
|
||||
* @brief Convert a hexadecimal string representation of bytes like "0A1F" and
|
||||
returns an array containing the actual byte values as an array (e.g. { 0x0A, 0x1F }).
|
||||
* @param [in] *byte_string Incoming bytes as string.
|
||||
* @param [out] *byte_values Byte array representation of given input string.
|
||||
* Must be allocated by caller with the length given in byte_values_size.
|
||||
* @param [in] byte_values_size Size of byte_values array.
|
||||
* @return One of the listed return codes.
|
||||
* @retval EXIT_SUCCESS In case of success.
|
||||
* @retval EINVAL In case of a NULL pointer.
|
||||
* @retval value of errno In case parsing error.
|
||||
* @date 2014/06/26
|
||||
*/
|
||||
static int hexstr_to_bytearray(char *byte_string, uint8_t *byte_values, size_t byte_values_size);
|
||||
|
||||
/**
|
||||
* @brief Convert a number to a byte buffer.
|
||||
* @param [in] input User input.
|
||||
* @param [in] input_size Size of input data type in bytes.
|
||||
* @param [out] *output_byte Return buffer for the converted integer.
|
||||
Must be allocated by the caller with at least a size of 'input_size'.
|
||||
* @return One of the listed return codes.
|
||||
* @retval EINVAL In case of a NULL pointer.
|
||||
* @retval EXIT_SUCCESS In case of success.
|
||||
* @date 2014/06/26
|
||||
*/
|
||||
static int int_to_bytearray(uint64_t input, uint32_t input_size, uint8_t *output_byte);
|
||||
|
||||
/**
|
||||
* @brief Create the PCR_Extend command.
|
||||
* @param [in] *pcr_index_str User input string for PCR index.
|
||||
* @param [in] *pcr_digest_str User input string of value to extend the selected PCR with.
|
||||
* @param [out] *pcr_cmd_buf Return buffer for the complete command. Must be allocated by caller.
|
||||
* @param [in] *pcr_cmd_buf_size Size of memory allocated at pcr_cmd_buf in bytes.
|
||||
* @param [in] hash_algo Set to ALG_SHA1 for extending with SHA-1,
|
||||
ALG_SHA256 for SHA-256, and ALG_SHA384 for SHA-384.
|
||||
* @return One of the listed return codes.
|
||||
* @retval EINVAL In case of a NULL pointer or an invalid option.
|
||||
* @retval EXIT_SUCCESS In case of success.
|
||||
* @retval ERR_BAD_CMD In case of bad user input.
|
||||
* @retval hexstr_to_bytearray All error codes from hexstr_to_bytearray.
|
||||
* @date 2014/06/26
|
||||
*/
|
||||
static int pcr_extend(char *pcr_index_str, char *pcr_digest_str, uint8_t *pcr_cmd_buf, size_t pcr_cmd_buf_size, hash_algo_enum hash_algo);
|
||||
|
||||
/**
|
||||
* @brief Create the PCR_Allocate command.
|
||||
* @param [out] *pcr_cmd_buf Return buffer for the complete command.
|
||||
* @param [in] hash_algo Set to ALG_SHA1 to allocate SHA-1,
|
||||
ALG_SHA256 for SHA-256, and ALG_SHA384 for SHA-384.
|
||||
* @return One of the listed return codes.
|
||||
* @retval EINVAL In case of a NULL pointer or an invalid option.
|
||||
* @retval EXIT_SUCCESS In case of success.
|
||||
* @date 2022/05/09
|
||||
*/
|
||||
static int pcr_allocate(uint8_t *pcr_cmd_buf, hash_algo_enum hash_algo);
|
||||
|
||||
/**
|
||||
* @brief Create the PCR_Read command.
|
||||
* @param [in] *pcr_index_str User input string for PCR index.
|
||||
* @param [out] *pcr_cmd_buf Return buffer for the complete command.
|
||||
* @param [in] hash_algo Set to ALG_SHA1 for reading with SHA-1,
|
||||
ALG_SHA256 for SHA-256, and ALG_SHA384 for SHA-384.
|
||||
* @return One of the listed return codes.
|
||||
* @retval EINVAL In case of a NULL pointer or an invalid option.
|
||||
* @retval EXIT_SUCCESS In case of success.
|
||||
* @retval ERR_BAD_CMD In case of bad user input.
|
||||
* @retval hexstr_to_bytearray All error codes from hexstr_to_bytearray.
|
||||
* @date 2014/06/26
|
||||
*/
|
||||
static int pcr_read(char *pcr_index_str, uint8_t *pcr_cmd_buf, hash_algo_enum hash_algo);
|
||||
|
||||
/**
|
||||
* @brief Create the PCR_Reset command.
|
||||
* @param [in] *pcr_index_str User input string for PCR index.
|
||||
* @param [out] *pcr_cmd_buf Return buffer for the complete command.
|
||||
* @return One of the listed return codes.
|
||||
* @retval EINVAL In case of a NULL pointer.
|
||||
* @retval EXIT_SUCCESS In case of success.
|
||||
* @retval ERR_BAD_CMD In case of bad user input.
|
||||
* @retval hexstr_to_bytearray All error codes from hexstr_to_bytearray.
|
||||
* @date 2014/06/26
|
||||
*/
|
||||
static int pcr_reset(char *pcr_index_str, uint8_t *pcr_cmd_buf);
|
||||
|
||||
/**
|
||||
* @brief Print the command line usage and switches.
|
||||
* @date 2014/06/26
|
||||
*/
|
||||
static void print_help();
|
||||
|
||||
/**
|
||||
* @brief Print the response buffer in different formats.
|
||||
* @param [in] *response_buf TPM response.
|
||||
* @param [in] resp_size TPM response size.
|
||||
* @param [in] offset Starting point for printing buffer.
|
||||
* @param [in] format Select the output format.
|
||||
* @return One of the listed return codes.
|
||||
* @retval EINVAL In case of a NULL pointer or an unknown output format has been transfered.
|
||||
* @retval EXIT_SUCCESS In case of success.
|
||||
* @retval buf_to_uint64 All error codes from buf_to_uint64.
|
||||
* @date 2014/06/26
|
||||
*/
|
||||
static int print_response_buf(uint8_t *response_buf, size_t resp_size, uint32_t offset, int format);
|
||||
|
||||
/**
|
||||
* @brief Print a TPM response.
|
||||
* @param [in] *response_buf TPM response.
|
||||
* @param [in] resp_size TPM response size.
|
||||
* @param [in] option Defines appearance of output. Can have the following values:\n
|
||||
- PRINT_RESPONSE_CLEAR
|
||||
- PRINT_RESPONSE_HEADERBLOCKS
|
||||
- PRINT_RESPONSE_HEX_BLOCK
|
||||
- PRINT_RESPONSE_WITHOUT_HEADER
|
||||
- PRINT_RESPONSE_WITH_HEADER
|
||||
* @return One of the listed return codes.
|
||||
* @retval EINVAL In case of a NULL pointer.
|
||||
* @retval EXIT_SUCCESS In case of success.
|
||||
* @retval print_response_buf All error codes from print_response_buf.
|
||||
* @retval print_clock_info All error codes from print_clock_info.
|
||||
* @retval print_capability_flags All error codes from print_capability_flags.
|
||||
* @date 2014/06/26
|
||||
*/
|
||||
static int response_print(uint8_t *response_buf, size_t resp_size, int option);
|
||||
|
||||
/**
|
||||
* @brief Check a TPM response for errors.
|
||||
* @param [in] *response_buf TPM response. Must have at least a size of TPM_CMD_HEADER_SIZE bytes.
|
||||
* @return Returns the TPM return code extracted from the given TPM response or one of the listed return codes.
|
||||
* @retval EINVAL In case of a NULL pointer.
|
||||
* @retval buf_to_uint64 All error codes from buf_to_uint64.
|
||||
* @retval EXIT_SUCCESS In case of success.
|
||||
* @date 2014/06/26
|
||||
*/
|
||||
static int return_error_handling(uint8_t *response_buf);
|
||||
|
||||
/**
|
||||
* @brief Transmit TPM command to /dev/tpm0 and get the response.
|
||||
* @param [in] *buf TPM request.
|
||||
* @param [in] length TPM request length.
|
||||
* @param [out] *response TPM response.
|
||||
* @param [out] *resp_length TPM response length.
|
||||
* @return One of the listed return codes or the error code stored in the global errno system variable.
|
||||
* @retval EINVAL In case of a NULL pointer.
|
||||
* @retval EXIT_SUCCESS In case of success.
|
||||
* @date 2014/06/26
|
||||
*/
|
||||
static int tpmtool_transmit(const uint8_t *buf, ssize_t length, uint8_t *response, ssize_t *resp_length);
|
||||
|
||||
/**
|
||||
* @brief Print the capability flags.
|
||||
* @param [in] *response_buf TPM response.
|
||||
* @param [in] cap_selector Type of capabilities to print.
|
||||
* @return One of the listed return codes.
|
||||
* @retval EINVAL In case of a NULL pointer.
|
||||
* @retval EXIT_SUCCESS In case of success.
|
||||
* @retval buf_to_uint64 All error codes from buf_to_uint64.
|
||||
* @date 2014/06/26
|
||||
*/
|
||||
static int print_capability_flags(uint8_t *response_buf, uint8_t cap_selector);
|
||||
|
||||
/**
|
||||
* @brief Print the clock info.
|
||||
* @param [in] *response_buf TPM response.
|
||||
* @return One of the listed return codes.
|
||||
* @retval EINVAL In case of a NULL pointer.
|
||||
* @retval EXIT_SUCCESS In case of success.
|
||||
* @retval buf_to_uint64 All error codes from buf_to_uint64.
|
||||
* @date 2014/06/26
|
||||
*/
|
||||
static int print_clock_info(uint8_t *response_buf);
|
||||
|
||||
/**
|
||||
* @brief Create the get_random command.
|
||||
* @param [in] *data_length_string User input string for random data length.
|
||||
* @param [out] *response_buf Return buffer for the complete command.
|
||||
* @return One of the listed return codes.
|
||||
* @retval EINVAL In case of a NULL pointer.
|
||||
* @retval EXIT_SUCCESS In case of success.
|
||||
* @retval ERR_BAD_CMD In case of bad user input.
|
||||
* @retval hexstr_to_bytearray All error codes from hexstr_to_bytearray.
|
||||
* @date 2014/06/26
|
||||
*/
|
||||
static int get_random(char *data_length_string, uint8_t *response_buf);
|
||||
|
||||
/**
|
||||
* @brief Create the simple hash command.
|
||||
* @param [in] *data_string User input string of data to be hashed.
|
||||
* @param [in] hash_algo Set to ALG_SHA1 for hashing with SHA-1,
|
||||
ALG_SHA256 for SHA-256, and ALG_SHA384 for SHA-384.
|
||||
* @param [out] *hash_cmd_buf Return buffer for the complete command.
|
||||
* @param [in] hash_cmd_buf_size Return buffer size.
|
||||
* @return One of the listed return codes.
|
||||
* @retval EINVAL In case of a NULL pointer.
|
||||
* @retval EXIT_SUCCESS In case of success.
|
||||
* @retval hexstr_to_bytearray All error codes from hexstr_to_bytearray.
|
||||
* @retval int_to_bytearray All error codes from int_to_bytearray.
|
||||
* @date 2014/06/26
|
||||
*/
|
||||
static int create_hash(char *data_string, hash_algo_enum hash_algo, uint8_t *hash_cmd_buf, uint32_t hash_cmd_buf_size);
|
||||
|
||||
/**
|
||||
* @brief Create and transmit a sequence of TPM commands for hashing larger amounts of data.
|
||||
* @param [in] *data_string User input string of data to be hashed.
|
||||
* @param [in] hash_algo Set to ALG_SHA1 for hashing with SHA-1,
|
||||
ALG_SHA256 for SHA-256, and ALG_SHA384 for SHA-384.
|
||||
* @param [out] *tpm_response_buf TPM response.
|
||||
* @param [out] *tpm_response_buf_size Size of tpm_response_buf.
|
||||
* @return One of the listed return codes or the error code stored in the global errno system variable.
|
||||
* @retval EINVAL In case of a NULL pointer.
|
||||
* @retval EXIT_SUCCESS In case of success.
|
||||
* @retval value of errno In case of memory allocation error.
|
||||
* @retval buf_to_uint64 All error codes from buf_to_uint64.
|
||||
* @retval hexstr_to_bytearray All error codes from hexstr_to_bytearray.
|
||||
* @retval int_to_bytearray All error codes from int_to_bytearray.
|
||||
* @retval tpmtool_transmit All error codes from tpmtool_transmit.
|
||||
* @retval print_response_buf All error codes from print_response_buf
|
||||
* @date 2014/06/26
|
||||
*/
|
||||
static int create_hash_sequence(char *data_string, hash_algo_enum hash_algo, uint8_t *tpm_response_buf, ssize_t *tpm_response_buf_size);
|
||||
|
||||
//-------------"command bytes"-------------
|
||||
static const uint8_t tpm2_startup_clear[] = {
|
||||
0x80, 0x01, // TPM_ST_NO_SESSIONS
|
||||
0x00, 0x00, 0x00, 0x0C, // commandSize
|
||||
0x00, 0x00, 0x01, 0x44, // TPM_CC_Startup
|
||||
0x00, 0x00 // TPM_SU_CLEAR
|
||||
};
|
||||
|
||||
static const uint8_t tpm2_startup_state[] = {
|
||||
0x80, 0x01, // TPM_ST_NO_SESSIONS
|
||||
0x00, 0x00, 0x00, 0x0C, // commandSize
|
||||
0x00, 0x00, 0x01, 0x44, // TPM_CC_Startup
|
||||
0x00, 0x01 // TPM_SU_STATE
|
||||
};
|
||||
|
||||
static const uint8_t tpm_cc_shutdown_clear[] = {
|
||||
0x80, 0x01, // TPM_ST_NO_SESSIONS
|
||||
0x00, 0x00, 0x00, 0x0C, // commandSize
|
||||
0x00, 0x00, 0x01, 0x45, // TPM_CC_Shutdown
|
||||
0x00, 0x00 // TPM_SU_CLEAR
|
||||
};
|
||||
|
||||
static const uint8_t tpm_cc_shutdown_state[] = {
|
||||
0x80, 0x01, // TPM_ST_NO_SESSIONS
|
||||
0x00, 0x00, 0x00, 0x0C, // commandSize
|
||||
0x00, 0x00, 0x01, 0x45, // TPM_CC_Shutdown
|
||||
0x00, 0x01 // TPM_SU_STATE
|
||||
};
|
||||
|
||||
static const uint8_t tpm2_self_test[] = {
|
||||
0x80, 0x01, // TPM_ST_NO_SESSIONS
|
||||
0x00, 0x00, 0x00, 0x0B, // commandSize
|
||||
0x00, 0x00, 0x01, 0x43, // TPM_CC_SelfTest
|
||||
0x00 // fullTest=No
|
||||
};
|
||||
|
||||
static const uint8_t tpm2_self_test_full[] = {
|
||||
0x80, 0x01, // TPM_ST_NO_SESSIONS
|
||||
0x00, 0x00, 0x00, 0x0B, // commandSize
|
||||
0x00, 0x00, 0x01, 0x43, // TPM_CC_SelfTest
|
||||
0x01 // fullTest=Yes
|
||||
};
|
||||
|
||||
static const uint8_t tpm_cc_get_test_result[] = {
|
||||
0x80, 0x01, // TPM_ST_NO_SESSIONS
|
||||
0x00, 0x00, 0x00, 0x0A, // commandSize
|
||||
0x00, 0x00, 0x01, 0x7C // TPM_CC_GetTestResult
|
||||
};
|
||||
|
||||
static const uint8_t tpm2_self_test_incremental[] = {
|
||||
0x80, 0x01, // TPM_ST_NO_SESSIONS
|
||||
0x00, 0x00, 0x00, 0x2A, // commandSize
|
||||
0x00, 0x00, 0x01, 0x42, // TPM_CC_IncrementalSelfTest
|
||||
0x00, 0x00, 0x00, 0x0E, // Count of Algorithm
|
||||
0x00, 0x01, 0x00, 0x04, // Algorithm two per line
|
||||
0x00, 0x05, 0x00, 0x06,
|
||||
0x00, 0x08, 0x00, 0x0A,
|
||||
0x00, 0x0B, 0x00, 0x14,
|
||||
0x00, 0x15, 0x00, 0x16,
|
||||
0x00, 0x17, 0x00, 0x22,
|
||||
0x00, 0x25, 0x00, 0x43
|
||||
};
|
||||
|
||||
static const uint8_t tpm2_getrandom[] = {
|
||||
0x80, 0x01, // TPM_ST_NO_SESSIONS
|
||||
0x00, 0x00, 0x00, 0x0C, // commandSize
|
||||
0x00, 0x00, 0x01, 0x7B, // TPM_CC_GetRandom
|
||||
0x00, 0x00 // bytesRequested (will be set later)
|
||||
};
|
||||
|
||||
static const uint8_t tpm_cc_readclock[] = {
|
||||
0x80, 0x01, // TPM_ST_NO_SESSIONS
|
||||
0x00, 0x00, 0x00, 0x0A, // commandSize
|
||||
0x00, 0x00, 0x01, 0x81 // TPM_CC_ReadClock
|
||||
};
|
||||
|
||||
static const uint8_t tpm2_getcapability_fixed[] ={
|
||||
0x80, 0x01, // TPM_ST_NO_SESSIONS
|
||||
0x00, 0x00, 0x00, 0x16, // commandSize
|
||||
0x00, 0x00, 0x01, 0x7A, // TPM_CC_GetCapability
|
||||
0x00, 0x00, 0x00, 0x06, // TPM_CAP_TPM_PROPERTIES (Property Type: TPM_PT)
|
||||
0x00, 0x00, 0x01, 0x00, // Property: TPM_PT_FAMILY_INDICATOR: PT_GROUP * 1 + 0
|
||||
0x00, 0x00, 0x00, 0x66 // PropertyCount 102 (from 100 - 201)
|
||||
};
|
||||
|
||||
static const uint8_t tpm2_getcapability_var[] ={
|
||||
0x80, 0x01, // TPM_ST_NO_SESSIONS
|
||||
0x00, 0x00, 0x00, 0x16, // commandSize
|
||||
0x00, 0x00, 0x01, 0x7A, // TPM_CC_GetCapability
|
||||
0x00, 0x00, 0x00, 0x06, // TPM_CAP_TPM_PROPERTIES (Property Type: TPM_PT)
|
||||
0x00, 0x00, 0x02, 0x00, // Property: TPM_PT_FAMILY_INDICATOR: PT_GROUP * 2 + 0
|
||||
0x00, 0x00, 0x00, 0x02 // PropertyCount 02 (from 200 - 201)
|
||||
};
|
||||
|
||||
// Hash
|
||||
static const uint8_t tpm2_hash[] = {
|
||||
0x80, 0x01, // TPM_ST_NO_SESSIONS
|
||||
0x00, 0x00, 0x00, 0x0e, // commandSize
|
||||
0x00, 0x00, 0x01, 0x7D, // TPM_CC_Hash
|
||||
0x00, 0x00, // size (will be set later)
|
||||
// buffer (will be added later)
|
||||
0x00, 0x00, // hashAlg (will be added later)
|
||||
0x00, 0x00, 0x00, 0x00 // hierarchy of the ticket (TPM_RH_NULL; will be added later)
|
||||
};
|
||||
|
||||
// HashSequence
|
||||
static uint8_t tpm2_hash_sequence_start[] = {
|
||||
0x80, 0x01, // TPM_ST_NO_SESSIONS
|
||||
0x00, 0x00, 0x00, 0x0e, // commandSize
|
||||
0x00, 0x00, 0x01, 0x86, // TPM_CC_HashSequenceStart
|
||||
0x00, 0x00, // authSize (NULL Password)
|
||||
// null (indicate a NULL Password)
|
||||
0x00, 0x00 // hashAlg (will be set later)
|
||||
};
|
||||
|
||||
static uint8_t tpm2_sequence_update[] = {
|
||||
0x80, 0x02, // TPM_ST_SESSIONS
|
||||
0x00, 0x00, 0x00, 0x00, // commandSize (will be set later)
|
||||
0x00, 0x00, 0x01, 0x5c, // TPM_CC_SequenceUpdate
|
||||
0x00, 0x00, 0x00, 0x00, // sequenceHandle (will be set later)
|
||||
0x00, 0x00, // authSize (NULL Password)
|
||||
// null (indicate a NULL Password)
|
||||
0x00, 0x09, // authSize (password authorization session)
|
||||
0x40, 0x00, 0x00, 0x09, // TPM_RS_PW (indicate a password authorization session)
|
||||
0x00, 0x00, 0x01, 0x00, 0x00,
|
||||
0x00, 0x00 // size (will be set later)
|
||||
// buffer (will be added later)
|
||||
};
|
||||
|
||||
static uint8_t tpm2_sequence_complete[] = {
|
||||
0x80, 0x02, // TPM_ST_SESSIONS
|
||||
0x00, 0x00, 0x00, 0x21, // commandSize
|
||||
0x00, 0x00, 0x01, 0x3e, // TPM_CC_SequenceComplete
|
||||
0x00, 0x00, 0x00, 0x00, // sequenceHandle (will be set later)
|
||||
0x00, 0x00, // authSize (NULL Password)
|
||||
// null (indicate a NULL Password)
|
||||
0x00, 0x09, // authSize (password authorization session)
|
||||
0x40, 0x00, 0x00, 0x09, // TPM_RS_PW (indicate a password authorization session)
|
||||
0x00, 0x00, 0x01, 0x00, 0x00,
|
||||
0x00, 0x00, // size (NULL buffer)
|
||||
// null (indicate an empty buffer buffer)
|
||||
0x40, 0x00, 0x00, 0x07 // hierarchy of the ticket (TPM_RH_NULL)
|
||||
};
|
||||
|
||||
static const uint8_t sha1_alg[] = {
|
||||
0x00, 0x04 // command for sha1 alg
|
||||
};
|
||||
|
||||
static const uint8_t sha256_alg[] = {
|
||||
0x00, 0x0B // command for sha256 alg
|
||||
};
|
||||
|
||||
static const uint8_t sha384_alg[] = {
|
||||
0x00, 0x0C // command for sha384 alg
|
||||
};
|
||||
|
||||
static const uint8_t tpm_cc_hash_hierarchy[] = {
|
||||
0x40, 0x00, 0x00, 0x07 // hierarchy of the ticket (TPM_RH_NULL)
|
||||
};
|
||||
|
||||
//PCR_Command
|
||||
static const uint8_t tpm2_pcr_allocate[] = {
|
||||
0x80, 0x02, // TPM_ST_SESSIONS
|
||||
0x00, 0x00, 0x00, 0x31, // commandSize
|
||||
0x00, 0x00, 0x01, 0x2B, // TPM_CC_PCR_Allocate
|
||||
0x40, 0x00, 0x00, 0x0C, // TPM_RH_PLATFORM
|
||||
0x00, 0x00, // authSize (NULL Password)
|
||||
// null (indicate a NULL Password)
|
||||
0x00, 0x09, // authSize (password authorization session)
|
||||
0x40, 0x00, 0x00, 0x09, // TPM_RS_PW (indicate a password authorization session)
|
||||
0x00, 0x00, 0x01, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x03, // count (TPML_PCR_SELECTION)
|
||||
0x00, 0x04, // hash (TPMS_PCR_SELECTION; SHA-1)
|
||||
0x03, // sizeofSelect (TPMS_PCR_SELECTION)
|
||||
0x00, 0x00, 0x00, // pcrSelect (TPMS_PCR_SELECTION; will be set later)
|
||||
0x00, 0x0B, // hash (TPMS_PCR_SELECTION; SHA-256)
|
||||
0x03, // sizeofSelect (TPMS_PCR_SELECTION)
|
||||
0x00, 0x00, 0x00, // pcrSelect (TPMS_PCR_SELECTION; will be set later)
|
||||
0x00, 0x0C, // hash (TPMS_PCR_SELECTION; SHA-384)
|
||||
0x03, // sizeofSelect (TPMS_PCR_SELECTION)
|
||||
0x00, 0x00, 0x00 // pcrSelect (TPMS_PCR_SELECTION; will be set later)
|
||||
};
|
||||
|
||||
static const uint8_t tpm2_pcr_read[] = {
|
||||
0x80, 0x01, // TPM_ST_NO_SESSIONS
|
||||
0x00, 0x00, 0x00, 0x14, // commandSize
|
||||
0x00, 0x00, 0x01, 0x7E, // TPM_CC_PCR_Read
|
||||
0x00, 0x00, 0x00, 0x01, // count (TPML_PCR_SELECTION)
|
||||
0x00, 0x00, // hash (TPMS_PCR_SELECTION; will be set later)
|
||||
0x03, // sizeofSelect (TPMS_PCR_SELECTION)
|
||||
0x00, 0x00, 0x00 // pcrSelect (TPMS_PCR_SELECTION)
|
||||
};
|
||||
|
||||
static const uint8_t tpm2_pcr_extend[] = {
|
||||
0x80, 0x02, // TPM_ST_SESSIONS
|
||||
0x00, 0x00, 0x00, 0x00, // commandSize (will be set later)
|
||||
0x00, 0x00, 0x01, 0x82, // TPM_CC_PCR_Extend
|
||||
0x00, 0x00, 0x00, 0x00, // {PCR_FIRST:PCR_LAST} (TPMI_DH_PCR)
|
||||
0x00, 0x00, // authSize (NULL Password)
|
||||
// null (indicate a NULL Password)
|
||||
0x00, 0x09, // authSize (password authorization session)
|
||||
0x40, 0x00, 0x00, 0x09, // TPM_RS_PW (indicate a password authorization session)
|
||||
0x00, 0x00, 0x01, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x01, // count (TPML_DIGEST_VALUES)
|
||||
0x00, 0x00 // hashAlg (TPMT_HA; will be set later)
|
||||
// digest (TPMT_HA; will be added later)
|
||||
};
|
||||
|
||||
static const uint8_t tpm2_pcr_reset[] = {
|
||||
0x80, 0x02, // TPM_ST_SESSIONS
|
||||
0x00, 0x00, 0x00, 0x1B, // commandSize
|
||||
0x00, 0x00, 0x01, 0x3D, // TPM_CC_PCR_Reset
|
||||
0x00, 0x00, 0x00, 0x00, // {PCR_FIRST:PCR_LAST} (TPMI_DH_PCR)
|
||||
0x00, 0x00, // authSize (NULL Password)
|
||||
// null (indicate a NULL Password)
|
||||
0x00, 0x09, // authSize (password authorization session)
|
||||
0x40, 0x00, 0x00, 0x09, // TPM_RS_PW (indicate a password authorization session)
|
||||
0x00, 0x00, 0x01, 0x00, 0x00
|
||||
};
|
||||
|
||||
#endif /* _ELTT2_H_ */
|
||||
@@ -1,108 +0,0 @@
|
||||
# wpa_supplicant config
|
||||
config WPA_RFKILL_SUPPORT
|
||||
bool "Add rfkill support"
|
||||
depends on PACKAGE_wpa-supplicant || \
|
||||
PACKAGE_wpa-supplicant-openssl || \
|
||||
PACKAGE_wpa-supplicant-wolfssl || \
|
||||
PACKAGE_wpa-supplicant-mbedtls || \
|
||||
PACKAGE_wpa-supplicant-mesh-openssl || \
|
||||
PACKAGE_wpa-supplicant-mesh-wolfssl || \
|
||||
PACKAGE_wpa-supplicant-mesh-mbedtls || \
|
||||
PACKAGE_wpa-supplicant-basic || \
|
||||
PACKAGE_wpa-supplicant-mini || \
|
||||
PACKAGE_wpa-supplicant-p2p || \
|
||||
PACKAGE_wpad || \
|
||||
PACKAGE_wpad-openssl || \
|
||||
PACKAGE_wpad-wolfssl || \
|
||||
PACKAGE_wpad-mbedtls || \
|
||||
PACKAGE_wpad-basic || \
|
||||
PACKAGE_wpad-basic-openssl || \
|
||||
PACKAGE_wpad-basic-wolfssl || \
|
||||
PACKAGE_wpad-basic-mbedtls || \
|
||||
PACKAGE_wpad-mini || \
|
||||
PACKAGE_wpad-mesh-openssl || \
|
||||
PACKAGE_wpad-mesh-wolfssl || \
|
||||
PACKAGE_wpad-mesh-mbedtls
|
||||
default n
|
||||
|
||||
config WPA_MSG_MIN_PRIORITY
|
||||
int "Minimum debug message priority"
|
||||
depends on PACKAGE_wpa-supplicant || \
|
||||
PACKAGE_wpa-supplicant-openssl || \
|
||||
PACKAGE_wpa-supplicant-wolfssl || \
|
||||
PACKAGE_wpa-supplicant-mbedtls || \
|
||||
PACKAGE_wpa-supplicant-mesh-openssl || \
|
||||
PACKAGE_wpa-supplicant-mesh-wolfssl || \
|
||||
PACKAGE_wpa-supplicant-mesh-mbedtls || \
|
||||
PACKAGE_wpa-supplicant-basic || \
|
||||
PACKAGE_wpa-supplicant-mini || \
|
||||
PACKAGE_wpa-supplicant-p2p || \
|
||||
PACKAGE_wpad || \
|
||||
PACKAGE_wpad-openssl || \
|
||||
PACKAGE_wpad-wolfssl || \
|
||||
PACKAGE_wpad-mbedtls || \
|
||||
PACKAGE_wpad-basic || \
|
||||
PACKAGE_wpad-basic-openssl || \
|
||||
PACKAGE_wpad-basic-wolfssl || \
|
||||
PACKAGE_wpad-basic-mbedtls || \
|
||||
PACKAGE_wpad-mini || \
|
||||
PACKAGE_wpad-mesh-openssl || \
|
||||
PACKAGE_wpad-mesh-wolfssl || \
|
||||
PACKAGE_wpad-mesh-mbedtls
|
||||
default 3
|
||||
help
|
||||
Useful values are:
|
||||
0 = all messages
|
||||
1 = raw message dumps
|
||||
2 = most debugging messages
|
||||
3 = info messages
|
||||
4 = warnings
|
||||
5 = errors
|
||||
|
||||
config WPA_WOLFSSL
|
||||
bool
|
||||
default PACKAGE_wpa-supplicant-wolfssl ||\
|
||||
PACKAGE_wpad-wolfssl ||\
|
||||
PACKAGE_wpad-basic-wolfssl || \
|
||||
PACKAGE_wpad-mesh-wolfssl ||\
|
||||
PACKAGE_eapol-test-wolfssl
|
||||
select WOLFSSL_HAS_AES_CCM
|
||||
select WOLFSSL_HAS_ARC4
|
||||
select WOLFSSL_HAS_DH
|
||||
select WOLFSSL_HAS_OCSP
|
||||
select WOLFSSL_HAS_SESSION_TICKET
|
||||
select WOLFSSL_HAS_WPAS
|
||||
|
||||
config DRIVER_11AC_SUPPORT
|
||||
bool
|
||||
default n
|
||||
|
||||
config DRIVER_11AX_SUPPORT
|
||||
bool
|
||||
default n
|
||||
select WPA_MBO_SUPPORT
|
||||
|
||||
config WPA_ENABLE_WEP
|
||||
bool "Enable support for unsecure and obsolete WEP"
|
||||
help
|
||||
Wired equivalent privacy (WEP) is an obsolete cryptographic data
|
||||
confidentiality algorithm that is not considered secure. It should not be used
|
||||
for anything anymore. The functionality needed to use WEP is available in the
|
||||
current hostapd release under this optional build parameter and completely
|
||||
removed in a future release.
|
||||
|
||||
config WPA_MBO_SUPPORT
|
||||
bool "Multi Band Operation (Agile Multiband)"
|
||||
default PACKAGE_wpa-supplicant || \
|
||||
PACKAGE_wpa-supplicant-openssl || \
|
||||
PACKAGE_wpa-supplicant-wolfssl || \
|
||||
PACKAGE_wpa-supplicant-mbedtls || \
|
||||
PACKAGE_wpad || \
|
||||
PACKAGE_wpad-openssl || \
|
||||
PACKAGE_wpad-wolfssl || \
|
||||
PACKAGE_wpad-mbedtls
|
||||
help
|
||||
Multi Band Operation aka (Agile Multiband) enables features
|
||||
that facilitate efficient use of multiple frequency bands.
|
||||
Enabling MBO on an AP using RSN requires 802.11w to be enabled.
|
||||
Hostapd will refuse to start if MBO and RSN are enabled without 11w.
|
||||
@@ -1,851 +0,0 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
#
|
||||
# Copyright (C) 2006-2021 OpenWrt.org
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=hostapd
|
||||
PKG_RELEASE:=4
|
||||
|
||||
PKG_SOURCE_URL:=http://w1.fi/hostap.git
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_DATE:=2023-09-08
|
||||
PKG_SOURCE_VERSION:=e5ccbfc69ecf297590341ae8b461edba9d8e964c
|
||||
PKG_MIRROR_HASH:=4d71097b8e3b91b5c21c2bba7a1e68415bd21d972fddbffa9ef130877d81b347
|
||||
|
||||
PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
|
||||
PKG_LICENSE:=BSD-3-Clause
|
||||
PKG_CPE_ID:=cpe:/a:w1.fi:hostapd
|
||||
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
PKG_ASLR_PIE_REGULAR:=1
|
||||
|
||||
PKG_CONFIG_DEPENDS:= \
|
||||
CONFIG_PACKAGE_hostapd \
|
||||
CONFIG_PACKAGE_hostapd-basic \
|
||||
CONFIG_PACKAGE_hostapd-mini \
|
||||
CONFIG_WPA_RFKILL_SUPPORT \
|
||||
CONFIG_DRIVER_11AC_SUPPORT \
|
||||
CONFIG_DRIVER_11AX_SUPPORT \
|
||||
CONFIG_WPA_ENABLE_WEP
|
||||
|
||||
PKG_BUILD_FLAGS:=gc-sections lto
|
||||
|
||||
EAPOL_TEST_PROVIDERS:=eapol-test eapol-test-openssl eapol-test-wolfssl
|
||||
|
||||
SUPPLICANT_PROVIDERS:=
|
||||
HOSTAPD_PROVIDERS:=
|
||||
|
||||
LOCAL_TYPE=$(strip \
|
||||
$(if $(findstring wpad,$(BUILD_VARIANT)),wpad, \
|
||||
$(if $(findstring supplicant,$(BUILD_VARIANT)),supplicant, \
|
||||
hostapd \
|
||||
)))
|
||||
|
||||
LOCAL_AND_LIB_VARIANT=$(patsubst hostapd-%,%,\
|
||||
$(patsubst wpad-%,%,\
|
||||
$(patsubst supplicant-%,%,\
|
||||
$(BUILD_VARIANT)\
|
||||
)))
|
||||
|
||||
LOCAL_VARIANT=$(patsubst %-internal,%,\
|
||||
$(patsubst %-openssl,%,\
|
||||
$(patsubst %-wolfssl,%,\
|
||||
$(patsubst %-mbedtls,%,\
|
||||
$(LOCAL_AND_LIB_VARIANT)\
|
||||
))))
|
||||
|
||||
SSL_VARIANT=$(strip \
|
||||
$(if $(findstring openssl,$(LOCAL_AND_LIB_VARIANT)),openssl,\
|
||||
$(if $(findstring wolfssl,$(LOCAL_AND_LIB_VARIANT)),wolfssl,\
|
||||
$(if $(findstring mbedtls,$(LOCAL_AND_LIB_VARIANT)),mbedtls,\
|
||||
internal\
|
||||
))))
|
||||
|
||||
CONFIG_VARIANT:=$(LOCAL_VARIANT)
|
||||
ifeq ($(LOCAL_VARIANT),mesh)
|
||||
CONFIG_VARIANT:=full
|
||||
endif
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
STAMP_CONFIGURED:=$(STAMP_CONFIGURED)_$(CONFIG_WPA_MSG_MIN_PRIORITY)
|
||||
|
||||
ifneq ($(CONFIG_DRIVER_11AC_SUPPORT),)
|
||||
HOSTAPD_IEEE80211AC:=y
|
||||
endif
|
||||
|
||||
ifneq ($(CONFIG_DRIVER_11AX_SUPPORT),)
|
||||
HOSTAPD_IEEE80211AX:=y
|
||||
endif
|
||||
|
||||
CORE_DEPENDS = +ucode +libubus +libucode +ucode-mod-fs +ucode-mod-nl80211 +ucode-mod-rtnl +ucode-mod-ubus +ucode-mod-uloop +libblobmsg-json
|
||||
OPENSSL_DEPENDS = +PACKAGE_$(1):libopenssl +PACKAGE_$(1):libopenssl-legacy
|
||||
|
||||
DRIVER_MAKEOPTS= \
|
||||
CONFIG_ACS=y CONFIG_DRIVER_NL80211=y \
|
||||
CONFIG_IEEE80211AC=$(HOSTAPD_IEEE80211AC) \
|
||||
CONFIG_IEEE80211AX=$(HOSTAPD_IEEE80211AX) \
|
||||
CONFIG_MBO=$(CONFIG_WPA_MBO_SUPPORT) \
|
||||
CONFIG_UCODE=y
|
||||
|
||||
ifeq ($(SSL_VARIANT),openssl)
|
||||
DRIVER_MAKEOPTS += CONFIG_TLS=openssl CONFIG_SAE=y
|
||||
TARGET_LDFLAGS += -lcrypto -lssl
|
||||
|
||||
ifeq ($(LOCAL_VARIANT),basic)
|
||||
DRIVER_MAKEOPTS += CONFIG_OWE=y
|
||||
endif
|
||||
ifeq ($(LOCAL_VARIANT),mesh)
|
||||
DRIVER_MAKEOPTS += CONFIG_AP=y CONFIG_MESH=y
|
||||
endif
|
||||
ifeq ($(LOCAL_VARIANT),full)
|
||||
DRIVER_MAKEOPTS += CONFIG_OWE=y CONFIG_SUITEB192=y CONFIG_AP=y CONFIG_MESH=y
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(SSL_VARIANT),wolfssl)
|
||||
DRIVER_MAKEOPTS += CONFIG_TLS=wolfssl CONFIG_SAE=y
|
||||
TARGET_LDFLAGS += -lwolfssl
|
||||
|
||||
ifeq ($(LOCAL_VARIANT),basic)
|
||||
DRIVER_MAKEOPTS += CONFIG_OWE=y
|
||||
endif
|
||||
ifeq ($(LOCAL_VARIANT),mesh)
|
||||
DRIVER_MAKEOPTS += CONFIG_AP=y CONFIG_MESH=y CONFIG_WPS_NFC=1
|
||||
endif
|
||||
ifeq ($(LOCAL_VARIANT),full)
|
||||
DRIVER_MAKEOPTS += CONFIG_OWE=y CONFIG_SUITEB192=y CONFIG_AP=y CONFIG_MESH=y CONFIG_WPS_NFC=1
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(SSL_VARIANT),mbedtls)
|
||||
DRIVER_MAKEOPTS += CONFIG_TLS=mbedtls CONFIG_SAE=y
|
||||
TARGET_LDFLAGS += -lmbedcrypto -lmbedx509 -lmbedtls
|
||||
|
||||
ifeq ($(LOCAL_VARIANT),basic)
|
||||
DRIVER_MAKEOPTS += CONFIG_OWE=y
|
||||
endif
|
||||
ifeq ($(LOCAL_VARIANT),mesh)
|
||||
DRIVER_MAKEOPTS += CONFIG_AP=y CONFIG_MESH=y CONFIG_WPS_NFC=1
|
||||
endif
|
||||
ifeq ($(LOCAL_VARIANT),full)
|
||||
DRIVER_MAKEOPTS += CONFIG_OWE=y CONFIG_SUITEB192=y CONFIG_AP=y CONFIG_MESH=y CONFIG_WPS_NFC=1
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($(LOCAL_TYPE),hostapd)
|
||||
ifdef CONFIG_WPA_RFKILL_SUPPORT
|
||||
DRIVER_MAKEOPTS += NEED_RFKILL=y
|
||||
endif
|
||||
endif
|
||||
|
||||
DRV_DEPENDS:=+libnl-tiny
|
||||
|
||||
|
||||
define Package/hostapd/Default
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
SUBMENU:=WirelessAPD
|
||||
TITLE:=IEEE 802.1x Authenticator
|
||||
URL:=http://hostap.epitest.fi/
|
||||
DEPENDS:=$(DRV_DEPENDS) +hostapd-common $(CORE_DEPENDS)
|
||||
EXTRA_DEPENDS:=hostapd-common (=$(PKG_VERSION)-r$(PKG_RELEASE))
|
||||
USERID:=network=101:network=101
|
||||
PROVIDES:=hostapd
|
||||
CONFLICTS:=$(HOSTAPD_PROVIDERS)
|
||||
HOSTAPD_PROVIDERS+=$(1)
|
||||
endef
|
||||
|
||||
define Package/hostapd
|
||||
$(call Package/hostapd/Default,$(1))
|
||||
TITLE+= (built-in full)
|
||||
VARIANT:=full-internal
|
||||
endef
|
||||
|
||||
define Package/hostapd/description
|
||||
This package contains a full featured IEEE 802.1x/WPA/EAP/RADIUS
|
||||
Authenticator.
|
||||
endef
|
||||
|
||||
define Package/hostapd-openssl
|
||||
$(call Package/hostapd/Default,$(1))
|
||||
TITLE+= (OpenSSL full)
|
||||
VARIANT:=full-openssl
|
||||
DEPENDS+=$(OPENSSL_DEPENDS)
|
||||
endef
|
||||
|
||||
Package/hostapd-openssl/description = $(Package/hostapd/description)
|
||||
|
||||
define Package/hostapd-wolfssl
|
||||
$(call Package/hostapd/Default,$(1))
|
||||
TITLE+= (wolfSSL full)
|
||||
VARIANT:=full-wolfssl
|
||||
DEPENDS+=+PACKAGE_hostapd-wolfssl:libwolfssl
|
||||
endef
|
||||
|
||||
Package/hostapd-wolfssl/description = $(Package/hostapd/description)
|
||||
|
||||
define Package/hostapd-mbedtls
|
||||
$(call Package/hostapd/Default,$(1))
|
||||
TITLE+= (mbedTLS full)
|
||||
VARIANT:=full-mbedtls
|
||||
DEPENDS+=+PACKAGE_hostapd-mbedtls:libmbedtls
|
||||
endef
|
||||
|
||||
Package/hostapd-mbedtls/description = $(Package/hostapd/description)
|
||||
|
||||
define Package/hostapd-basic
|
||||
$(call Package/hostapd/Default,$(1))
|
||||
TITLE+= (WPA-PSK, 11r, 11w)
|
||||
VARIANT:=basic
|
||||
endef
|
||||
|
||||
define Package/hostapd-basic/description
|
||||
This package contains a basic IEEE 802.1x/WPA Authenticator with WPA-PSK, 802.11r and 802.11w support.
|
||||
endef
|
||||
|
||||
define Package/hostapd-basic-openssl
|
||||
$(call Package/hostapd/Default,$(1))
|
||||
TITLE+= (WPA-PSK, 11r and 11w)
|
||||
VARIANT:=basic-openssl
|
||||
DEPENDS+=+PACKAGE_hostapd-basic-openssl:libopenssl
|
||||
endef
|
||||
|
||||
define Package/hostapd-basic-openssl/description
|
||||
This package contains a basic IEEE 802.1x/WPA Authenticator with WPA-PSK, 802.11r and 802.11w support.
|
||||
endef
|
||||
|
||||
define Package/hostapd-basic-wolfssl
|
||||
$(call Package/hostapd/Default,$(1))
|
||||
TITLE+= (WPA-PSK, 11r and 11w)
|
||||
VARIANT:=basic-wolfssl
|
||||
DEPENDS+=+PACKAGE_hostapd-basic-wolfssl:libwolfssl
|
||||
endef
|
||||
|
||||
define Package/hostapd-basic-wolfssl/description
|
||||
This package contains a basic IEEE 802.1x/WPA Authenticator with WPA-PSK, 802.11r and 802.11w support.
|
||||
endef
|
||||
|
||||
define Package/hostapd-basic-mbedtls
|
||||
$(call Package/hostapd/Default,$(1))
|
||||
TITLE+= (WPA-PSK, 11r and 11w)
|
||||
VARIANT:=basic-mbedtls
|
||||
DEPENDS+=+PACKAGE_hostapd-basic-mbedtls:libmbedtls
|
||||
endef
|
||||
|
||||
define Package/hostapd-basic-mbedtls/description
|
||||
This package contains a basic IEEE 802.1x/WPA Authenticator with WPA-PSK, 802.11r and 802.11w support.
|
||||
endef
|
||||
|
||||
define Package/hostapd-mini
|
||||
$(call Package/hostapd/Default,$(1))
|
||||
TITLE+= (WPA-PSK only)
|
||||
VARIANT:=mini
|
||||
endef
|
||||
|
||||
define Package/hostapd-mini/description
|
||||
This package contains a minimal IEEE 802.1x/WPA Authenticator (WPA-PSK only).
|
||||
endef
|
||||
|
||||
|
||||
define Package/wpad/Default
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
SUBMENU:=WirelessAPD
|
||||
TITLE:=IEEE 802.1x Auth/Supplicant
|
||||
DEPENDS:=$(DRV_DEPENDS) +hostapd-common $(CORE_DEPENDS)
|
||||
EXTRA_DEPENDS:=hostapd-common (=$(PKG_VERSION)-r$(PKG_RELEASE))
|
||||
USERID:=network=101:network=101
|
||||
URL:=http://hostap.epitest.fi/
|
||||
PROVIDES:=hostapd wpa-supplicant
|
||||
CONFLICTS:=$(HOSTAPD_PROVIDERS) $(SUPPLICANT_PROVIDERS)
|
||||
HOSTAPD_PROVIDERS+=$(1)
|
||||
SUPPLICANT_PROVIDERS+=$(1)
|
||||
endef
|
||||
|
||||
define Package/wpad
|
||||
$(call Package/wpad/Default,$(1))
|
||||
TITLE+= (built-in full)
|
||||
VARIANT:=wpad-full-internal
|
||||
endef
|
||||
|
||||
define Package/wpad/description
|
||||
This package contains a full featured IEEE 802.1x/WPA/EAP/RADIUS
|
||||
Authenticator and Supplicant
|
||||
endef
|
||||
|
||||
define Package/wpad-openssl
|
||||
$(call Package/wpad/Default,$(1))
|
||||
TITLE+= (OpenSSL full)
|
||||
VARIANT:=wpad-full-openssl
|
||||
DEPENDS+=$(OPENSSL_DEPENDS)
|
||||
endef
|
||||
|
||||
Package/wpad-openssl/description = $(Package/wpad/description)
|
||||
|
||||
define Package/wpad-wolfssl
|
||||
$(call Package/wpad/Default,$(1))
|
||||
TITLE+= (wolfSSL full)
|
||||
VARIANT:=wpad-full-wolfssl
|
||||
DEPENDS+=+PACKAGE_wpad-wolfssl:libwolfssl
|
||||
endef
|
||||
|
||||
Package/wpad-wolfssl/description = $(Package/wpad/description)
|
||||
|
||||
define Package/wpad-mbedtls
|
||||
$(call Package/wpad/Default,$(1))
|
||||
TITLE+= (mbedTLS full)
|
||||
VARIANT:=wpad-full-mbedtls
|
||||
DEPENDS+=+PACKAGE_wpad-mbedtls:libmbedtls
|
||||
endef
|
||||
|
||||
Package/wpad-mbedtls/description = $(Package/wpad/description)
|
||||
|
||||
define Package/wpad-basic
|
||||
$(call Package/wpad/Default,$(1))
|
||||
TITLE+= (WPA-PSK, 11r, 11w)
|
||||
VARIANT:=wpad-basic
|
||||
endef
|
||||
|
||||
define Package/wpad-basic/description
|
||||
This package contains a basic IEEE 802.1x/WPA Authenticator and Supplicant with WPA-PSK, 802.11r and 802.11w support.
|
||||
endef
|
||||
|
||||
define Package/wpad-basic-openssl
|
||||
$(call Package/wpad/Default,$(1))
|
||||
TITLE+= (OpenSSL, 11r, 11w)
|
||||
VARIANT:=wpad-basic-openssl
|
||||
DEPENDS+=$(OPENSSL_DEPENDS)
|
||||
endef
|
||||
|
||||
define Package/wpad-basic-openssl/description
|
||||
This package contains a basic IEEE 802.1x/WPA Authenticator and Supplicant with WPA-PSK, SAE (WPA3-Personal), 802.11r and 802.11w support.
|
||||
endef
|
||||
|
||||
define Package/wpad-basic-wolfssl
|
||||
$(call Package/wpad/Default,$(1))
|
||||
TITLE+= (wolfSSL, 11r, 11w)
|
||||
VARIANT:=wpad-basic-wolfssl
|
||||
DEPENDS+=+PACKAGE_wpad-basic-wolfssl:libwolfssl
|
||||
endef
|
||||
|
||||
define Package/wpad-basic-wolfssl/description
|
||||
This package contains a basic IEEE 802.1x/WPA Authenticator and Supplicant with WPA-PSK, SAE (WPA3-Personal), 802.11r and 802.11w support.
|
||||
endef
|
||||
|
||||
define Package/wpad-basic-mbedtls
|
||||
$(call Package/wpad/Default,$(1))
|
||||
TITLE+= (mbedTLS, 11r, 11w)
|
||||
VARIANT:=wpad-basic-mbedtls
|
||||
DEPENDS+=+PACKAGE_wpad-basic-mbedtls:libmbedtls
|
||||
endef
|
||||
|
||||
define Package/wpad-basic-mbedtls/description
|
||||
This package contains a basic IEEE 802.1x/WPA Authenticator and Supplicant with WPA-PSK, SAE (WPA3-Personal), 802.11r and 802.11w support.
|
||||
endef
|
||||
|
||||
define Package/wpad-mini
|
||||
$(call Package/wpad/Default,$(1))
|
||||
TITLE+= (WPA-PSK only)
|
||||
VARIANT:=wpad-mini
|
||||
endef
|
||||
|
||||
define Package/wpad-mini/description
|
||||
This package contains a minimal IEEE 802.1x/WPA Authenticator and Supplicant (WPA-PSK only).
|
||||
endef
|
||||
|
||||
define Package/wpad-mesh
|
||||
$(call Package/wpad/Default,$(1))
|
||||
DEPENDS+=@(!TARGET_uml||BROKEN)
|
||||
PROVIDES+=wpa-supplicant-mesh wpad-mesh
|
||||
endef
|
||||
|
||||
define Package/wpad-mesh/description
|
||||
This package contains a minimal IEEE 802.1x/WPA Authenticator and Supplicant (with 802.11s mesh and SAE support).
|
||||
endef
|
||||
|
||||
define Package/wpad-mesh-openssl
|
||||
$(call Package/wpad-mesh,$(1))
|
||||
TITLE+= (OpenSSL, 11s, SAE)
|
||||
DEPENDS+=$(OPENSSL_DEPENDS)
|
||||
VARIANT:=wpad-mesh-openssl
|
||||
endef
|
||||
|
||||
Package/wpad-mesh-openssl/description = $(Package/wpad-mesh/description)
|
||||
|
||||
define Package/wpad-mesh-wolfssl
|
||||
$(call Package/wpad-mesh,$(1))
|
||||
TITLE+= (wolfSSL, 11s, SAE)
|
||||
DEPENDS+=+PACKAGE_wpad-mesh-wolfssl:libwolfssl
|
||||
VARIANT:=wpad-mesh-wolfssl
|
||||
endef
|
||||
|
||||
Package/wpad-mesh-wolfssl/description = $(Package/wpad-mesh/description)
|
||||
|
||||
define Package/wpad-mesh-mbedtls
|
||||
$(call Package/wpad-mesh,$(1))
|
||||
TITLE+= (mbedTLS, 11s, SAE)
|
||||
DEPENDS+=+PACKAGE_wpad-mesh-mbedtls:libmbedtls
|
||||
VARIANT:=wpad-mesh-mbedtls
|
||||
endef
|
||||
|
||||
Package/wpad-mesh-mbedtls/description = $(Package/wpad-mesh/description)
|
||||
|
||||
|
||||
define Package/wpa-supplicant/Default
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
SUBMENU:=WirelessAPD
|
||||
TITLE:=WPA Supplicant
|
||||
URL:=http://hostap.epitest.fi/wpa_supplicant/
|
||||
DEPENDS:=$(DRV_DEPENDS) +hostapd-common $(CORE_DEPENDS)
|
||||
EXTRA_DEPENDS:=hostapd-common (=$(PKG_VERSION)-r$(PKG_RELEASE))
|
||||
USERID:=network=101:network=101
|
||||
PROVIDES:=wpa-supplicant
|
||||
CONFLICTS:=$(SUPPLICANT_PROVIDERS)
|
||||
SUPPLICANT_PROVIDERS+=$(1)
|
||||
endef
|
||||
|
||||
define Package/wpa-supplicant
|
||||
$(call Package/wpa-supplicant/Default,$(1))
|
||||
TITLE+= (built-in full)
|
||||
VARIANT:=supplicant-full-internal
|
||||
endef
|
||||
|
||||
define Package/wpa-supplicant-openssl
|
||||
$(call Package/wpa-supplicant/Default,$(1))
|
||||
TITLE+= (OpenSSL full)
|
||||
VARIANT:=supplicant-full-openssl
|
||||
DEPENDS+=$(OPENSSL_DEPENDS)
|
||||
endef
|
||||
|
||||
define Package/wpa-supplicant-wolfssl
|
||||
$(call Package/wpa-supplicant/Default,$(1))
|
||||
TITLE+= (wolfSSL full)
|
||||
VARIANT:=supplicant-full-wolfssl
|
||||
DEPENDS+=+PACKAGE_wpa-supplicant-wolfssl:libwolfssl
|
||||
endef
|
||||
|
||||
define Package/wpa-supplicant-mbedtls
|
||||
$(call Package/wpa-supplicant/Default,$(1))
|
||||
TITLE+= (mbedTLS full)
|
||||
VARIANT:=supplicant-full-mbedtls
|
||||
DEPENDS+=+PACKAGE_wpa-supplicant-mbedtls:libmbedtls
|
||||
endef
|
||||
|
||||
define Package/wpa-supplicant/config
|
||||
source "$(SOURCE)/Config.in"
|
||||
endef
|
||||
|
||||
define Package/wpa-supplicant-p2p
|
||||
$(call Package/wpa-supplicant/Default,$(1))
|
||||
TITLE+= (Wi-Fi P2P support)
|
||||
VARIANT:=supplicant-p2p-internal
|
||||
endef
|
||||
|
||||
define Package/wpa-supplicant-mesh/Default
|
||||
$(call Package/wpa-supplicant/Default,$(1))
|
||||
DEPENDS+=@(!TARGET_uml||BROKEN)
|
||||
PROVIDES+=wpa-supplicant-mesh
|
||||
endef
|
||||
|
||||
define Package/wpa-supplicant-mesh-openssl
|
||||
$(call Package/wpa-supplicant-mesh/Default,$(1))
|
||||
TITLE+= (OpenSSL, 11s, SAE)
|
||||
VARIANT:=supplicant-mesh-openssl
|
||||
DEPENDS+=$(OPENSSL_DEPENDS)
|
||||
endef
|
||||
|
||||
define Package/wpa-supplicant-mesh-wolfssl
|
||||
$(call Package/wpa-supplicant-mesh/Default,$(1))
|
||||
TITLE+= (wolfSSL, 11s, SAE)
|
||||
VARIANT:=supplicant-mesh-wolfssl
|
||||
DEPENDS+=+PACKAGE_wpa-supplicant-mesh-wolfssl:libwolfssl
|
||||
endef
|
||||
|
||||
define Package/wpa-supplicant-mesh-mbedtls
|
||||
$(call Package/wpa-supplicant-mesh/Default,$(1))
|
||||
TITLE+= (mbedTLS, 11s, SAE)
|
||||
VARIANT:=supplicant-mesh-mbedtls
|
||||
DEPENDS+=+PACKAGE_wpa-supplicant-mesh-mbedtls:libmbedtls
|
||||
endef
|
||||
|
||||
define Package/wpa-supplicant-basic
|
||||
$(call Package/wpa-supplicant/Default,$(1))
|
||||
TITLE+= (11r, 11w)
|
||||
VARIANT:=supplicant-basic
|
||||
endef
|
||||
|
||||
define Package/wpa-supplicant-mini
|
||||
$(call Package/wpa-supplicant/Default,$(1))
|
||||
TITLE+= (minimal)
|
||||
VARIANT:=supplicant-mini
|
||||
endef
|
||||
|
||||
|
||||
define Package/hostapd-common
|
||||
TITLE:=hostapd/wpa_supplicant common support files
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
SUBMENU:=WirelessAPD
|
||||
endef
|
||||
|
||||
define Package/hostapd-utils
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
SUBMENU:=WirelessAPD
|
||||
TITLE:=IEEE 802.1x Authenticator (utils)
|
||||
URL:=http://hostap.epitest.fi/
|
||||
DEPENDS:=@$(subst $(space),||,$(foreach pkg,$(HOSTAPD_PROVIDERS),PACKAGE_$(pkg)))
|
||||
VARIANT:=*
|
||||
endef
|
||||
|
||||
define Package/hostapd-utils/description
|
||||
This package contains a command line utility to control the
|
||||
IEEE 802.1x/WPA/EAP/RADIUS Authenticator.
|
||||
endef
|
||||
|
||||
define Package/wpa-cli
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
SUBMENU:=WirelessAPD
|
||||
DEPENDS:=@$(subst $(space),||,$(foreach pkg,$(SUPPLICANT_PROVIDERS),PACKAGE_$(pkg)))
|
||||
TITLE:=WPA Supplicant command line control utility
|
||||
VARIANT:=*
|
||||
endef
|
||||
|
||||
define Package/eapol-test/Default
|
||||
TITLE:=802.1x auth test utility
|
||||
SECTION:=net
|
||||
SUBMENU:=WirelessAPD
|
||||
CATEGORY:=Network
|
||||
DEPENDS:=$(DRV_DEPENDS) $(CORE_DEPENDS)
|
||||
endef
|
||||
|
||||
define Package/eapol-test
|
||||
$(call Package/eapol-test/Default,$(1))
|
||||
TITLE+= (built-in full)
|
||||
VARIANT:=supplicant-full-internal
|
||||
endef
|
||||
|
||||
define Package/eapol-test-openssl
|
||||
$(call Package/eapol-test/Default,$(1))
|
||||
TITLE+= (OpenSSL full)
|
||||
VARIANT:=supplicant-full-openssl
|
||||
CONFLICTS:=$(filter-out eapol-test-openssl ,$(EAPOL_TEST_PROVIDERS))
|
||||
DEPENDS+=$(OPENSSL_DEPENDS)
|
||||
PROVIDES:=eapol-test
|
||||
endef
|
||||
|
||||
define Package/eapol-test-wolfssl
|
||||
$(call Package/eapol-test/Default,$(1))
|
||||
TITLE+= (wolfSSL full)
|
||||
VARIANT:=supplicant-full-wolfssl
|
||||
CONFLICTS:=$(filter-out eapol-test-openssl ,$(filter-out eapol-test-wolfssl ,$(EAPOL_TEST_PROVIDERS)))
|
||||
DEPENDS+=+PACKAGE_eapol-test-wolfssl:libwolfssl
|
||||
PROVIDES:=eapol-test
|
||||
endef
|
||||
|
||||
define Package/eapol-test-mbedtls
|
||||
$(call Package/eapol-test/Default,$(1))
|
||||
TITLE+= (mbedTLS full)
|
||||
VARIANT:=supplicant-full-mbedtls
|
||||
CONFLICTS:=$(filter-out eapol-test-openssl ,$(filter-out eapol-test-mbedtls ,$(EAPOL_TEST_PROVIDERS)))
|
||||
DEPENDS+=+PACKAGE_eapol-test-mbedtls:libmbedtls
|
||||
PROVIDES:=eapol-test
|
||||
endef
|
||||
|
||||
|
||||
ifneq ($(wildcard $(PKG_BUILD_DIR)/.config_*),$(subst .configured_,.config_,$(STAMP_CONFIGURED)))
|
||||
define Build/Configure/rebuild
|
||||
$(FIND) $(PKG_BUILD_DIR) -name \*.o -or -name \*.a | $(XARGS) rm -f
|
||||
rm -f $(PKG_BUILD_DIR)/hostapd/hostapd
|
||||
rm -f $(PKG_BUILD_DIR)/wpa_supplicant/wpa_supplicant
|
||||
rm -f $(PKG_BUILD_DIR)/.config_*
|
||||
touch $(subst .configured_,.config_,$(STAMP_CONFIGURED))
|
||||
endef
|
||||
endif
|
||||
|
||||
define Build/Configure
|
||||
$(Build/Configure/rebuild)
|
||||
$(if $(wildcard ./files/hostapd-$(CONFIG_VARIANT).config), \
|
||||
$(CP) ./files/hostapd-$(CONFIG_VARIANT).config $(PKG_BUILD_DIR)/hostapd/.config \
|
||||
)
|
||||
$(if $(wildcard ./files/wpa_supplicant-$(CONFIG_VARIANT).config), \
|
||||
$(CP) ./files/wpa_supplicant-$(CONFIG_VARIANT).config $(PKG_BUILD_DIR)/wpa_supplicant/.config
|
||||
)
|
||||
endef
|
||||
|
||||
TARGET_CPPFLAGS := \
|
||||
-I$(STAGING_DIR)/usr/include/libnl-tiny \
|
||||
-I$(PKG_BUILD_DIR)/src/crypto \
|
||||
$(TARGET_CPPFLAGS) \
|
||||
-DCONFIG_LIBNL20 \
|
||||
-D_GNU_SOURCE \
|
||||
$(if $(CONFIG_WPA_MSG_MIN_PRIORITY),-DCONFIG_MSG_MIN_PRIORITY=$(CONFIG_WPA_MSG_MIN_PRIORITY))
|
||||
|
||||
TARGET_LDFLAGS += -lubox -lubus -lblobmsg_json -lucode -lm -lnl-tiny
|
||||
|
||||
ifdef CONFIG_WPA_ENABLE_WEP
|
||||
DRIVER_MAKEOPTS += CONFIG_WEP=y
|
||||
endif
|
||||
|
||||
define Build/RunMake
|
||||
CFLAGS="$(TARGET_CPPFLAGS) $(TARGET_CFLAGS)" \
|
||||
$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR)/$(1) \
|
||||
$(TARGET_CONFIGURE_OPTS) \
|
||||
$(DRIVER_MAKEOPTS) \
|
||||
LIBS="$(TARGET_LDFLAGS)" \
|
||||
LIBS_c="$(TARGET_LDFLAGS_C)" \
|
||||
AR="$(TARGET_CROSS)gcc-ar" \
|
||||
BCHECK= \
|
||||
$(if $(findstring s,$(OPENWRT_VERBOSE)),V=1) \
|
||||
$(2)
|
||||
endef
|
||||
|
||||
define Build/Compile/wpad
|
||||
echo ` \
|
||||
$(call Build/RunMake,hostapd,-s MULTICALL=1 dump_cflags); \
|
||||
$(call Build/RunMake,wpa_supplicant,-s MULTICALL=1 dump_cflags) | \
|
||||
sed -e 's,-n ,,g' -e 's^$(TARGET_CFLAGS)^^' \
|
||||
` > $(PKG_BUILD_DIR)/.cflags
|
||||
sed -i 's/"/\\"/g' $(PKG_BUILD_DIR)/.cflags
|
||||
+$(call Build/RunMake,hostapd, \
|
||||
CFLAGS="$$$$(cat $(PKG_BUILD_DIR)/.cflags)" \
|
||||
MULTICALL=1 \
|
||||
hostapd_cli hostapd_multi.a \
|
||||
)
|
||||
+$(call Build/RunMake,wpa_supplicant, \
|
||||
CFLAGS="$$$$(cat $(PKG_BUILD_DIR)/.cflags)" \
|
||||
MULTICALL=1 \
|
||||
wpa_cli wpa_supplicant_multi.a \
|
||||
)
|
||||
+export MAKEFLAGS="$(MAKE_JOBSERVER)"; $(TARGET_CC) -o $(PKG_BUILD_DIR)/wpad \
|
||||
$(TARGET_CFLAGS) \
|
||||
./files/multicall.c \
|
||||
$(PKG_BUILD_DIR)/hostapd/hostapd_multi.a \
|
||||
$(PKG_BUILD_DIR)/wpa_supplicant/wpa_supplicant_multi.a \
|
||||
$(TARGET_LDFLAGS)
|
||||
endef
|
||||
|
||||
define Build/Compile/hostapd
|
||||
+$(call Build/RunMake,hostapd, \
|
||||
hostapd hostapd_cli \
|
||||
)
|
||||
endef
|
||||
|
||||
define Build/Compile/supplicant
|
||||
+$(call Build/RunMake,wpa_supplicant, \
|
||||
wpa_cli wpa_supplicant \
|
||||
)
|
||||
endef
|
||||
|
||||
define Build/Compile/supplicant-full-internal
|
||||
+$(call Build/RunMake,wpa_supplicant, \
|
||||
eapol_test \
|
||||
)
|
||||
endef
|
||||
|
||||
define Build/Compile/supplicant-full-openssl
|
||||
+$(call Build/RunMake,wpa_supplicant, \
|
||||
eapol_test \
|
||||
)
|
||||
endef
|
||||
|
||||
define Build/Compile/supplicant-full-wolfssl
|
||||
+$(call Build/RunMake,wpa_supplicant, \
|
||||
eapol_test \
|
||||
)
|
||||
endef
|
||||
|
||||
define Build/Compile/supplicant-full-mbedtls
|
||||
+$(call Build/RunMake,wpa_supplicant, \
|
||||
eapol_test \
|
||||
)
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
$(Build/Compile/$(LOCAL_TYPE))
|
||||
$(Build/Compile/$(BUILD_VARIANT))
|
||||
endef
|
||||
|
||||
define Install/hostapd/full
|
||||
$(INSTALL_DIR) $(1)/etc/init.d $(1)/etc/config $(1)/etc/radius
|
||||
ln -sf hostapd $(1)/usr/sbin/hostapd-radius
|
||||
$(INSTALL_BIN) ./files/radius.init $(1)/etc/init.d/radius
|
||||
$(INSTALL_DATA) ./files/radius.config $(1)/etc/config/radius
|
||||
$(INSTALL_DATA) ./files/radius.clients $(1)/etc/radius/clients
|
||||
$(INSTALL_DATA) ./files/radius.users $(1)/etc/radius/users
|
||||
endef
|
||||
|
||||
define Package/hostapd-full/conffiles
|
||||
/etc/config/radius
|
||||
/etc/radius
|
||||
endef
|
||||
|
||||
ifeq ($(CONFIG_VARIANT),full)
|
||||
Package/wpad-mesh-openssl/conffiles = $(Package/hostapd-full/conffiles)
|
||||
Package/wpad-mesh-wolfssl/conffiles = $(Package/hostapd-full/conffiles)
|
||||
Package/wpad-mesh-mbedtls/conffiles = $(Package/hostapd-full/conffiles)
|
||||
Package/wpad/conffiles = $(Package/hostapd-full/conffiles)
|
||||
Package/wpad-openssl/conffiles = $(Package/hostapd-full/conffiles)
|
||||
Package/wpad-wolfssl/conffiles = $(Package/hostapd-full/conffiles)
|
||||
Package/wpad-mbedtls/conffiles = $(Package/hostapd-full/conffiles)
|
||||
Package/hostapd/conffiles = $(Package/hostapd-full/conffiles)
|
||||
Package/hostapd-openssl/conffiles = $(Package/hostapd-full/conffiles)
|
||||
Package/hostapd-wolfssl/conffiles = $(Package/hostapd-full/conffiles)
|
||||
Package/hostapd-mbedtls/conffiles = $(Package/hostapd-full/conffiles)
|
||||
endif
|
||||
|
||||
define Install/hostapd
|
||||
$(INSTALL_DIR) $(1)/usr/sbin $(1)/usr/share/hostap
|
||||
$(INSTALL_DATA) ./files/hostapd.uc $(1)/usr/share/hostap/
|
||||
$(if $(findstring full,$(CONFIG_VARIANT)),$(Install/hostapd/full))
|
||||
endef
|
||||
|
||||
define Install/supplicant
|
||||
$(INSTALL_DIR) $(1)/usr/sbin $(1)/usr/share/hostap
|
||||
$(INSTALL_DATA) ./files/wpa_supplicant.uc $(1)/usr/share/hostap/
|
||||
endef
|
||||
|
||||
define Package/hostapd-common/install
|
||||
$(INSTALL_DIR) $(1)/etc/capabilities $(1)/etc/rc.button $(1)/etc/hotplug.d/ieee80211 $(1)/etc/init.d $(1)/lib/netifd $(1)/usr/share/acl.d $(1)/usr/share/hostap
|
||||
$(INSTALL_BIN) ./files/dhcp-get-server.sh $(1)/lib/netifd/dhcp-get-server.sh
|
||||
$(INSTALL_DATA) ./files/hostapd.sh $(1)/lib/netifd/hostapd.sh
|
||||
$(INSTALL_BIN) ./files/wpad.init $(1)/etc/init.d/wpad
|
||||
$(INSTALL_BIN) ./files/wps-hotplug.sh $(1)/etc/rc.button/wps
|
||||
$(INSTALL_DATA) ./files/wpad_acl.json $(1)/usr/share/acl.d
|
||||
$(INSTALL_DATA) ./files/wpad.json $(1)/etc/capabilities
|
||||
$(INSTALL_DATA) ./files/common.uc $(1)/usr/share/hostap/
|
||||
$(INSTALL_DATA) ./files/wdev.uc $(1)/usr/share/hostap/
|
||||
endef
|
||||
|
||||
define Package/hostapd/install
|
||||
$(call Install/hostapd,$(1))
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/hostapd/hostapd $(1)/usr/sbin/
|
||||
endef
|
||||
Package/hostapd-basic/install = $(Package/hostapd/install)
|
||||
Package/hostapd-basic-openssl/install = $(Package/hostapd/install)
|
||||
Package/hostapd-basic-wolfssl/install = $(Package/hostapd/install)
|
||||
Package/hostapd-basic-mbedtls/install = $(Package/hostapd/install)
|
||||
Package/hostapd-mini/install = $(Package/hostapd/install)
|
||||
Package/hostapd-openssl/install = $(Package/hostapd/install)
|
||||
Package/hostapd-wolfssl/install = $(Package/hostapd/install)
|
||||
Package/hostapd-mbedtls/install = $(Package/hostapd/install)
|
||||
|
||||
ifneq ($(LOCAL_TYPE),supplicant)
|
||||
define Package/hostapd-utils/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/hostapd/hostapd_cli $(1)/usr/sbin/
|
||||
endef
|
||||
endif
|
||||
|
||||
define Package/wpad/install
|
||||
$(call Install/hostapd,$(1))
|
||||
$(call Install/supplicant,$(1))
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/wpad $(1)/usr/sbin/
|
||||
$(LN) wpad $(1)/usr/sbin/hostapd
|
||||
$(LN) wpad $(1)/usr/sbin/wpa_supplicant
|
||||
endef
|
||||
Package/wpad-basic/install = $(Package/wpad/install)
|
||||
Package/wpad-basic-openssl/install = $(Package/wpad/install)
|
||||
Package/wpad-basic-wolfssl/install = $(Package/wpad/install)
|
||||
Package/wpad-basic-mbedtls/install = $(Package/wpad/install)
|
||||
Package/wpad-mini/install = $(Package/wpad/install)
|
||||
Package/wpad-openssl/install = $(Package/wpad/install)
|
||||
Package/wpad-wolfssl/install = $(Package/wpad/install)
|
||||
Package/wpad-mbedtls/install = $(Package/wpad/install)
|
||||
Package/wpad-mesh-openssl/install = $(Package/wpad/install)
|
||||
Package/wpad-mesh-wolfssl/install = $(Package/wpad/install)
|
||||
Package/wpad-mesh-mbedtls/install = $(Package/wpad/install)
|
||||
|
||||
define Package/wpa-supplicant/install
|
||||
$(call Install/supplicant,$(1))
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/wpa_supplicant/wpa_supplicant $(1)/usr/sbin/
|
||||
endef
|
||||
Package/wpa-supplicant-basic/install = $(Package/wpa-supplicant/install)
|
||||
Package/wpa-supplicant-mini/install = $(Package/wpa-supplicant/install)
|
||||
Package/wpa-supplicant-p2p/install = $(Package/wpa-supplicant/install)
|
||||
Package/wpa-supplicant-openssl/install = $(Package/wpa-supplicant/install)
|
||||
Package/wpa-supplicant-wolfssl/install = $(Package/wpa-supplicant/install)
|
||||
Package/wpa-supplicant-mbedtls/install = $(Package/wpa-supplicant/install)
|
||||
Package/wpa-supplicant-mesh-openssl/install = $(Package/wpa-supplicant/install)
|
||||
Package/wpa-supplicant-mesh-wolfssl/install = $(Package/wpa-supplicant/install)
|
||||
Package/wpa-supplicant-mesh-mbedtls/install = $(Package/wpa-supplicant/install)
|
||||
|
||||
ifneq ($(LOCAL_TYPE),hostapd)
|
||||
define Package/wpa-cli/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(CP) $(PKG_BUILD_DIR)/wpa_supplicant/wpa_cli $(1)/usr/sbin/
|
||||
endef
|
||||
endif
|
||||
|
||||
ifeq ($(BUILD_VARIANT),supplicant-full-internal)
|
||||
define Package/eapol-test/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(CP) $(PKG_BUILD_DIR)/wpa_supplicant/eapol_test $(1)/usr/sbin/
|
||||
endef
|
||||
endif
|
||||
|
||||
ifeq ($(BUILD_VARIANT),supplicant-full-openssl)
|
||||
define Package/eapol-test-openssl/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(CP) $(PKG_BUILD_DIR)/wpa_supplicant/eapol_test $(1)/usr/sbin/
|
||||
endef
|
||||
endif
|
||||
|
||||
ifeq ($(BUILD_VARIANT),supplicant-full-wolfssl)
|
||||
define Package/eapol-test-wolfssl/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(CP) $(PKG_BUILD_DIR)/wpa_supplicant/eapol_test $(1)/usr/sbin/
|
||||
endef
|
||||
endif
|
||||
|
||||
ifeq ($(BUILD_VARIANT),supplicant-full-mbedtls)
|
||||
define Package/eapol-test-mbedtls/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(CP) $(PKG_BUILD_DIR)/wpa_supplicant/eapol_test $(1)/usr/sbin/
|
||||
endef
|
||||
endif
|
||||
|
||||
# Build hostapd-common before its dependents, to avoid
|
||||
# spurious rebuilds when building multiple variants.
|
||||
$(eval $(call BuildPackage,hostapd-common))
|
||||
$(eval $(call BuildPackage,hostapd))
|
||||
$(eval $(call BuildPackage,hostapd-basic))
|
||||
$(eval $(call BuildPackage,hostapd-basic-openssl))
|
||||
$(eval $(call BuildPackage,hostapd-basic-wolfssl))
|
||||
$(eval $(call BuildPackage,hostapd-basic-mbedtls))
|
||||
$(eval $(call BuildPackage,hostapd-mini))
|
||||
$(eval $(call BuildPackage,hostapd-openssl))
|
||||
$(eval $(call BuildPackage,hostapd-wolfssl))
|
||||
$(eval $(call BuildPackage,hostapd-mbedtls))
|
||||
$(eval $(call BuildPackage,wpad))
|
||||
$(eval $(call BuildPackage,wpad-mesh-openssl))
|
||||
$(eval $(call BuildPackage,wpad-mesh-wolfssl))
|
||||
$(eval $(call BuildPackage,wpad-mesh-mbedtls))
|
||||
$(eval $(call BuildPackage,wpad-basic))
|
||||
$(eval $(call BuildPackage,wpad-basic-openssl))
|
||||
$(eval $(call BuildPackage,wpad-basic-wolfssl))
|
||||
$(eval $(call BuildPackage,wpad-basic-mbedtls))
|
||||
$(eval $(call BuildPackage,wpad-mini))
|
||||
$(eval $(call BuildPackage,wpad-openssl))
|
||||
$(eval $(call BuildPackage,wpad-wolfssl))
|
||||
$(eval $(call BuildPackage,wpad-mbedtls))
|
||||
$(eval $(call BuildPackage,wpa-supplicant))
|
||||
$(eval $(call BuildPackage,wpa-supplicant-mesh-openssl))
|
||||
$(eval $(call BuildPackage,wpa-supplicant-mesh-wolfssl))
|
||||
$(eval $(call BuildPackage,wpa-supplicant-mesh-mbedtls))
|
||||
$(eval $(call BuildPackage,wpa-supplicant-basic))
|
||||
$(eval $(call BuildPackage,wpa-supplicant-mini))
|
||||
$(eval $(call BuildPackage,wpa-supplicant-p2p))
|
||||
$(eval $(call BuildPackage,wpa-supplicant-openssl))
|
||||
$(eval $(call BuildPackage,wpa-supplicant-wolfssl))
|
||||
$(eval $(call BuildPackage,wpa-supplicant-mbedtls))
|
||||
$(eval $(call BuildPackage,wpa-cli))
|
||||
$(eval $(call BuildPackage,hostapd-utils))
|
||||
$(eval $(call BuildPackage,eapol-test))
|
||||
$(eval $(call BuildPackage,eapol-test-openssl))
|
||||
$(eval $(call BuildPackage,eapol-test-wolfssl))
|
||||
$(eval $(call BuildPackage,eapol-test-mbedtls))
|
||||
@@ -1,419 +0,0 @@
|
||||
# UBUS methods - hostapd
|
||||
|
||||
## bss_mgmt_enable
|
||||
Enable 802.11k/v features.
|
||||
|
||||
### arguments
|
||||
| Name | Type | Required | Description |
|
||||
|---|---|---|---|
|
||||
| neighbor_report | bool | no | enable 802.11k neighbor reports |
|
||||
| beacon_report | bool | no | enable 802.11k beacon reports |
|
||||
| link_measurements | bool | no | enable 802.11k link measurements |
|
||||
| bss_transition | bool | no | enable 802.11v BSS transition support |
|
||||
|
||||
### example
|
||||
`ubus call hostapd.wl5-fb bss_mgmt_enable '{ "neighbor_report": true, "beacon_report": true, "link_measurements": true, "bss_transition": true
|
||||
}'`
|
||||
|
||||
|
||||
## bss_transition_request
|
||||
Initiate an 802.11v transition request.
|
||||
|
||||
### arguments
|
||||
| Name | Type | Required | Description |
|
||||
|---|---|---|---|
|
||||
| addr | string | yes | client MAC address |
|
||||
| disassociation_imminent | bool | no | set Disassociation Imminent bit |
|
||||
| disassociation_timer | int32 | no | disassociate client if it doesn't roam after this time |
|
||||
| validity_period | int32 | no | validity of the BSS Transition Candiate List |
|
||||
| neighbors | array | no | BSS Transition Candidate List |
|
||||
| abridged | bool | no | prefer APs in the BSS Transition Candidate List |
|
||||
| dialog_token | int32 | no | identifier for the request/report transaction |
|
||||
| mbo_reason | int32 | no | MBO Transition Reason Code Attribute |
|
||||
| cell_pref | int32 | no | MBO Cellular Data Connection Preference Attribute |
|
||||
| reassoc_delay | int32 | no | MBO Re-association retry delay |
|
||||
|
||||
### example
|
||||
`ubus call hostapd.wl5-fb bss_transition_request '{ "addr": "68:2F:67:8B:98:ED", "disassociation_imminent": false, "disassociation_timer": 0, "validity_period": 30, "neighbors": ["b6a7b9cbeebabf5900008064090603026a00"], "abridged": 1 }'`
|
||||
|
||||
|
||||
## config_add
|
||||
Dynamically load a BSS configuration from a file. This is used by netifd's mac80211 support script to configure BSSes on multiple PHYs in a single hostapd instance.
|
||||
|
||||
### arguments
|
||||
| Name | Type | Required | Description |
|
||||
|---|---|---|---|
|
||||
| iface | string | yes | WiFi interface name |
|
||||
| config | string | yes | path to hostapd config file |
|
||||
|
||||
|
||||
## config_remove
|
||||
Dynamically remove a BSS configuration.
|
||||
|
||||
### arguments
|
||||
| Name | Type | Required | Description |
|
||||
|---|---|---|---|
|
||||
| iface | string | yes | WiFi interface name |
|
||||
|
||||
|
||||
## del_client
|
||||
Kick a client off the network.
|
||||
|
||||
### arguments
|
||||
| Name | Type | Required | Description |
|
||||
|---|---|---|---|
|
||||
| addr | string | yes | client MAC address |
|
||||
| reason | int32 | no | 802.11 reason code |
|
||||
| deauth | bool | no | deauthenticates client instead of disassociating |
|
||||
| ban_time | int32 | no | ban client for N milliseconds |
|
||||
|
||||
### example
|
||||
`ubus call hostapd.wl5-fb del_client '{ "addr": "68:2f:67:8b:98:ed", "reason": 5, "deauth": true, "ban_time": 10000 }'`
|
||||
|
||||
|
||||
## get_clients
|
||||
Show associated clients.
|
||||
|
||||
### example
|
||||
`ubus call hostapd.wl5-fb get_clients`
|
||||
|
||||
### output
|
||||
```json
|
||||
{
|
||||
"freq": 5260,
|
||||
"clients": {
|
||||
"68:2f:67:8b:98:ed": {
|
||||
"auth": true,
|
||||
"assoc": true,
|
||||
"authorized": true,
|
||||
"preauth": false,
|
||||
"wds": false,
|
||||
"wmm": true,
|
||||
"ht": true,
|
||||
"vht": true,
|
||||
"he": false,
|
||||
"wps": false,
|
||||
"mfp": true,
|
||||
"rrm": [
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"extended_capabilities": [
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
64
|
||||
],
|
||||
"aid": 3,
|
||||
"signature": "wifi4|probe:0,1,45,127,107,191,221(0017f2,10),221(001018,2),htcap:006f,htagg:1b,htmcs:0000ffff,vhtcap:0f825832,vhtrxmcs:0000ffea,vhttxmcs:0000ffea,extcap:0000008000000040|assoc:0,1,33,36,48,45,127,191,221(0017f2,10),221(001018,2),221(0050f2,2),htcap:006f,htagg:1b,htmcs:0000ffff,vhtcap:0f825832,vhtrxmcs:0000ffea,vhttxmcs:0000ffea,txpow:14f9,extcap:0000000000000040",
|
||||
"bytes": {
|
||||
"rx": 1933667,
|
||||
"tx": 746805
|
||||
},
|
||||
"airtime": {
|
||||
"rx": 208863,
|
||||
"tx": 9037883
|
||||
},
|
||||
"packets": {
|
||||
"rx": 3587,
|
||||
"tx": 2185
|
||||
},
|
||||
"rate": {
|
||||
"rx": 866700,
|
||||
"tx": 866700
|
||||
},
|
||||
"signal": -50,
|
||||
"capabilities": {
|
||||
"vht": {
|
||||
"su_beamformee": true,
|
||||
"mu_beamformee": false,
|
||||
"mcs_map": {
|
||||
"rx": {
|
||||
"1ss": 9,
|
||||
"2ss": 9,
|
||||
"3ss": 9,
|
||||
"4ss": -1,
|
||||
"5ss": -1,
|
||||
"6ss": -1,
|
||||
"7ss": -1,
|
||||
"8ss": -1
|
||||
},
|
||||
"tx": {
|
||||
"1ss": 9,
|
||||
"2ss": 9,
|
||||
"3ss": 9,
|
||||
"4ss": -1,
|
||||
"5ss": -1,
|
||||
"6ss": -1,
|
||||
"7ss": -1,
|
||||
"8ss": -1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
## get_features
|
||||
Show HT/VHT support.
|
||||
|
||||
### example
|
||||
`ubus call hostapd.wl5-fb get_features`
|
||||
|
||||
### output
|
||||
```json
|
||||
{
|
||||
"ht_supported": true,
|
||||
"vht_supported": true
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
## get_status
|
||||
Get BSS status.
|
||||
|
||||
### example
|
||||
`ubus call hostapd.wl5-fb get_status`
|
||||
|
||||
### output
|
||||
```json
|
||||
{
|
||||
"status": "ENABLED",
|
||||
"bssid": "b6:a7:b9:cb:ee:bc",
|
||||
"ssid": "fb",
|
||||
"freq": 5260,
|
||||
"channel": 52,
|
||||
"op_class": 128,
|
||||
"beacon_interval": 100,
|
||||
"phy": "wl5-lan",
|
||||
"rrm": {
|
||||
"neighbor_report_tx": 0
|
||||
},
|
||||
"wnm": {
|
||||
"bss_transition_query_rx": 0,
|
||||
"bss_transition_request_tx": 0,
|
||||
"bss_transition_response_rx": 0
|
||||
},
|
||||
"airtime": {
|
||||
"time": 259561738,
|
||||
"time_busy": 2844249,
|
||||
"utilization": 0
|
||||
},
|
||||
"dfs": {
|
||||
"cac_seconds": 60,
|
||||
"cac_active": false,
|
||||
"cac_seconds_left": 0
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
## link_measurement_req
|
||||
Initiate an 802.11k Link Measurement Request.
|
||||
|
||||
### arguments
|
||||
| Name | Type | Required | Description |
|
||||
|---|---|---|---|
|
||||
| addr | string | yes | client MAC address |
|
||||
| tx-power-used | int32 | no | transmit power used to transmit the Link Measurement Request frame |
|
||||
| tx-power-max | int32 | no | upper limit of transmit power to be used by the client |
|
||||
|
||||
|
||||
## list_bans
|
||||
List banned clients.
|
||||
|
||||
### example
|
||||
`ubus call hostapd.wl5-fb list_bans`
|
||||
|
||||
### output
|
||||
```json
|
||||
{
|
||||
"clients": [
|
||||
"68:2f:67:8b:98:ed"
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
## notify_response
|
||||
When enabled, hostapd will send a ubus notification and wait for a response before responding to various requests. This is used by e.g. usteer to make it possible to ignore probe requests.
|
||||
|
||||
:warning: enabling this will cause hostapd to stop responding to probe requests unless a ubus subscriber responds to the ubus notifications.
|
||||
|
||||
### arguments
|
||||
| Name | Type | Required | Description |
|
||||
|---|---|---|---|
|
||||
| notify_response | int32 | yes | disable (0) or enable (!0) |
|
||||
|
||||
### example
|
||||
`ubus call hostapd.wl5-fb notify_response '{ "notify_response": 1 }'`
|
||||
|
||||
## reload
|
||||
Reload BSS configuration.
|
||||
|
||||
:warning: this can cause problems for certain configurations:
|
||||
|
||||
```
|
||||
Mon May 16 16:09:08 2022 daemon.warn hostapd: Failed to check if DFS is required; ret=-1
|
||||
Mon May 16 16:09:08 2022 daemon.warn hostapd: Failed to check if DFS is required; ret=-1
|
||||
Mon May 16 16:09:08 2022 daemon.err hostapd: Wrong coupling between HT and VHT/HE channel setting
|
||||
```
|
||||
|
||||
### example
|
||||
`ubus call hostapd.wl5-fb reload`
|
||||
|
||||
|
||||
## rrm_beacon_req
|
||||
Send a Beacon Measurement Request to a client.
|
||||
|
||||
### arguments
|
||||
| Name | Type | Required | Description |
|
||||
|---|---|---|---|
|
||||
| addr | string | yes | client MAC address |
|
||||
| op_class | int32 | yes | the Regulatory Class for which this Measurement Request applies |
|
||||
| channel | int32 | yes | channel to measure |
|
||||
| duration | int32 | yes | compile Beacon Measurement Report after N TU |
|
||||
| mode | int32 | yes | mode to be used for measurement (0: passive, 1: active, 2: beacon table) |
|
||||
| bssid | string | no | filter BSSes in Beacon Measurement Report by BSSID |
|
||||
| ssid | string | no | filter BSSes in Beacon Measurement Report by SSID|
|
||||
|
||||
|
||||
## rrm_nr_get_own
|
||||
Show Neighbor Report Element for this BSS.
|
||||
|
||||
### example
|
||||
`ubus call hostapd.wl5-fb rrm_nr_get_own`
|
||||
|
||||
### output
|
||||
```json
|
||||
{
|
||||
"value": [
|
||||
"b6:a7:b9:cb:ee:bc",
|
||||
"fb",
|
||||
"b6a7b9cbeebcaf5900008095090603029b00"
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
## rrm_nr_list
|
||||
Show Neighbor Report Elements for other BSSes in this ESS.
|
||||
|
||||
### example
|
||||
`ubus call hostapd.wl5-fb rrm_nr_list`
|
||||
|
||||
### output
|
||||
```json
|
||||
{
|
||||
"list": [
|
||||
[
|
||||
"b6:a7:b9:cb:ee:ba",
|
||||
"fb",
|
||||
"b6a7b9cbeebabf5900008064090603026a00"
|
||||
]
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
## rrm_nr_set
|
||||
Set the Neighbor Report Elements. An element for the node on which this command is executed will always be added.
|
||||
|
||||
### arguments
|
||||
| Name | Type | Required | Description |
|
||||
|---|---|---|---|
|
||||
| list | array | yes | array of Neighbor Report Elements in the format of the rrm_nr_list output |
|
||||
|
||||
### example
|
||||
`ubus call hostapd.wl5-fb rrm_nr_set '{ "list": [ [ "b6:a7:b9:cb:ee:ba", "fb", "b6a7b9cbeebabf5900008064090603026a00" ] ] }'`
|
||||
|
||||
|
||||
## set_vendor_elements
|
||||
Configure Vendor-specific Information Elements for BSS.
|
||||
|
||||
### arguments
|
||||
| Name | Type | Required | Description |
|
||||
|---|---|---|---|
|
||||
| vendor_elements | string | yes | Vendor-specific Information Elements as hex string |
|
||||
|
||||
### example
|
||||
`ubus call hostapd.wl5-fb set_vendor_elements '{ "vendor_elements": "dd054857dd6662" }'`
|
||||
|
||||
|
||||
## switch_chan
|
||||
Initiate a channel switch.
|
||||
|
||||
:warning: trying to switch to the channel that is currently in use will fail: `Command failed: Operation not supported`
|
||||
|
||||
### arguments
|
||||
| Name | Type | Required | Description |
|
||||
|---|---|---|---|
|
||||
| freq | int32 | yes | frequency in MHz to switch to |
|
||||
| bcn_count | int32 | no | count in Beacon frames (TBTT) to perform the switch |
|
||||
| center_freq1 | int32 | no | segment 0 center frequency in MHz (valid for HT and VHT) |
|
||||
| center_freq2 | int32 | no | segment 1 center frequency in MHz (valid only for 80 MHz channel width and an 80+80 channel) |
|
||||
| bandwidth | int32 | no | channel width to use |
|
||||
| sec_channel_offset| int32 | no | secondary channel offset for HT40 (0 = disabled, 1 = HT40+, -1 = HT40-) |
|
||||
| ht | bool | no | enable 802.11n |
|
||||
| vht | bool | no | enable 802.11ac |
|
||||
| he | bool | no | enable 802.11ax |
|
||||
| block_tx | bool | no | block transmission during CSA period |
|
||||
| csa_force | bool | no | restart the interface in case the CSA fails |
|
||||
|
||||
## example
|
||||
`ubus call hostapd.wl5-fb switch_chan '{ "freq": 5180, "bcn_count": 10, "center_freq1": 5210, "bandwidth": 80, "he": 1, "block_tx": 1, "csa_force": 0 }'`
|
||||
|
||||
|
||||
## update_airtime
|
||||
Set dynamic airtime weight for client.
|
||||
|
||||
### arguments
|
||||
| Name | Type | Required | Description |
|
||||
|---|---|---|---|
|
||||
| sta | string | yes | client MAC address |
|
||||
| weight | int32 | yes | airtime weight |
|
||||
|
||||
|
||||
## update_beacon
|
||||
Force beacon frame content to be updated and to start beaconing on an interface that uses start_disabled=1.
|
||||
|
||||
### example
|
||||
`ubus call hostapd.wl5-fb update_beacon`
|
||||
|
||||
|
||||
## wps_status
|
||||
Get WPS status for BSS.
|
||||
|
||||
### example
|
||||
`ubus call hostapd.wl5-fb wps_status`
|
||||
|
||||
### output
|
||||
```json
|
||||
{
|
||||
"pbc_status": "Disabled",
|
||||
"last_wps_result": "None"
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
## wps_cancel
|
||||
Cancel WPS Push Button Configuration.
|
||||
|
||||
### example
|
||||
`ubus call hostapd.wl5-fb wps_cancel`
|
||||
|
||||
|
||||
## wps_start
|
||||
Start WPS Push Button Configuration.
|
||||
|
||||
### example
|
||||
`ubus call hostapd.wl5-fb wps_start`
|
||||
@@ -1,2 +0,0 @@
|
||||
#!/bin/sh
|
||||
[ "$1" = bound ] && echo "$serverid"
|
||||
@@ -1,404 +0,0 @@
|
||||
# Example hostapd build time configuration
|
||||
#
|
||||
# This file lists the configuration options that are used when building the
|
||||
# hostapd binary. All lines starting with # are ignored. Configuration option
|
||||
# lines must be commented out complete, if they are not to be included, i.e.,
|
||||
# just setting VARIABLE=n is not disabling that variable.
|
||||
#
|
||||
# This file is included in Makefile, so variables like CFLAGS and LIBS can also
|
||||
# be modified from here. In most cass, these lines should use += in order not
|
||||
# to override previous values of the variables.
|
||||
|
||||
# Driver interface for Host AP driver
|
||||
#CONFIG_DRIVER_HOSTAP=y
|
||||
|
||||
# Driver interface for wired authenticator
|
||||
CONFIG_DRIVER_WIRED=y
|
||||
|
||||
# Driver interface for drivers using the nl80211 kernel interface
|
||||
CONFIG_DRIVER_NL80211=y
|
||||
|
||||
# QCA vendor extensions to nl80211
|
||||
#CONFIG_DRIVER_NL80211_QCA=y
|
||||
|
||||
# driver_nl80211.c requires libnl. If you are compiling it yourself
|
||||
# you may need to point hostapd to your version of libnl.
|
||||
#
|
||||
#CFLAGS += -I$<path to libnl include files>
|
||||
#LIBS += -L$<path to libnl library files>
|
||||
|
||||
# Use libnl v2.0 (or 3.0) libraries.
|
||||
#CONFIG_LIBNL20=y
|
||||
|
||||
# Use libnl 3.2 libraries (if this is selected, CONFIG_LIBNL20 is ignored)
|
||||
#CONFIG_LIBNL32=y
|
||||
|
||||
|
||||
# Driver interface for FreeBSD net80211 layer (e.g., Atheros driver)
|
||||
#CONFIG_DRIVER_BSD=y
|
||||
#CFLAGS += -I/usr/local/include
|
||||
#LIBS += -L/usr/local/lib
|
||||
#LIBS_p += -L/usr/local/lib
|
||||
#LIBS_c += -L/usr/local/lib
|
||||
|
||||
# Driver interface for no driver (e.g., RADIUS server only)
|
||||
#CONFIG_DRIVER_NONE=y
|
||||
|
||||
# IEEE 802.11F/IAPP
|
||||
#CONFIG_IAPP=y
|
||||
|
||||
# WPA2/IEEE 802.11i RSN pre-authentication
|
||||
CONFIG_RSN_PREAUTH=y
|
||||
|
||||
# IEEE 802.11w (management frame protection)
|
||||
#CONFIG_IEEE80211W=y
|
||||
|
||||
# Support Operating Channel Validation
|
||||
CONFIG_OCV=y
|
||||
|
||||
# Integrated EAP server
|
||||
#CONFIG_EAP=y
|
||||
|
||||
# EAP Re-authentication Protocol (ERP) in integrated EAP server
|
||||
#CONFIG_ERP=y
|
||||
|
||||
# EAP-MD5 for the integrated EAP server
|
||||
#CONFIG_EAP_MD5=y
|
||||
|
||||
# EAP-TLS for the integrated EAP server
|
||||
#CONFIG_EAP_TLS=y
|
||||
|
||||
# EAP-MSCHAPv2 for the integrated EAP server
|
||||
#CONFIG_EAP_MSCHAPV2=y
|
||||
|
||||
# EAP-PEAP for the integrated EAP server
|
||||
#CONFIG_EAP_PEAP=y
|
||||
|
||||
# EAP-GTC for the integrated EAP server
|
||||
#CONFIG_EAP_GTC=y
|
||||
|
||||
# EAP-TTLS for the integrated EAP server
|
||||
#CONFIG_EAP_TTLS=y
|
||||
|
||||
# EAP-SIM for the integrated EAP server
|
||||
#CONFIG_EAP_SIM=y
|
||||
|
||||
# EAP-AKA for the integrated EAP server
|
||||
#CONFIG_EAP_AKA=y
|
||||
|
||||
# EAP-AKA' for the integrated EAP server
|
||||
# This requires CONFIG_EAP_AKA to be enabled, too.
|
||||
#CONFIG_EAP_AKA_PRIME=y
|
||||
|
||||
# EAP-PAX for the integrated EAP server
|
||||
#CONFIG_EAP_PAX=y
|
||||
|
||||
# EAP-PSK for the integrated EAP server (this is _not_ needed for WPA-PSK)
|
||||
#CONFIG_EAP_PSK=y
|
||||
|
||||
# EAP-pwd for the integrated EAP server (secure authentication with a password)
|
||||
#CONFIG_EAP_PWD=y
|
||||
|
||||
# EAP-SAKE for the integrated EAP server
|
||||
#CONFIG_EAP_SAKE=y
|
||||
|
||||
# EAP-GPSK for the integrated EAP server
|
||||
#CONFIG_EAP_GPSK=y
|
||||
# Include support for optional SHA256 cipher suite in EAP-GPSK
|
||||
#CONFIG_EAP_GPSK_SHA256=y
|
||||
|
||||
# EAP-FAST for the integrated EAP server
|
||||
#CONFIG_EAP_FAST=y
|
||||
|
||||
# EAP-TEAP for the integrated EAP server
|
||||
# Note: The current EAP-TEAP implementation is experimental and should not be
|
||||
# enabled for production use. The IETF RFC 7170 that defines EAP-TEAP has number
|
||||
# of conflicting statements and missing details and the implementation has
|
||||
# vendor specific workarounds for those and as such, may not interoperate with
|
||||
# any other implementation. This should not be used for anything else than
|
||||
# experimentation and interoperability testing until those issues has been
|
||||
# resolved.
|
||||
#CONFIG_EAP_TEAP=y
|
||||
|
||||
# Wi-Fi Protected Setup (WPS)
|
||||
#CONFIG_WPS=y
|
||||
# Enable UPnP support for external WPS Registrars
|
||||
#CONFIG_WPS_UPNP=y
|
||||
# Enable WPS support with NFC config method
|
||||
#CONFIG_WPS_NFC=y
|
||||
|
||||
# EAP-IKEv2
|
||||
#CONFIG_EAP_IKEV2=y
|
||||
|
||||
# Trusted Network Connect (EAP-TNC)
|
||||
#CONFIG_EAP_TNC=y
|
||||
|
||||
# EAP-EKE for the integrated EAP server
|
||||
#CONFIG_EAP_EKE=y
|
||||
|
||||
# PKCS#12 (PFX) support (used to read private key and certificate file from
|
||||
# a file that usually has extension .p12 or .pfx)
|
||||
#CONFIG_PKCS12=y
|
||||
|
||||
# RADIUS authentication server. This provides access to the integrated EAP
|
||||
# server from external hosts using RADIUS.
|
||||
#CONFIG_RADIUS_SERVER=y
|
||||
|
||||
# Build IPv6 support for RADIUS operations
|
||||
#CONFIG_IPV6=y
|
||||
|
||||
# IEEE Std 802.11r-2008 (Fast BSS Transition)
|
||||
CONFIG_IEEE80211R=y
|
||||
|
||||
# Use the hostapd's IEEE 802.11 authentication (ACL), but without
|
||||
# the IEEE 802.11 Management capability (e.g., FreeBSD/net80211)
|
||||
#CONFIG_DRIVER_RADIUS_ACL=y
|
||||
|
||||
# IEEE 802.11n (High Throughput) support
|
||||
CONFIG_IEEE80211N=y
|
||||
|
||||
# Wireless Network Management (IEEE Std 802.11v-2011)
|
||||
# Note: This is experimental and not complete implementation.
|
||||
#CONFIG_WNM=y
|
||||
|
||||
# IEEE 802.11ac (Very High Throughput) support
|
||||
CONFIG_IEEE80211AC=y
|
||||
|
||||
# IEEE 802.11ax HE support
|
||||
# Note: This is experimental and work in progress. The definitions are still
|
||||
# subject to change and this should not be expected to interoperate with the
|
||||
# final IEEE 802.11ax version.
|
||||
#CONFIG_IEEE80211AX=y
|
||||
|
||||
# Remove debugging code that is printing out debug messages to stdout.
|
||||
# This can be used to reduce the size of the hostapd considerably if debugging
|
||||
# code is not needed.
|
||||
#CONFIG_NO_STDOUT_DEBUG=y
|
||||
|
||||
# Add support for writing debug log to a file: -f /tmp/hostapd.log
|
||||
# Disabled by default.
|
||||
#CONFIG_DEBUG_FILE=y
|
||||
|
||||
# Send debug messages to syslog instead of stdout
|
||||
CONFIG_DEBUG_SYSLOG=y
|
||||
|
||||
# Add support for sending all debug messages (regardless of debug verbosity)
|
||||
# to the Linux kernel tracing facility. This helps debug the entire stack by
|
||||
# making it easy to record everything happening from the driver up into the
|
||||
# same file, e.g., using trace-cmd.
|
||||
#CONFIG_DEBUG_LINUX_TRACING=y
|
||||
|
||||
# Remove support for RADIUS accounting
|
||||
CONFIG_NO_ACCOUNTING=y
|
||||
|
||||
# Remove support for RADIUS
|
||||
CONFIG_NO_RADIUS=y
|
||||
|
||||
# Remove support for VLANs
|
||||
#CONFIG_NO_VLAN=y
|
||||
|
||||
# Enable support for fully dynamic VLANs. This enables hostapd to
|
||||
# automatically create bridge and VLAN interfaces if necessary.
|
||||
#CONFIG_FULL_DYNAMIC_VLAN=y
|
||||
|
||||
# Use netlink-based kernel API for VLAN operations instead of ioctl()
|
||||
# Note: This requires libnl 3.1 or newer.
|
||||
#CONFIG_VLAN_NETLINK=y
|
||||
|
||||
# Remove support for dumping internal state through control interface commands
|
||||
# This can be used to reduce binary size at the cost of disabling a debugging
|
||||
# option.
|
||||
CONFIG_NO_DUMP_STATE=y
|
||||
|
||||
# Enable tracing code for developer debugging
|
||||
# This tracks use of memory allocations and other registrations and reports
|
||||
# incorrect use with a backtrace of call (or allocation) location.
|
||||
#CONFIG_WPA_TRACE=y
|
||||
# For BSD, comment out these.
|
||||
#LIBS += -lexecinfo
|
||||
#LIBS_p += -lexecinfo
|
||||
#LIBS_c += -lexecinfo
|
||||
|
||||
# Use libbfd to get more details for developer debugging
|
||||
# This enables use of libbfd to get more detailed symbols for the backtraces
|
||||
# generated by CONFIG_WPA_TRACE=y.
|
||||
#CONFIG_WPA_TRACE_BFD=y
|
||||
# For BSD, comment out these.
|
||||
#LIBS += -lbfd -liberty -lz
|
||||
#LIBS_p += -lbfd -liberty -lz
|
||||
#LIBS_c += -lbfd -liberty -lz
|
||||
|
||||
# hostapd depends on strong random number generation being available from the
|
||||
# operating system. os_get_random() function is used to fetch random data when
|
||||
# needed, e.g., for key generation. On Linux and BSD systems, this works by
|
||||
# reading /dev/urandom. It should be noted that the OS entropy pool needs to be
|
||||
# properly initialized before hostapd is started. This is important especially
|
||||
# on embedded devices that do not have a hardware random number generator and
|
||||
# may by default start up with minimal entropy available for random number
|
||||
# generation.
|
||||
#
|
||||
# As a safety net, hostapd is by default trying to internally collect
|
||||
# additional entropy for generating random data to mix in with the data
|
||||
# fetched from the OS. This by itself is not considered to be very strong, but
|
||||
# it may help in cases where the system pool is not initialized properly.
|
||||
# However, it is very strongly recommended that the system pool is initialized
|
||||
# with enough entropy either by using hardware assisted random number
|
||||
# generator or by storing state over device reboots.
|
||||
#
|
||||
# hostapd can be configured to maintain its own entropy store over restarts to
|
||||
# enhance random number generation. This is not perfect, but it is much more
|
||||
# secure than using the same sequence of random numbers after every reboot.
|
||||
# This can be enabled with -e<entropy file> command line option. The specified
|
||||
# file needs to be readable and writable by hostapd.
|
||||
#
|
||||
# If the os_get_random() is known to provide strong random data (e.g., on
|
||||
# Linux/BSD, the board in question is known to have reliable source of random
|
||||
# data from /dev/urandom), the internal hostapd random pool can be disabled.
|
||||
# This will save some in binary size and CPU use. However, this should only be
|
||||
# considered for builds that are known to be used on devices that meet the
|
||||
# requirements described above.
|
||||
CONFIG_NO_RANDOM_POOL=y
|
||||
|
||||
# Should we attempt to use the getrandom(2) call that provides more reliable
|
||||
# yet secure randomness source than /dev/random on Linux 3.17 and newer.
|
||||
# Requires glibc 2.25 to build, falls back to /dev/random if unavailable.
|
||||
CONFIG_GETRANDOM=y
|
||||
|
||||
# Should we use poll instead of select? Select is used by default.
|
||||
#CONFIG_ELOOP_POLL=y
|
||||
|
||||
# Should we use epoll instead of select? Select is used by default.
|
||||
CONFIG_ELOOP_EPOLL=y
|
||||
|
||||
# Should we use kqueue instead of select? Select is used by default.
|
||||
#CONFIG_ELOOP_KQUEUE=y
|
||||
|
||||
# Select TLS implementation
|
||||
# openssl = OpenSSL (default)
|
||||
# gnutls = GnuTLS
|
||||
# internal = Internal TLSv1 implementation (experimental)
|
||||
# linux = Linux kernel AF_ALG and internal TLSv1 implementation (experimental)
|
||||
# none = Empty template
|
||||
CONFIG_TLS=internal
|
||||
|
||||
# TLS-based EAP methods require at least TLS v1.0. Newer version of TLS (v1.1)
|
||||
# can be enabled to get a stronger construction of messages when block ciphers
|
||||
# are used.
|
||||
#CONFIG_TLSV11=y
|
||||
|
||||
# TLS-based EAP methods require at least TLS v1.0. Newer version of TLS (v1.2)
|
||||
# can be enabled to enable use of stronger crypto algorithms.
|
||||
#CONFIG_TLSV12=y
|
||||
|
||||
# Select which ciphers to use by default with OpenSSL if the user does not
|
||||
# specify them.
|
||||
#CONFIG_TLS_DEFAULT_CIPHERS="DEFAULT:!EXP:!LOW"
|
||||
|
||||
# If CONFIG_TLS=internal is used, additional library and include paths are
|
||||
# needed for LibTomMath. Alternatively, an integrated, minimal version of
|
||||
# LibTomMath can be used. See beginning of libtommath.c for details on benefits
|
||||
# and drawbacks of this option.
|
||||
#CONFIG_INTERNAL_LIBTOMMATH=y
|
||||
#ifndef CONFIG_INTERNAL_LIBTOMMATH
|
||||
#LTM_PATH=/usr/src/libtommath-0.39
|
||||
#CFLAGS += -I$(LTM_PATH)
|
||||
#LIBS += -L$(LTM_PATH)
|
||||
#LIBS_p += -L$(LTM_PATH)
|
||||
#endif
|
||||
# At the cost of about 4 kB of additional binary size, the internal LibTomMath
|
||||
# can be configured to include faster routines for exptmod, sqr, and div to
|
||||
# speed up DH and RSA calculation considerably
|
||||
#CONFIG_INTERNAL_LIBTOMMATH_FAST=y
|
||||
|
||||
# Interworking (IEEE 802.11u)
|
||||
# This can be used to enable functionality to improve interworking with
|
||||
# external networks.
|
||||
#CONFIG_INTERWORKING=y
|
||||
|
||||
# Hotspot 2.0
|
||||
#CONFIG_HS20=y
|
||||
|
||||
# Enable SQLite database support in hlr_auc_gw, EAP-SIM DB, and eap_user_file
|
||||
#CONFIG_SQLITE=y
|
||||
|
||||
# Enable Fast Session Transfer (FST)
|
||||
#CONFIG_FST=y
|
||||
|
||||
# Enable CLI commands for FST testing
|
||||
#CONFIG_FST_TEST=y
|
||||
|
||||
# Testing options
|
||||
# This can be used to enable some testing options (see also the example
|
||||
# configuration file) that are really useful only for testing clients that
|
||||
# connect to this hostapd. These options allow, for example, to drop a
|
||||
# certain percentage of probe requests or auth/(re)assoc frames.
|
||||
#
|
||||
#CONFIG_TESTING_OPTIONS=y
|
||||
|
||||
# Automatic Channel Selection
|
||||
# This will allow hostapd to pick the channel automatically when channel is set
|
||||
# to "acs_survey" or "0". Eventually, other ACS algorithms can be added in
|
||||
# similar way.
|
||||
#
|
||||
# Automatic selection is currently only done through initialization, later on
|
||||
# we hope to do background checks to keep us moving to more ideal channels as
|
||||
# time goes by. ACS is currently only supported through the nl80211 driver and
|
||||
# your driver must have survey dump capability that is filled by the driver
|
||||
# during scanning.
|
||||
#
|
||||
# You can customize the ACS survey algorithm with the hostapd.conf variable
|
||||
# acs_num_scans.
|
||||
#
|
||||
# Supported ACS drivers:
|
||||
# * ath9k
|
||||
# * ath5k
|
||||
# * ath10k
|
||||
#
|
||||
# For more details refer to:
|
||||
# http://wireless.kernel.org/en/users/Documentation/acs
|
||||
#
|
||||
#CONFIG_ACS=y
|
||||
|
||||
# Multiband Operation support
|
||||
# These extentions facilitate efficient use of multiple frequency bands
|
||||
# available to the AP and the devices that may associate with it.
|
||||
#CONFIG_MBO=y
|
||||
|
||||
# Client Taxonomy
|
||||
# Has the AP retain the Probe Request and (Re)Association Request frames from
|
||||
# a client, from which a signature can be produced which can identify the model
|
||||
# of client device like "Nexus 6P" or "iPhone 5s".
|
||||
#CONFIG_TAXONOMY=y
|
||||
|
||||
# Fast Initial Link Setup (FILS) (IEEE 802.11ai)
|
||||
#CONFIG_FILS=y
|
||||
# FILS shared key authentication with PFS
|
||||
#CONFIG_FILS_SK_PFS=y
|
||||
|
||||
# Include internal line edit mode in hostapd_cli. This can be used to provide
|
||||
# limited command line editing and history support.
|
||||
#CONFIG_WPA_CLI_EDIT=y
|
||||
|
||||
# Opportunistic Wireless Encryption (OWE)
|
||||
# Experimental implementation of draft-harkins-owe-07.txt
|
||||
#CONFIG_OWE=y
|
||||
|
||||
# Airtime policy support
|
||||
CONFIG_AIRTIME_POLICY=y
|
||||
|
||||
# Proxy ARP support
|
||||
#CONFIG_PROXYARP=y
|
||||
|
||||
# Override default value for the wpa_disable_eapol_key_retries configuration
|
||||
# parameter. See that parameter in hostapd.conf for more details.
|
||||
#CFLAGS += -DDEFAULT_WPA_DISABLE_EAPOL_KEY_RETRIES=1
|
||||
|
||||
# uBus IPC/RPC System
|
||||
# Services can connect to the bus and provide methods
|
||||
# that can be called by other services or clients.
|
||||
CONFIG_UBUS=y
|
||||
|
||||
# OpenWrt patch 380-disable-ctrl-iface-mib.patch
|
||||
# leads to the MIB only being compiled in if
|
||||
# CONFIG_CTRL_IFACE_MIB is enabled.
|
||||
#CONFIG_CTRL_IFACE_MIB=y
|
||||
@@ -1,404 +0,0 @@
|
||||
# Example hostapd build time configuration
|
||||
#
|
||||
# This file lists the configuration options that are used when building the
|
||||
# hostapd binary. All lines starting with # are ignored. Configuration option
|
||||
# lines must be commented out complete, if they are not to be included, i.e.,
|
||||
# just setting VARIABLE=n is not disabling that variable.
|
||||
#
|
||||
# This file is included in Makefile, so variables like CFLAGS and LIBS can also
|
||||
# be modified from here. In most cass, these lines should use += in order not
|
||||
# to override previous values of the variables.
|
||||
|
||||
# Driver interface for Host AP driver
|
||||
#CONFIG_DRIVER_HOSTAP=y
|
||||
|
||||
# Driver interface for wired authenticator
|
||||
CONFIG_DRIVER_WIRED=y
|
||||
|
||||
# Driver interface for drivers using the nl80211 kernel interface
|
||||
CONFIG_DRIVER_NL80211=y
|
||||
|
||||
# QCA vendor extensions to nl80211
|
||||
#CONFIG_DRIVER_NL80211_QCA=y
|
||||
|
||||
# driver_nl80211.c requires libnl. If you are compiling it yourself
|
||||
# you may need to point hostapd to your version of libnl.
|
||||
#
|
||||
#CFLAGS += -I$<path to libnl include files>
|
||||
#LIBS += -L$<path to libnl library files>
|
||||
|
||||
# Use libnl v2.0 (or 3.0) libraries.
|
||||
#CONFIG_LIBNL20=y
|
||||
|
||||
# Use libnl 3.2 libraries (if this is selected, CONFIG_LIBNL20 is ignored)
|
||||
#CONFIG_LIBNL32=y
|
||||
|
||||
|
||||
# Driver interface for FreeBSD net80211 layer (e.g., Atheros driver)
|
||||
#CONFIG_DRIVER_BSD=y
|
||||
#CFLAGS += -I/usr/local/include
|
||||
#LIBS += -L/usr/local/lib
|
||||
#LIBS_p += -L/usr/local/lib
|
||||
#LIBS_c += -L/usr/local/lib
|
||||
|
||||
# Driver interface for no driver (e.g., RADIUS server only)
|
||||
#CONFIG_DRIVER_NONE=y
|
||||
|
||||
# IEEE 802.11F/IAPP
|
||||
CONFIG_IAPP=y
|
||||
|
||||
# WPA2/IEEE 802.11i RSN pre-authentication
|
||||
CONFIG_RSN_PREAUTH=y
|
||||
|
||||
# IEEE 802.11w (management frame protection)
|
||||
#CONFIG_IEEE80211W=y
|
||||
|
||||
# Support Operating Channel Validation
|
||||
CONFIG_OCV=y
|
||||
|
||||
# Integrated EAP server
|
||||
CONFIG_EAP=y
|
||||
|
||||
# EAP Re-authentication Protocol (ERP) in integrated EAP server
|
||||
CONFIG_ERP=y
|
||||
|
||||
# EAP-MD5 for the integrated EAP server
|
||||
CONFIG_EAP_MD5=y
|
||||
|
||||
# EAP-TLS for the integrated EAP server
|
||||
CONFIG_EAP_TLS=y
|
||||
|
||||
# EAP-MSCHAPv2 for the integrated EAP server
|
||||
CONFIG_EAP_MSCHAPV2=y
|
||||
|
||||
# EAP-PEAP for the integrated EAP server
|
||||
CONFIG_EAP_PEAP=y
|
||||
|
||||
# EAP-GTC for the integrated EAP server
|
||||
CONFIG_EAP_GTC=y
|
||||
|
||||
# EAP-TTLS for the integrated EAP server
|
||||
CONFIG_EAP_TTLS=y
|
||||
|
||||
# EAP-SIM for the integrated EAP server
|
||||
#CONFIG_EAP_SIM=y
|
||||
|
||||
# EAP-AKA for the integrated EAP server
|
||||
#CONFIG_EAP_AKA=y
|
||||
|
||||
# EAP-AKA' for the integrated EAP server
|
||||
# This requires CONFIG_EAP_AKA to be enabled, too.
|
||||
#CONFIG_EAP_AKA_PRIME=y
|
||||
|
||||
# EAP-PAX for the integrated EAP server
|
||||
#CONFIG_EAP_PAX=y
|
||||
|
||||
# EAP-PSK for the integrated EAP server (this is _not_ needed for WPA-PSK)
|
||||
CONFIG_EAP_PSK=y
|
||||
|
||||
# EAP-pwd for the integrated EAP server (secure authentication with a password)
|
||||
CONFIG_EAP_PWD=y
|
||||
|
||||
# EAP-SAKE for the integrated EAP server
|
||||
#CONFIG_EAP_SAKE=y
|
||||
|
||||
# EAP-GPSK for the integrated EAP server
|
||||
#CONFIG_EAP_GPSK=y
|
||||
# Include support for optional SHA256 cipher suite in EAP-GPSK
|
||||
#CONFIG_EAP_GPSK_SHA256=y
|
||||
|
||||
# EAP-FAST for the integrated EAP server
|
||||
CONFIG_EAP_FAST=y
|
||||
|
||||
# EAP-TEAP for the integrated EAP server
|
||||
# Note: The current EAP-TEAP implementation is experimental and should not be
|
||||
# enabled for production use. The IETF RFC 7170 that defines EAP-TEAP has number
|
||||
# of conflicting statements and missing details and the implementation has
|
||||
# vendor specific workarounds for those and as such, may not interoperate with
|
||||
# any other implementation. This should not be used for anything else than
|
||||
# experimentation and interoperability testing until those issues has been
|
||||
# resolved.
|
||||
#CONFIG_EAP_TEAP=y
|
||||
|
||||
# Wi-Fi Protected Setup (WPS)
|
||||
CONFIG_WPS=y
|
||||
# Enable UPnP support for external WPS Registrars
|
||||
#CONFIG_WPS_UPNP=y
|
||||
# Enable WPS support with NFC config method
|
||||
#CONFIG_WPS_NFC=y
|
||||
|
||||
# EAP-IKEv2
|
||||
#CONFIG_EAP_IKEV2=y
|
||||
|
||||
# Trusted Network Connect (EAP-TNC)
|
||||
#CONFIG_EAP_TNC=y
|
||||
|
||||
# EAP-EKE for the integrated EAP server
|
||||
#CONFIG_EAP_EKE=y
|
||||
|
||||
# PKCS#12 (PFX) support (used to read private key and certificate file from
|
||||
# a file that usually has extension .p12 or .pfx)
|
||||
CONFIG_PKCS12=y
|
||||
|
||||
# RADIUS authentication server. This provides access to the integrated EAP
|
||||
# server from external hosts using RADIUS.
|
||||
CONFIG_RADIUS_SERVER=y
|
||||
|
||||
# Build IPv6 support for RADIUS operations
|
||||
CONFIG_IPV6=y
|
||||
|
||||
# IEEE Std 802.11r-2008 (Fast BSS Transition)
|
||||
CONFIG_IEEE80211R=y
|
||||
|
||||
# Use the hostapd's IEEE 802.11 authentication (ACL), but without
|
||||
# the IEEE 802.11 Management capability (e.g., FreeBSD/net80211)
|
||||
#CONFIG_DRIVER_RADIUS_ACL=y
|
||||
|
||||
# IEEE 802.11n (High Throughput) support
|
||||
CONFIG_IEEE80211N=y
|
||||
|
||||
# Wireless Network Management (IEEE Std 802.11v-2011)
|
||||
# Note: This is experimental and not complete implementation.
|
||||
CONFIG_WNM=y
|
||||
|
||||
# IEEE 802.11ac (Very High Throughput) support
|
||||
CONFIG_IEEE80211AC=y
|
||||
|
||||
# IEEE 802.11ax HE support
|
||||
# Note: This is experimental and work in progress. The definitions are still
|
||||
# subject to change and this should not be expected to interoperate with the
|
||||
# final IEEE 802.11ax version.
|
||||
#CONFIG_IEEE80211AX=y
|
||||
|
||||
# Remove debugging code that is printing out debug messages to stdout.
|
||||
# This can be used to reduce the size of the hostapd considerably if debugging
|
||||
# code is not needed.
|
||||
#CONFIG_NO_STDOUT_DEBUG=y
|
||||
|
||||
# Add support for writing debug log to a file: -f /tmp/hostapd.log
|
||||
# Disabled by default.
|
||||
#CONFIG_DEBUG_FILE=y
|
||||
|
||||
# Send debug messages to syslog instead of stdout
|
||||
CONFIG_DEBUG_SYSLOG=y
|
||||
|
||||
# Add support for sending all debug messages (regardless of debug verbosity)
|
||||
# to the Linux kernel tracing facility. This helps debug the entire stack by
|
||||
# making it easy to record everything happening from the driver up into the
|
||||
# same file, e.g., using trace-cmd.
|
||||
#CONFIG_DEBUG_LINUX_TRACING=y
|
||||
|
||||
# Remove support for RADIUS accounting
|
||||
#CONFIG_NO_ACCOUNTING=y
|
||||
|
||||
# Remove support for RADIUS
|
||||
#CONFIG_NO_RADIUS=y
|
||||
|
||||
# Remove support for VLANs
|
||||
#CONFIG_NO_VLAN=y
|
||||
|
||||
# Enable support for fully dynamic VLANs. This enables hostapd to
|
||||
# automatically create bridge and VLAN interfaces if necessary.
|
||||
CONFIG_FULL_DYNAMIC_VLAN=y
|
||||
|
||||
# Use netlink-based kernel API for VLAN operations instead of ioctl()
|
||||
# Note: This requires libnl 3.1 or newer.
|
||||
#CONFIG_VLAN_NETLINK=y
|
||||
|
||||
# Remove support for dumping internal state through control interface commands
|
||||
# This can be used to reduce binary size at the cost of disabling a debugging
|
||||
# option.
|
||||
CONFIG_NO_DUMP_STATE=y
|
||||
|
||||
# Enable tracing code for developer debugging
|
||||
# This tracks use of memory allocations and other registrations and reports
|
||||
# incorrect use with a backtrace of call (or allocation) location.
|
||||
#CONFIG_WPA_TRACE=y
|
||||
# For BSD, comment out these.
|
||||
#LIBS += -lexecinfo
|
||||
#LIBS_p += -lexecinfo
|
||||
#LIBS_c += -lexecinfo
|
||||
|
||||
# Use libbfd to get more details for developer debugging
|
||||
# This enables use of libbfd to get more detailed symbols for the backtraces
|
||||
# generated by CONFIG_WPA_TRACE=y.
|
||||
#CONFIG_WPA_TRACE_BFD=y
|
||||
# For BSD, comment out these.
|
||||
#LIBS += -lbfd -liberty -lz
|
||||
#LIBS_p += -lbfd -liberty -lz
|
||||
#LIBS_c += -lbfd -liberty -lz
|
||||
|
||||
# hostapd depends on strong random number generation being available from the
|
||||
# operating system. os_get_random() function is used to fetch random data when
|
||||
# needed, e.g., for key generation. On Linux and BSD systems, this works by
|
||||
# reading /dev/urandom. It should be noted that the OS entropy pool needs to be
|
||||
# properly initialized before hostapd is started. This is important especially
|
||||
# on embedded devices that do not have a hardware random number generator and
|
||||
# may by default start up with minimal entropy available for random number
|
||||
# generation.
|
||||
#
|
||||
# As a safety net, hostapd is by default trying to internally collect
|
||||
# additional entropy for generating random data to mix in with the data
|
||||
# fetched from the OS. This by itself is not considered to be very strong, but
|
||||
# it may help in cases where the system pool is not initialized properly.
|
||||
# However, it is very strongly recommended that the system pool is initialized
|
||||
# with enough entropy either by using hardware assisted random number
|
||||
# generator or by storing state over device reboots.
|
||||
#
|
||||
# hostapd can be configured to maintain its own entropy store over restarts to
|
||||
# enhance random number generation. This is not perfect, but it is much more
|
||||
# secure than using the same sequence of random numbers after every reboot.
|
||||
# This can be enabled with -e<entropy file> command line option. The specified
|
||||
# file needs to be readable and writable by hostapd.
|
||||
#
|
||||
# If the os_get_random() is known to provide strong random data (e.g., on
|
||||
# Linux/BSD, the board in question is known to have reliable source of random
|
||||
# data from /dev/urandom), the internal hostapd random pool can be disabled.
|
||||
# This will save some in binary size and CPU use. However, this should only be
|
||||
# considered for builds that are known to be used on devices that meet the
|
||||
# requirements described above.
|
||||
CONFIG_NO_RANDOM_POOL=y
|
||||
|
||||
# Should we attempt to use the getrandom(2) call that provides more reliable
|
||||
# yet secure randomness source than /dev/random on Linux 3.17 and newer.
|
||||
# Requires glibc 2.25 to build, falls back to /dev/random if unavailable.
|
||||
CONFIG_GETRANDOM=y
|
||||
|
||||
# Should we use poll instead of select? Select is used by default.
|
||||
#CONFIG_ELOOP_POLL=y
|
||||
|
||||
# Should we use epoll instead of select? Select is used by default.
|
||||
CONFIG_ELOOP_EPOLL=y
|
||||
|
||||
# Should we use kqueue instead of select? Select is used by default.
|
||||
#CONFIG_ELOOP_KQUEUE=y
|
||||
|
||||
# Select TLS implementation
|
||||
# openssl = OpenSSL (default)
|
||||
# gnutls = GnuTLS
|
||||
# internal = Internal TLSv1 implementation (experimental)
|
||||
# linux = Linux kernel AF_ALG and internal TLSv1 implementation (experimental)
|
||||
# none = Empty template
|
||||
CONFIG_TLS=internal
|
||||
|
||||
# TLS-based EAP methods require at least TLS v1.0. Newer version of TLS (v1.1)
|
||||
# can be enabled to get a stronger construction of messages when block ciphers
|
||||
# are used.
|
||||
#CONFIG_TLSV11=y
|
||||
|
||||
# TLS-based EAP methods require at least TLS v1.0. Newer version of TLS (v1.2)
|
||||
# can be enabled to enable use of stronger crypto algorithms.
|
||||
#CONFIG_TLSV12=y
|
||||
|
||||
# Select which ciphers to use by default with OpenSSL if the user does not
|
||||
# specify them.
|
||||
#CONFIG_TLS_DEFAULT_CIPHERS="DEFAULT:!EXP:!LOW"
|
||||
|
||||
# If CONFIG_TLS=internal is used, additional library and include paths are
|
||||
# needed for LibTomMath. Alternatively, an integrated, minimal version of
|
||||
# LibTomMath can be used. See beginning of libtommath.c for details on benefits
|
||||
# and drawbacks of this option.
|
||||
CONFIG_INTERNAL_LIBTOMMATH=y
|
||||
#ifndef CONFIG_INTERNAL_LIBTOMMATH
|
||||
#LTM_PATH=/usr/src/libtommath-0.39
|
||||
#CFLAGS += -I$(LTM_PATH)
|
||||
#LIBS += -L$(LTM_PATH)
|
||||
#LIBS_p += -L$(LTM_PATH)
|
||||
#endif
|
||||
# At the cost of about 4 kB of additional binary size, the internal LibTomMath
|
||||
# can be configured to include faster routines for exptmod, sqr, and div to
|
||||
# speed up DH and RSA calculation considerably
|
||||
#CONFIG_INTERNAL_LIBTOMMATH_FAST=y
|
||||
|
||||
# Interworking (IEEE 802.11u)
|
||||
# This can be used to enable functionality to improve interworking with
|
||||
# external networks.
|
||||
CONFIG_INTERWORKING=y
|
||||
|
||||
# Hotspot 2.0
|
||||
CONFIG_HS20=y
|
||||
|
||||
# Enable SQLite database support in hlr_auc_gw, EAP-SIM DB, and eap_user_file
|
||||
#CONFIG_SQLITE=y
|
||||
|
||||
# Enable Fast Session Transfer (FST)
|
||||
#CONFIG_FST=y
|
||||
|
||||
# Enable CLI commands for FST testing
|
||||
#CONFIG_FST_TEST=y
|
||||
|
||||
# Testing options
|
||||
# This can be used to enable some testing options (see also the example
|
||||
# configuration file) that are really useful only for testing clients that
|
||||
# connect to this hostapd. These options allow, for example, to drop a
|
||||
# certain percentage of probe requests or auth/(re)assoc frames.
|
||||
#
|
||||
#CONFIG_TESTING_OPTIONS=y
|
||||
|
||||
# Automatic Channel Selection
|
||||
# This will allow hostapd to pick the channel automatically when channel is set
|
||||
# to "acs_survey" or "0". Eventually, other ACS algorithms can be added in
|
||||
# similar way.
|
||||
#
|
||||
# Automatic selection is currently only done through initialization, later on
|
||||
# we hope to do background checks to keep us moving to more ideal channels as
|
||||
# time goes by. ACS is currently only supported through the nl80211 driver and
|
||||
# your driver must have survey dump capability that is filled by the driver
|
||||
# during scanning.
|
||||
#
|
||||
# You can customize the ACS survey algorithm with the hostapd.conf variable
|
||||
# acs_num_scans.
|
||||
#
|
||||
# Supported ACS drivers:
|
||||
# * ath9k
|
||||
# * ath5k
|
||||
# * ath10k
|
||||
#
|
||||
# For more details refer to:
|
||||
# http://wireless.kernel.org/en/users/Documentation/acs
|
||||
#
|
||||
#CONFIG_ACS=y
|
||||
|
||||
# Multiband Operation support
|
||||
# These extentions facilitate efficient use of multiple frequency bands
|
||||
# available to the AP and the devices that may associate with it.
|
||||
#CONFIG_MBO=y
|
||||
|
||||
# Client Taxonomy
|
||||
# Has the AP retain the Probe Request and (Re)Association Request frames from
|
||||
# a client, from which a signature can be produced which can identify the model
|
||||
# of client device like "Nexus 6P" or "iPhone 5s".
|
||||
CONFIG_TAXONOMY=y
|
||||
|
||||
# Fast Initial Link Setup (FILS) (IEEE 802.11ai)
|
||||
#CONFIG_FILS=y
|
||||
# FILS shared key authentication with PFS
|
||||
#CONFIG_FILS_SK_PFS=y
|
||||
|
||||
# Include internal line edit mode in hostapd_cli. This can be used to provide
|
||||
# limited command line editing and history support.
|
||||
#CONFIG_WPA_CLI_EDIT=y
|
||||
|
||||
# Opportunistic Wireless Encryption (OWE)
|
||||
# Experimental implementation of draft-harkins-owe-07.txt
|
||||
#CONFIG_OWE=y
|
||||
|
||||
# Airtime policy support
|
||||
CONFIG_AIRTIME_POLICY=y
|
||||
|
||||
# Proxy ARP support
|
||||
CONFIG_PROXYARP=y
|
||||
|
||||
# Override default value for the wpa_disable_eapol_key_retries configuration
|
||||
# parameter. See that parameter in hostapd.conf for more details.
|
||||
#CFLAGS += -DDEFAULT_WPA_DISABLE_EAPOL_KEY_RETRIES=1
|
||||
|
||||
# uBus IPC/RPC System
|
||||
# Services can connect to the bus and provide methods
|
||||
# that can be called by other services or clients.
|
||||
CONFIG_UBUS=y
|
||||
|
||||
# OpenWrt patch 380-disable-ctrl-iface-mib.patch
|
||||
# leads to the MIB only being compiled in if
|
||||
# CONFIG_CTRL_IFACE_MIB is enabled.
|
||||
CONFIG_CTRL_IFACE_MIB=y
|
||||
@@ -1,404 +0,0 @@
|
||||
# Example hostapd build time configuration
|
||||
#
|
||||
# This file lists the configuration options that are used when building the
|
||||
# hostapd binary. All lines starting with # are ignored. Configuration option
|
||||
# lines must be commented out complete, if they are not to be included, i.e.,
|
||||
# just setting VARIABLE=n is not disabling that variable.
|
||||
#
|
||||
# This file is included in Makefile, so variables like CFLAGS and LIBS can also
|
||||
# be modified from here. In most cass, these lines should use += in order not
|
||||
# to override previous values of the variables.
|
||||
|
||||
# Driver interface for Host AP driver
|
||||
#CONFIG_DRIVER_HOSTAP=y
|
||||
|
||||
# Driver interface for wired authenticator
|
||||
CONFIG_DRIVER_WIRED=y
|
||||
|
||||
# Driver interface for drivers using the nl80211 kernel interface
|
||||
CONFIG_DRIVER_NL80211=y
|
||||
|
||||
# QCA vendor extensions to nl80211
|
||||
#CONFIG_DRIVER_NL80211_QCA=y
|
||||
|
||||
# driver_nl80211.c requires libnl. If you are compiling it yourself
|
||||
# you may need to point hostapd to your version of libnl.
|
||||
#
|
||||
#CFLAGS += -I$<path to libnl include files>
|
||||
#LIBS += -L$<path to libnl library files>
|
||||
|
||||
# Use libnl v2.0 (or 3.0) libraries.
|
||||
#CONFIG_LIBNL20=y
|
||||
|
||||
# Use libnl 3.2 libraries (if this is selected, CONFIG_LIBNL20 is ignored)
|
||||
#CONFIG_LIBNL32=y
|
||||
|
||||
|
||||
# Driver interface for FreeBSD net80211 layer (e.g., Atheros driver)
|
||||
#CONFIG_DRIVER_BSD=y
|
||||
#CFLAGS += -I/usr/local/include
|
||||
#LIBS += -L/usr/local/lib
|
||||
#LIBS_p += -L/usr/local/lib
|
||||
#LIBS_c += -L/usr/local/lib
|
||||
|
||||
# Driver interface for no driver (e.g., RADIUS server only)
|
||||
#CONFIG_DRIVER_NONE=y
|
||||
|
||||
# IEEE 802.11F/IAPP
|
||||
#CONFIG_IAPP=y
|
||||
|
||||
# WPA2/IEEE 802.11i RSN pre-authentication
|
||||
CONFIG_RSN_PREAUTH=y
|
||||
|
||||
# IEEE 802.11w (management frame protection)
|
||||
#CONFIG_IEEE80211W=y
|
||||
|
||||
# Support Operating Channel Validation
|
||||
#CONFIG_OCV=y
|
||||
|
||||
# Integrated EAP server
|
||||
#CONFIG_EAP=y
|
||||
|
||||
# EAP Re-authentication Protocol (ERP) in integrated EAP server
|
||||
#CONFIG_ERP=y
|
||||
|
||||
# EAP-MD5 for the integrated EAP server
|
||||
#CONFIG_EAP_MD5=y
|
||||
|
||||
# EAP-TLS for the integrated EAP server
|
||||
#CONFIG_EAP_TLS=y
|
||||
|
||||
# EAP-MSCHAPv2 for the integrated EAP server
|
||||
#CONFIG_EAP_MSCHAPV2=y
|
||||
|
||||
# EAP-PEAP for the integrated EAP server
|
||||
#CONFIG_EAP_PEAP=y
|
||||
|
||||
# EAP-GTC for the integrated EAP server
|
||||
#CONFIG_EAP_GTC=y
|
||||
|
||||
# EAP-TTLS for the integrated EAP server
|
||||
#CONFIG_EAP_TTLS=y
|
||||
|
||||
# EAP-SIM for the integrated EAP server
|
||||
#CONFIG_EAP_SIM=y
|
||||
|
||||
# EAP-AKA for the integrated EAP server
|
||||
#CONFIG_EAP_AKA=y
|
||||
|
||||
# EAP-AKA' for the integrated EAP server
|
||||
# This requires CONFIG_EAP_AKA to be enabled, too.
|
||||
#CONFIG_EAP_AKA_PRIME=y
|
||||
|
||||
# EAP-PAX for the integrated EAP server
|
||||
#CONFIG_EAP_PAX=y
|
||||
|
||||
# EAP-PSK for the integrated EAP server (this is _not_ needed for WPA-PSK)
|
||||
#CONFIG_EAP_PSK=y
|
||||
|
||||
# EAP-pwd for the integrated EAP server (secure authentication with a password)
|
||||
#CONFIG_EAP_PWD=y
|
||||
|
||||
# EAP-SAKE for the integrated EAP server
|
||||
#CONFIG_EAP_SAKE=y
|
||||
|
||||
# EAP-GPSK for the integrated EAP server
|
||||
#CONFIG_EAP_GPSK=y
|
||||
# Include support for optional SHA256 cipher suite in EAP-GPSK
|
||||
#CONFIG_EAP_GPSK_SHA256=y
|
||||
|
||||
# EAP-FAST for the integrated EAP server
|
||||
#CONFIG_EAP_FAST=y
|
||||
|
||||
# EAP-TEAP for the integrated EAP server
|
||||
# Note: The current EAP-TEAP implementation is experimental and should not be
|
||||
# enabled for production use. The IETF RFC 7170 that defines EAP-TEAP has number
|
||||
# of conflicting statements and missing details and the implementation has
|
||||
# vendor specific workarounds for those and as such, may not interoperate with
|
||||
# any other implementation. This should not be used for anything else than
|
||||
# experimentation and interoperability testing until those issues has been
|
||||
# resolved.
|
||||
#CONFIG_EAP_TEAP=y
|
||||
|
||||
# Wi-Fi Protected Setup (WPS)
|
||||
#CONFIG_WPS=y
|
||||
# Enable UPnP support for external WPS Registrars
|
||||
#CONFIG_WPS_UPNP=y
|
||||
# Enable WPS support with NFC config method
|
||||
#CONFIG_WPS_NFC=y
|
||||
|
||||
# EAP-IKEv2
|
||||
#CONFIG_EAP_IKEV2=y
|
||||
|
||||
# Trusted Network Connect (EAP-TNC)
|
||||
#CONFIG_EAP_TNC=y
|
||||
|
||||
# EAP-EKE for the integrated EAP server
|
||||
#CONFIG_EAP_EKE=y
|
||||
|
||||
# PKCS#12 (PFX) support (used to read private key and certificate file from
|
||||
# a file that usually has extension .p12 or .pfx)
|
||||
#CONFIG_PKCS12=y
|
||||
|
||||
# RADIUS authentication server. This provides access to the integrated EAP
|
||||
# server from external hosts using RADIUS.
|
||||
#CONFIG_RADIUS_SERVER=y
|
||||
|
||||
# Build IPv6 support for RADIUS operations
|
||||
#CONFIG_IPV6=y
|
||||
|
||||
# IEEE Std 802.11r-2008 (Fast BSS Transition)
|
||||
#CONFIG_IEEE80211R=y
|
||||
|
||||
# Use the hostapd's IEEE 802.11 authentication (ACL), but without
|
||||
# the IEEE 802.11 Management capability (e.g., FreeBSD/net80211)
|
||||
#CONFIG_DRIVER_RADIUS_ACL=y
|
||||
|
||||
# IEEE 802.11n (High Throughput) support
|
||||
CONFIG_IEEE80211N=y
|
||||
|
||||
# Wireless Network Management (IEEE Std 802.11v-2011)
|
||||
# Note: This is experimental and not complete implementation.
|
||||
#CONFIG_WNM=y
|
||||
|
||||
# IEEE 802.11ac (Very High Throughput) support
|
||||
CONFIG_IEEE80211AC=y
|
||||
|
||||
# IEEE 802.11ax HE support
|
||||
# Note: This is experimental and work in progress. The definitions are still
|
||||
# subject to change and this should not be expected to interoperate with the
|
||||
# final IEEE 802.11ax version.
|
||||
#CONFIG_IEEE80211AX=y
|
||||
|
||||
# Remove debugging code that is printing out debug messages to stdout.
|
||||
# This can be used to reduce the size of the hostapd considerably if debugging
|
||||
# code is not needed.
|
||||
#CONFIG_NO_STDOUT_DEBUG=y
|
||||
|
||||
# Add support for writing debug log to a file: -f /tmp/hostapd.log
|
||||
# Disabled by default.
|
||||
#CONFIG_DEBUG_FILE=y
|
||||
|
||||
# Send debug messages to syslog instead of stdout
|
||||
CONFIG_DEBUG_SYSLOG=y
|
||||
|
||||
# Add support for sending all debug messages (regardless of debug verbosity)
|
||||
# to the Linux kernel tracing facility. This helps debug the entire stack by
|
||||
# making it easy to record everything happening from the driver up into the
|
||||
# same file, e.g., using trace-cmd.
|
||||
#CONFIG_DEBUG_LINUX_TRACING=y
|
||||
|
||||
# Remove support for RADIUS accounting
|
||||
CONFIG_NO_ACCOUNTING=y
|
||||
|
||||
# Remove support for RADIUS
|
||||
CONFIG_NO_RADIUS=y
|
||||
|
||||
# Remove support for VLANs
|
||||
#CONFIG_NO_VLAN=y
|
||||
|
||||
# Enable support for fully dynamic VLANs. This enables hostapd to
|
||||
# automatically create bridge and VLAN interfaces if necessary.
|
||||
#CONFIG_FULL_DYNAMIC_VLAN=y
|
||||
|
||||
# Use netlink-based kernel API for VLAN operations instead of ioctl()
|
||||
# Note: This requires libnl 3.1 or newer.
|
||||
#CONFIG_VLAN_NETLINK=y
|
||||
|
||||
# Remove support for dumping internal state through control interface commands
|
||||
# This can be used to reduce binary size at the cost of disabling a debugging
|
||||
# option.
|
||||
CONFIG_NO_DUMP_STATE=y
|
||||
|
||||
# Enable tracing code for developer debugging
|
||||
# This tracks use of memory allocations and other registrations and reports
|
||||
# incorrect use with a backtrace of call (or allocation) location.
|
||||
#CONFIG_WPA_TRACE=y
|
||||
# For BSD, comment out these.
|
||||
#LIBS += -lexecinfo
|
||||
#LIBS_p += -lexecinfo
|
||||
#LIBS_c += -lexecinfo
|
||||
|
||||
# Use libbfd to get more details for developer debugging
|
||||
# This enables use of libbfd to get more detailed symbols for the backtraces
|
||||
# generated by CONFIG_WPA_TRACE=y.
|
||||
#CONFIG_WPA_TRACE_BFD=y
|
||||
# For BSD, comment out these.
|
||||
#LIBS += -lbfd -liberty -lz
|
||||
#LIBS_p += -lbfd -liberty -lz
|
||||
#LIBS_c += -lbfd -liberty -lz
|
||||
|
||||
# hostapd depends on strong random number generation being available from the
|
||||
# operating system. os_get_random() function is used to fetch random data when
|
||||
# needed, e.g., for key generation. On Linux and BSD systems, this works by
|
||||
# reading /dev/urandom. It should be noted that the OS entropy pool needs to be
|
||||
# properly initialized before hostapd is started. This is important especially
|
||||
# on embedded devices that do not have a hardware random number generator and
|
||||
# may by default start up with minimal entropy available for random number
|
||||
# generation.
|
||||
#
|
||||
# As a safety net, hostapd is by default trying to internally collect
|
||||
# additional entropy for generating random data to mix in with the data
|
||||
# fetched from the OS. This by itself is not considered to be very strong, but
|
||||
# it may help in cases where the system pool is not initialized properly.
|
||||
# However, it is very strongly recommended that the system pool is initialized
|
||||
# with enough entropy either by using hardware assisted random number
|
||||
# generator or by storing state over device reboots.
|
||||
#
|
||||
# hostapd can be configured to maintain its own entropy store over restarts to
|
||||
# enhance random number generation. This is not perfect, but it is much more
|
||||
# secure than using the same sequence of random numbers after every reboot.
|
||||
# This can be enabled with -e<entropy file> command line option. The specified
|
||||
# file needs to be readable and writable by hostapd.
|
||||
#
|
||||
# If the os_get_random() is known to provide strong random data (e.g., on
|
||||
# Linux/BSD, the board in question is known to have reliable source of random
|
||||
# data from /dev/urandom), the internal hostapd random pool can be disabled.
|
||||
# This will save some in binary size and CPU use. However, this should only be
|
||||
# considered for builds that are known to be used on devices that meet the
|
||||
# requirements described above.
|
||||
CONFIG_NO_RANDOM_POOL=y
|
||||
|
||||
# Should we attempt to use the getrandom(2) call that provides more reliable
|
||||
# yet secure randomness source than /dev/random on Linux 3.17 and newer.
|
||||
# Requires glibc 2.25 to build, falls back to /dev/random if unavailable.
|
||||
CONFIG_GETRANDOM=y
|
||||
|
||||
# Should we use poll instead of select? Select is used by default.
|
||||
#CONFIG_ELOOP_POLL=y
|
||||
|
||||
# Should we use epoll instead of select? Select is used by default.
|
||||
CONFIG_ELOOP_EPOLL=y
|
||||
|
||||
# Should we use kqueue instead of select? Select is used by default.
|
||||
#CONFIG_ELOOP_KQUEUE=y
|
||||
|
||||
# Select TLS implementation
|
||||
# openssl = OpenSSL (default)
|
||||
# gnutls = GnuTLS
|
||||
# internal = Internal TLSv1 implementation (experimental)
|
||||
# linux = Linux kernel AF_ALG and internal TLSv1 implementation (experimental)
|
||||
# none = Empty template
|
||||
CONFIG_TLS=internal
|
||||
|
||||
# TLS-based EAP methods require at least TLS v1.0. Newer version of TLS (v1.1)
|
||||
# can be enabled to get a stronger construction of messages when block ciphers
|
||||
# are used.
|
||||
#CONFIG_TLSV11=y
|
||||
|
||||
# TLS-based EAP methods require at least TLS v1.0. Newer version of TLS (v1.2)
|
||||
# can be enabled to enable use of stronger crypto algorithms.
|
||||
#CONFIG_TLSV12=y
|
||||
|
||||
# Select which ciphers to use by default with OpenSSL if the user does not
|
||||
# specify them.
|
||||
#CONFIG_TLS_DEFAULT_CIPHERS="DEFAULT:!EXP:!LOW"
|
||||
|
||||
# If CONFIG_TLS=internal is used, additional library and include paths are
|
||||
# needed for LibTomMath. Alternatively, an integrated, minimal version of
|
||||
# LibTomMath can be used. See beginning of libtommath.c for details on benefits
|
||||
# and drawbacks of this option.
|
||||
#CONFIG_INTERNAL_LIBTOMMATH=y
|
||||
#ifndef CONFIG_INTERNAL_LIBTOMMATH
|
||||
#LTM_PATH=/usr/src/libtommath-0.39
|
||||
#CFLAGS += -I$(LTM_PATH)
|
||||
#LIBS += -L$(LTM_PATH)
|
||||
#LIBS_p += -L$(LTM_PATH)
|
||||
#endif
|
||||
# At the cost of about 4 kB of additional binary size, the internal LibTomMath
|
||||
# can be configured to include faster routines for exptmod, sqr, and div to
|
||||
# speed up DH and RSA calculation considerably
|
||||
#CONFIG_INTERNAL_LIBTOMMATH_FAST=y
|
||||
|
||||
# Interworking (IEEE 802.11u)
|
||||
# This can be used to enable functionality to improve interworking with
|
||||
# external networks.
|
||||
#CONFIG_INTERWORKING=y
|
||||
|
||||
# Hotspot 2.0
|
||||
#CONFIG_HS20=y
|
||||
|
||||
# Enable SQLite database support in hlr_auc_gw, EAP-SIM DB, and eap_user_file
|
||||
#CONFIG_SQLITE=y
|
||||
|
||||
# Enable Fast Session Transfer (FST)
|
||||
#CONFIG_FST=y
|
||||
|
||||
# Enable CLI commands for FST testing
|
||||
#CONFIG_FST_TEST=y
|
||||
|
||||
# Testing options
|
||||
# This can be used to enable some testing options (see also the example
|
||||
# configuration file) that are really useful only for testing clients that
|
||||
# connect to this hostapd. These options allow, for example, to drop a
|
||||
# certain percentage of probe requests or auth/(re)assoc frames.
|
||||
#
|
||||
#CONFIG_TESTING_OPTIONS=y
|
||||
|
||||
# Automatic Channel Selection
|
||||
# This will allow hostapd to pick the channel automatically when channel is set
|
||||
# to "acs_survey" or "0". Eventually, other ACS algorithms can be added in
|
||||
# similar way.
|
||||
#
|
||||
# Automatic selection is currently only done through initialization, later on
|
||||
# we hope to do background checks to keep us moving to more ideal channels as
|
||||
# time goes by. ACS is currently only supported through the nl80211 driver and
|
||||
# your driver must have survey dump capability that is filled by the driver
|
||||
# during scanning.
|
||||
#
|
||||
# You can customize the ACS survey algorithm with the hostapd.conf variable
|
||||
# acs_num_scans.
|
||||
#
|
||||
# Supported ACS drivers:
|
||||
# * ath9k
|
||||
# * ath5k
|
||||
# * ath10k
|
||||
#
|
||||
# For more details refer to:
|
||||
# http://wireless.kernel.org/en/users/Documentation/acs
|
||||
#
|
||||
#CONFIG_ACS=y
|
||||
|
||||
# Multiband Operation support
|
||||
# These extentions facilitate efficient use of multiple frequency bands
|
||||
# available to the AP and the devices that may associate with it.
|
||||
#CONFIG_MBO=y
|
||||
|
||||
# Client Taxonomy
|
||||
# Has the AP retain the Probe Request and (Re)Association Request frames from
|
||||
# a client, from which a signature can be produced which can identify the model
|
||||
# of client device like "Nexus 6P" or "iPhone 5s".
|
||||
#CONFIG_TAXONOMY=y
|
||||
|
||||
# Fast Initial Link Setup (FILS) (IEEE 802.11ai)
|
||||
#CONFIG_FILS=y
|
||||
# FILS shared key authentication with PFS
|
||||
#CONFIG_FILS_SK_PFS=y
|
||||
|
||||
# Include internal line edit mode in hostapd_cli. This can be used to provide
|
||||
# limited command line editing and history support.
|
||||
#CONFIG_WPA_CLI_EDIT=y
|
||||
|
||||
# Opportunistic Wireless Encryption (OWE)
|
||||
# Experimental implementation of draft-harkins-owe-07.txt
|
||||
#CONFIG_OWE=y
|
||||
|
||||
# Airtime policy support
|
||||
#CONFIG_AIRTIME_POLICY=y
|
||||
|
||||
# Proxy ARP support
|
||||
#CONFIG_PROXYARP=y
|
||||
|
||||
# Override default value for the wpa_disable_eapol_key_retries configuration
|
||||
# parameter. See that parameter in hostapd.conf for more details.
|
||||
#CFLAGS += -DDEFAULT_WPA_DISABLE_EAPOL_KEY_RETRIES=1
|
||||
|
||||
# uBus IPC/RPC System
|
||||
# Services can connect to the bus and provide methods
|
||||
# that can be called by other services or clients.
|
||||
CONFIG_UBUS=y
|
||||
|
||||
# OpenWrt patch 380-disable-ctrl-iface-mib.patch
|
||||
# leads to the MIB only being compiled in if
|
||||
# CONFIG_CTRL_IFACE_MIB is enabled.
|
||||
#CONFIG_CTRL_IFACE_MIB=y
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,625 +0,0 @@
|
||||
# Example wpa_supplicant build time configuration
|
||||
#
|
||||
# This file lists the configuration options that are used when building the
|
||||
# wpa_supplicant binary. All lines starting with # are ignored. Configuration
|
||||
# option lines must be commented out complete, if they are not to be included,
|
||||
# i.e., just setting VARIABLE=n is not disabling that variable.
|
||||
#
|
||||
# This file is included in Makefile, so variables like CFLAGS and LIBS can also
|
||||
# be modified from here. In most cases, these lines should use += in order not
|
||||
# to override previous values of the variables.
|
||||
|
||||
|
||||
# Uncomment following two lines and fix the paths if you have installed OpenSSL
|
||||
# or GnuTLS in non-default location
|
||||
#CFLAGS += -I/usr/local/openssl/include
|
||||
#LIBS += -L/usr/local/openssl/lib
|
||||
|
||||
# Some Red Hat versions seem to include kerberos header files from OpenSSL, but
|
||||
# the kerberos files are not in the default include path. Following line can be
|
||||
# used to fix build issues on such systems (krb5.h not found).
|
||||
#CFLAGS += -I/usr/include/kerberos
|
||||
|
||||
# Driver interface for generic Linux wireless extensions
|
||||
# Note: WEXT is deprecated in the current Linux kernel version and no new
|
||||
# functionality is added to it. nl80211-based interface is the new
|
||||
# replacement for WEXT and its use allows wpa_supplicant to properly control
|
||||
# the driver to improve existing functionality like roaming and to support new
|
||||
# functionality.
|
||||
#CONFIG_DRIVER_WEXT=y
|
||||
|
||||
# Driver interface for Linux drivers using the nl80211 kernel interface
|
||||
CONFIG_DRIVER_NL80211=y
|
||||
|
||||
# QCA vendor extensions to nl80211
|
||||
#CONFIG_DRIVER_NL80211_QCA=y
|
||||
|
||||
# driver_nl80211.c requires libnl. If you are compiling it yourself
|
||||
# you may need to point hostapd to your version of libnl.
|
||||
#
|
||||
#CFLAGS += -I$<path to libnl include files>
|
||||
#LIBS += -L$<path to libnl library files>
|
||||
|
||||
# Use libnl v2.0 (or 3.0) libraries.
|
||||
#CONFIG_LIBNL20=y
|
||||
|
||||
# Use libnl 3.2 libraries (if this is selected, CONFIG_LIBNL20 is ignored)
|
||||
#CONFIG_LIBNL32=y
|
||||
|
||||
|
||||
# Driver interface for FreeBSD net80211 layer (e.g., Atheros driver)
|
||||
#CONFIG_DRIVER_BSD=y
|
||||
#CFLAGS += -I/usr/local/include
|
||||
#LIBS += -L/usr/local/lib
|
||||
#LIBS_p += -L/usr/local/lib
|
||||
#LIBS_c += -L/usr/local/lib
|
||||
|
||||
# Driver interface for Windows NDIS
|
||||
#CONFIG_DRIVER_NDIS=y
|
||||
#CFLAGS += -I/usr/include/w32api/ddk
|
||||
#LIBS += -L/usr/local/lib
|
||||
# For native build using mingw
|
||||
#CONFIG_NATIVE_WINDOWS=y
|
||||
# Additional directories for cross-compilation on Linux host for mingw target
|
||||
#CFLAGS += -I/opt/mingw/mingw32/include/ddk
|
||||
#LIBS += -L/opt/mingw/mingw32/lib
|
||||
#CC=mingw32-gcc
|
||||
# By default, driver_ndis uses WinPcap for low-level operations. This can be
|
||||
# replaced with the following option which replaces WinPcap calls with NDISUIO.
|
||||
# However, this requires that WZC is disabled (net stop wzcsvc) before starting
|
||||
# wpa_supplicant.
|
||||
# CONFIG_USE_NDISUIO=y
|
||||
|
||||
# Driver interface for wired Ethernet drivers
|
||||
CONFIG_DRIVER_WIRED=y
|
||||
|
||||
# Driver interface for MACsec capable Qualcomm Atheros drivers
|
||||
#CONFIG_DRIVER_MACSEC_QCA=y
|
||||
|
||||
# Driver interface for Linux MACsec drivers
|
||||
#CONFIG_DRIVER_MACSEC_LINUX=y
|
||||
|
||||
# Driver interface for the Broadcom RoboSwitch family
|
||||
#CONFIG_DRIVER_ROBOSWITCH=y
|
||||
|
||||
# Driver interface for no driver (e.g., WPS ER only)
|
||||
#CONFIG_DRIVER_NONE=y
|
||||
|
||||
# Solaris libraries
|
||||
#LIBS += -lsocket -ldlpi -lnsl
|
||||
#LIBS_c += -lsocket
|
||||
|
||||
# Enable IEEE 802.1X Supplicant (automatically included if any EAP method or
|
||||
# MACsec is included)
|
||||
#CONFIG_IEEE8021X_EAPOL=y
|
||||
|
||||
# EAP-MD5
|
||||
#CONFIG_EAP_MD5=y
|
||||
|
||||
# EAP-MSCHAPv2
|
||||
#CONFIG_EAP_MSCHAPV2=y
|
||||
|
||||
# EAP-TLS
|
||||
#CONFIG_EAP_TLS=y
|
||||
|
||||
# EAL-PEAP
|
||||
#CONFIG_EAP_PEAP=y
|
||||
|
||||
# EAP-TTLS
|
||||
#CONFIG_EAP_TTLS=y
|
||||
|
||||
# EAP-FAST
|
||||
#CONFIG_EAP_FAST=y
|
||||
|
||||
# EAP-TEAP
|
||||
# Note: The current EAP-TEAP implementation is experimental and should not be
|
||||
# enabled for production use. The IETF RFC 7170 that defines EAP-TEAP has number
|
||||
# of conflicting statements and missing details and the implementation has
|
||||
# vendor specific workarounds for those and as such, may not interoperate with
|
||||
# any other implementation. This should not be used for anything else than
|
||||
# experimentation and interoperability testing until those issues has been
|
||||
# resolved.
|
||||
#CONFIG_EAP_TEAP=y
|
||||
|
||||
# EAP-GTC
|
||||
#CONFIG_EAP_GTC=y
|
||||
|
||||
# EAP-OTP
|
||||
#CONFIG_EAP_OTP=y
|
||||
|
||||
# EAP-SIM (enable CONFIG_PCSC, if EAP-SIM is used)
|
||||
#CONFIG_EAP_SIM=y
|
||||
|
||||
# Enable SIM simulator (Milenage) for EAP-SIM
|
||||
#CONFIG_SIM_SIMULATOR=y
|
||||
|
||||
# EAP-PSK (experimental; this is _not_ needed for WPA-PSK)
|
||||
#CONFIG_EAP_PSK=y
|
||||
|
||||
# EAP-pwd (secure authentication using only a password)
|
||||
#CONFIG_EAP_PWD=y
|
||||
|
||||
# EAP-PAX
|
||||
#CONFIG_EAP_PAX=y
|
||||
|
||||
# LEAP
|
||||
#CONFIG_EAP_LEAP=y
|
||||
|
||||
# EAP-AKA (enable CONFIG_PCSC, if EAP-AKA is used)
|
||||
#CONFIG_EAP_AKA=y
|
||||
|
||||
# EAP-AKA' (enable CONFIG_PCSC, if EAP-AKA' is used).
|
||||
# This requires CONFIG_EAP_AKA to be enabled, too.
|
||||
#CONFIG_EAP_AKA_PRIME=y
|
||||
|
||||
# Enable USIM simulator (Milenage) for EAP-AKA
|
||||
#CONFIG_USIM_SIMULATOR=y
|
||||
|
||||
# EAP-SAKE
|
||||
#CONFIG_EAP_SAKE=y
|
||||
|
||||
# EAP-GPSK
|
||||
#CONFIG_EAP_GPSK=y
|
||||
# Include support for optional SHA256 cipher suite in EAP-GPSK
|
||||
#CONFIG_EAP_GPSK_SHA256=y
|
||||
|
||||
# EAP-TNC and related Trusted Network Connect support (experimental)
|
||||
#CONFIG_EAP_TNC=y
|
||||
|
||||
# Wi-Fi Protected Setup (WPS)
|
||||
#CONFIG_WPS=y
|
||||
# Enable WPS external registrar functionality
|
||||
#CONFIG_WPS_ER=y
|
||||
# Disable credentials for an open network by default when acting as a WPS
|
||||
# registrar.
|
||||
#CONFIG_WPS_REG_DISABLE_OPEN=y
|
||||
# Enable WPS support with NFC config method
|
||||
#CONFIG_WPS_NFC=y
|
||||
|
||||
# EAP-IKEv2
|
||||
#CONFIG_EAP_IKEV2=y
|
||||
|
||||
# EAP-EKE
|
||||
#CONFIG_EAP_EKE=y
|
||||
|
||||
# MACsec
|
||||
#CONFIG_MACSEC=y
|
||||
|
||||
# PKCS#12 (PFX) support (used to read private key and certificate file from
|
||||
# a file that usually has extension .p12 or .pfx)
|
||||
#CONFIG_PKCS12=y
|
||||
|
||||
# Smartcard support (i.e., private key on a smartcard), e.g., with openssl
|
||||
# engine.
|
||||
#CONFIG_SMARTCARD=y
|
||||
|
||||
# PC/SC interface for smartcards (USIM, GSM SIM)
|
||||
# Enable this if EAP-SIM or EAP-AKA is included
|
||||
#CONFIG_PCSC=y
|
||||
|
||||
# Support HT overrides (disable HT/HT40, mask MCS rates, etc.)
|
||||
CONFIG_HT_OVERRIDES=y
|
||||
|
||||
# Support VHT overrides (disable VHT, mask MCS rates, etc.)
|
||||
CONFIG_VHT_OVERRIDES=y
|
||||
|
||||
# Development testing
|
||||
#CONFIG_EAPOL_TEST=y
|
||||
|
||||
# Select control interface backend for external programs, e.g, wpa_cli:
|
||||
# unix = UNIX domain sockets (default for Linux/*BSD)
|
||||
# udp = UDP sockets using localhost (127.0.0.1)
|
||||
# udp6 = UDP IPv6 sockets using localhost (::1)
|
||||
# named_pipe = Windows Named Pipe (default for Windows)
|
||||
# udp-remote = UDP sockets with remote access (only for tests systems/purpose)
|
||||
# udp6-remote = UDP IPv6 sockets with remote access (only for tests purpose)
|
||||
# y = use default (backwards compatibility)
|
||||
# If this option is commented out, control interface is not included in the
|
||||
# build.
|
||||
CONFIG_CTRL_IFACE=y
|
||||
|
||||
# Include support for GNU Readline and History Libraries in wpa_cli.
|
||||
# When building a wpa_cli binary for distribution, please note that these
|
||||
# libraries are licensed under GPL and as such, BSD license may not apply for
|
||||
# the resulting binary.
|
||||
#CONFIG_READLINE=y
|
||||
|
||||
# Include internal line edit mode in wpa_cli. This can be used as a replacement
|
||||
# for GNU Readline to provide limited command line editing and history support.
|
||||
#CONFIG_WPA_CLI_EDIT=y
|
||||
|
||||
# Remove debugging code that is printing out debug message to stdout.
|
||||
# This can be used to reduce the size of the wpa_supplicant considerably
|
||||
# if debugging code is not needed. The size reduction can be around 35%
|
||||
# (e.g., 90 kB).
|
||||
#CONFIG_NO_STDOUT_DEBUG=y
|
||||
|
||||
# Remove WPA support, e.g., for wired-only IEEE 802.1X supplicant, to save
|
||||
# 35-50 kB in code size.
|
||||
#CONFIG_NO_WPA=y
|
||||
|
||||
# Remove IEEE 802.11i/WPA-Personal ASCII passphrase support
|
||||
# This option can be used to reduce code size by removing support for
|
||||
# converting ASCII passphrases into PSK. If this functionality is removed, the
|
||||
# PSK can only be configured as the 64-octet hexstring (e.g., from
|
||||
# wpa_passphrase). This saves about 0.5 kB in code size.
|
||||
#CONFIG_NO_WPA_PASSPHRASE=y
|
||||
|
||||
# Simultaneous Authentication of Equals (SAE), WPA3-Personal
|
||||
#CONFIG_SAE=y
|
||||
|
||||
# Disable scan result processing (ap_mode=1) to save code size by about 1 kB.
|
||||
# This can be used if ap_scan=1 mode is never enabled.
|
||||
#CONFIG_NO_SCAN_PROCESSING=y
|
||||
|
||||
# Select configuration backend:
|
||||
# file = text file (e.g., wpa_supplicant.conf; note: the configuration file
|
||||
# path is given on command line, not here; this option is just used to
|
||||
# select the backend that allows configuration files to be used)
|
||||
# winreg = Windows registry (see win_example.reg for an example)
|
||||
CONFIG_BACKEND=file
|
||||
|
||||
# Remove configuration write functionality (i.e., to allow the configuration
|
||||
# file to be updated based on runtime configuration changes). The runtime
|
||||
# configuration can still be changed, the changes are just not going to be
|
||||
# persistent over restarts. This option can be used to reduce code size by
|
||||
# about 3.5 kB.
|
||||
CONFIG_NO_CONFIG_WRITE=y
|
||||
|
||||
# Remove support for configuration blobs to reduce code size by about 1.5 kB.
|
||||
#CONFIG_NO_CONFIG_BLOBS=y
|
||||
|
||||
# Select program entry point implementation:
|
||||
# main = UNIX/POSIX like main() function (default)
|
||||
# main_winsvc = Windows service (read parameters from registry)
|
||||
# main_none = Very basic example (development use only)
|
||||
#CONFIG_MAIN=main
|
||||
|
||||
# Select wrapper for operating system and C library specific functions
|
||||
# unix = UNIX/POSIX like systems (default)
|
||||
# win32 = Windows systems
|
||||
# none = Empty template
|
||||
#CONFIG_OS=unix
|
||||
|
||||
# Select event loop implementation
|
||||
# eloop = select() loop (default)
|
||||
# eloop_win = Windows events and WaitForMultipleObject() loop
|
||||
#CONFIG_ELOOP=eloop
|
||||
|
||||
# Should we use poll instead of select? Select is used by default.
|
||||
#CONFIG_ELOOP_POLL=y
|
||||
|
||||
# Should we use epoll instead of select? Select is used by default.
|
||||
CONFIG_ELOOP_EPOLL=y
|
||||
|
||||
# Should we use kqueue instead of select? Select is used by default.
|
||||
#CONFIG_ELOOP_KQUEUE=y
|
||||
|
||||
# Select layer 2 packet implementation
|
||||
# linux = Linux packet socket (default)
|
||||
# pcap = libpcap/libdnet/WinPcap
|
||||
# freebsd = FreeBSD libpcap
|
||||
# winpcap = WinPcap with receive thread
|
||||
# ndis = Windows NDISUIO (note: requires CONFIG_USE_NDISUIO=y)
|
||||
# none = Empty template
|
||||
#CONFIG_L2_PACKET=linux
|
||||
|
||||
# Disable Linux packet socket workaround applicable for station interface
|
||||
# in a bridge for EAPOL frames. This should be uncommented only if the kernel
|
||||
# is known to not have the regression issue in packet socket behavior with
|
||||
# bridge interfaces (commit 'bridge: respect RFC2863 operational state')').
|
||||
CONFIG_NO_LINUX_PACKET_SOCKET_WAR=y
|
||||
|
||||
# IEEE 802.11w (management frame protection), also known as PMF
|
||||
# Driver support is also needed for IEEE 802.11w.
|
||||
#CONFIG_IEEE80211W=y
|
||||
|
||||
# Support Operating Channel Validation
|
||||
CONFIG_OCV=y
|
||||
|
||||
# Select TLS implementation
|
||||
# openssl = OpenSSL (default)
|
||||
# gnutls = GnuTLS
|
||||
# internal = Internal TLSv1 implementation (experimental)
|
||||
# linux = Linux kernel AF_ALG and internal TLSv1 implementation (experimental)
|
||||
# none = Empty template
|
||||
CONFIG_TLS=internal
|
||||
|
||||
# TLS-based EAP methods require at least TLS v1.0. Newer version of TLS (v1.1)
|
||||
# can be enabled to get a stronger construction of messages when block ciphers
|
||||
# are used. It should be noted that some existing TLS v1.0 -based
|
||||
# implementation may not be compatible with TLS v1.1 message (ClientHello is
|
||||
# sent prior to negotiating which version will be used)
|
||||
#CONFIG_TLSV11=y
|
||||
|
||||
# TLS-based EAP methods require at least TLS v1.0. Newer version of TLS (v1.2)
|
||||
# can be enabled to enable use of stronger crypto algorithms. It should be
|
||||
# noted that some existing TLS v1.0 -based implementation may not be compatible
|
||||
# with TLS v1.2 message (ClientHello is sent prior to negotiating which version
|
||||
# will be used)
|
||||
#CONFIG_TLSV12=y
|
||||
|
||||
# Select which ciphers to use by default with OpenSSL if the user does not
|
||||
# specify them.
|
||||
#CONFIG_TLS_DEFAULT_CIPHERS="DEFAULT:!EXP:!LOW"
|
||||
|
||||
# If CONFIG_TLS=internal is used, additional library and include paths are
|
||||
# needed for LibTomMath. Alternatively, an integrated, minimal version of
|
||||
# LibTomMath can be used. See beginning of libtommath.c for details on benefits
|
||||
# and drawbacks of this option.
|
||||
#CONFIG_INTERNAL_LIBTOMMATH=y
|
||||
#ifndef CONFIG_INTERNAL_LIBTOMMATH
|
||||
#LTM_PATH=/usr/src/libtommath-0.39
|
||||
#CFLAGS += -I$(LTM_PATH)
|
||||
#LIBS += -L$(LTM_PATH)
|
||||
#LIBS_p += -L$(LTM_PATH)
|
||||
#endif
|
||||
# At the cost of about 4 kB of additional binary size, the internal LibTomMath
|
||||
# can be configured to include faster routines for exptmod, sqr, and div to
|
||||
# speed up DH and RSA calculation considerably
|
||||
#CONFIG_INTERNAL_LIBTOMMATH_FAST=y
|
||||
|
||||
# Include NDIS event processing through WMI into wpa_supplicant/wpasvc.
|
||||
# This is only for Windows builds and requires WMI-related header files and
|
||||
# WbemUuid.Lib from Platform SDK even when building with MinGW.
|
||||
#CONFIG_NDIS_EVENTS_INTEGRATED=y
|
||||
#PLATFORMSDKLIB="/opt/Program Files/Microsoft Platform SDK/Lib"
|
||||
|
||||
# Add support for new DBus control interface
|
||||
# (fi.w1.hostap.wpa_supplicant1)
|
||||
#CONFIG_CTRL_IFACE_DBUS_NEW=y
|
||||
|
||||
# Add introspection support for new DBus control interface
|
||||
#CONFIG_CTRL_IFACE_DBUS_INTRO=y
|
||||
|
||||
# Add support for loading EAP methods dynamically as shared libraries.
|
||||
# When this option is enabled, each EAP method can be either included
|
||||
# statically (CONFIG_EAP_<method>=y) or dynamically (CONFIG_EAP_<method>=dyn).
|
||||
# Dynamic EAP methods are build as shared objects (eap_*.so) and they need to
|
||||
# be loaded in the beginning of the wpa_supplicant configuration file
|
||||
# (see load_dynamic_eap parameter in the example file) before being used in
|
||||
# the network blocks.
|
||||
#
|
||||
# Note that some shared parts of EAP methods are included in the main program
|
||||
# and in order to be able to use dynamic EAP methods using these parts, the
|
||||
# main program must have been build with the EAP method enabled (=y or =dyn).
|
||||
# This means that EAP-TLS/PEAP/TTLS/FAST cannot be added as dynamic libraries
|
||||
# unless at least one of them was included in the main build to force inclusion
|
||||
# of the shared code. Similarly, at least one of EAP-SIM/AKA must be included
|
||||
# in the main build to be able to load these methods dynamically.
|
||||
#
|
||||
# Please also note that using dynamic libraries will increase the total binary
|
||||
# size. Thus, it may not be the best option for targets that have limited
|
||||
# amount of memory/flash.
|
||||
#CONFIG_DYNAMIC_EAP_METHODS=y
|
||||
|
||||
# IEEE Std 802.11r-2008 (Fast BSS Transition) for station mode
|
||||
CONFIG_IEEE80211R=y
|
||||
|
||||
# Add support for writing debug log to a file (/tmp/wpa_supplicant-log-#.txt)
|
||||
#CONFIG_DEBUG_FILE=y
|
||||
|
||||
# Send debug messages to syslog instead of stdout
|
||||
CONFIG_DEBUG_SYSLOG=y
|
||||
# Set syslog facility for debug messages
|
||||
CONFIG_DEBUG_SYSLOG_FACILITY=LOG_DAEMON
|
||||
|
||||
# Add support for sending all debug messages (regardless of debug verbosity)
|
||||
# to the Linux kernel tracing facility. This helps debug the entire stack by
|
||||
# making it easy to record everything happening from the driver up into the
|
||||
# same file, e.g., using trace-cmd.
|
||||
#CONFIG_DEBUG_LINUX_TRACING=y
|
||||
|
||||
# Add support for writing debug log to Android logcat instead of standard
|
||||
# output
|
||||
#CONFIG_ANDROID_LOG=y
|
||||
|
||||
# Enable privilege separation (see README 'Privilege separation' for details)
|
||||
#CONFIG_PRIVSEP=y
|
||||
|
||||
# Enable mitigation against certain attacks against TKIP by delaying Michael
|
||||
# MIC error reports by a random amount of time between 0 and 60 seconds
|
||||
#CONFIG_DELAYED_MIC_ERROR_REPORT=y
|
||||
|
||||
# Enable tracing code for developer debugging
|
||||
# This tracks use of memory allocations and other registrations and reports
|
||||
# incorrect use with a backtrace of call (or allocation) location.
|
||||
#CONFIG_WPA_TRACE=y
|
||||
# For BSD, uncomment these.
|
||||
#LIBS += -lexecinfo
|
||||
#LIBS_p += -lexecinfo
|
||||
#LIBS_c += -lexecinfo
|
||||
|
||||
# Use libbfd to get more details for developer debugging
|
||||
# This enables use of libbfd to get more detailed symbols for the backtraces
|
||||
# generated by CONFIG_WPA_TRACE=y.
|
||||
#CONFIG_WPA_TRACE_BFD=y
|
||||
# For BSD, uncomment these.
|
||||
#LIBS += -lbfd -liberty -lz
|
||||
#LIBS_p += -lbfd -liberty -lz
|
||||
#LIBS_c += -lbfd -liberty -lz
|
||||
|
||||
# wpa_supplicant depends on strong random number generation being available
|
||||
# from the operating system. os_get_random() function is used to fetch random
|
||||
# data when needed, e.g., for key generation. On Linux and BSD systems, this
|
||||
# works by reading /dev/urandom. It should be noted that the OS entropy pool
|
||||
# needs to be properly initialized before wpa_supplicant is started. This is
|
||||
# important especially on embedded devices that do not have a hardware random
|
||||
# number generator and may by default start up with minimal entropy available
|
||||
# for random number generation.
|
||||
#
|
||||
# As a safety net, wpa_supplicant is by default trying to internally collect
|
||||
# additional entropy for generating random data to mix in with the data fetched
|
||||
# from the OS. This by itself is not considered to be very strong, but it may
|
||||
# help in cases where the system pool is not initialized properly. However, it
|
||||
# is very strongly recommended that the system pool is initialized with enough
|
||||
# entropy either by using hardware assisted random number generator or by
|
||||
# storing state over device reboots.
|
||||
#
|
||||
# wpa_supplicant can be configured to maintain its own entropy store over
|
||||
# restarts to enhance random number generation. This is not perfect, but it is
|
||||
# much more secure than using the same sequence of random numbers after every
|
||||
# reboot. This can be enabled with -e<entropy file> command line option. The
|
||||
# specified file needs to be readable and writable by wpa_supplicant.
|
||||
#
|
||||
# If the os_get_random() is known to provide strong random data (e.g., on
|
||||
# Linux/BSD, the board in question is known to have reliable source of random
|
||||
# data from /dev/urandom), the internal wpa_supplicant random pool can be
|
||||
# disabled. This will save some in binary size and CPU use. However, this
|
||||
# should only be considered for builds that are known to be used on devices
|
||||
# that meet the requirements described above.
|
||||
CONFIG_NO_RANDOM_POOL=y
|
||||
|
||||
# Should we attempt to use the getrandom(2) call that provides more reliable
|
||||
# yet secure randomness source than /dev/random on Linux 3.17 and newer.
|
||||
# Requires glibc 2.25 to build, falls back to /dev/random if unavailable.
|
||||
CONFIG_GETRANDOM=y
|
||||
|
||||
# IEEE 802.11n (High Throughput) support (mainly for AP mode)
|
||||
#CONFIG_IEEE80211N=y
|
||||
|
||||
# IEEE 802.11ac (Very High Throughput) support (mainly for AP mode)
|
||||
# (depends on CONFIG_IEEE80211N)
|
||||
#CONFIG_IEEE80211AC=y
|
||||
|
||||
# Wireless Network Management (IEEE Std 802.11v-2011)
|
||||
# Note: This is experimental and not complete implementation.
|
||||
#CONFIG_WNM=y
|
||||
|
||||
# Interworking (IEEE 802.11u)
|
||||
# This can be used to enable functionality to improve interworking with
|
||||
# external networks (GAS/ANQP to learn more about the networks and network
|
||||
# selection based on available credentials).
|
||||
#CONFIG_INTERWORKING=y
|
||||
|
||||
# Hotspot 2.0
|
||||
#CONFIG_HS20=y
|
||||
|
||||
# Enable interface matching in wpa_supplicant
|
||||
#CONFIG_MATCH_IFACE=y
|
||||
|
||||
# Disable roaming in wpa_supplicant
|
||||
#CONFIG_NO_ROAMING=y
|
||||
|
||||
# AP mode operations with wpa_supplicant
|
||||
# This can be used for controlling AP mode operations with wpa_supplicant. It
|
||||
# should be noted that this is mainly aimed at simple cases like
|
||||
# WPA2-Personal while more complex configurations like WPA2-Enterprise with an
|
||||
# external RADIUS server can be supported with hostapd.
|
||||
#CONFIG_AP=y
|
||||
|
||||
# P2P (Wi-Fi Direct)
|
||||
# This can be used to enable P2P support in wpa_supplicant. See README-P2P for
|
||||
# more information on P2P operations.
|
||||
#CONFIG_P2P=y
|
||||
|
||||
# Enable TDLS support
|
||||
#CONFIG_TDLS=y
|
||||
|
||||
# Wi-Fi Display
|
||||
# This can be used to enable Wi-Fi Display extensions for P2P using an external
|
||||
# program to control the additional information exchanges in the messages.
|
||||
#CONFIG_WIFI_DISPLAY=y
|
||||
|
||||
# Autoscan
|
||||
# This can be used to enable automatic scan support in wpa_supplicant.
|
||||
# See wpa_supplicant.conf for more information on autoscan usage.
|
||||
#
|
||||
# Enabling directly a module will enable autoscan support.
|
||||
# For exponential module:
|
||||
#CONFIG_AUTOSCAN_EXPONENTIAL=y
|
||||
# For periodic module:
|
||||
#CONFIG_AUTOSCAN_PERIODIC=y
|
||||
|
||||
# Password (and passphrase, etc.) backend for external storage
|
||||
# These optional mechanisms can be used to add support for storing passwords
|
||||
# and other secrets in external (to wpa_supplicant) location. This allows, for
|
||||
# example, operating system specific key storage to be used
|
||||
#
|
||||
# External password backend for testing purposes (developer use)
|
||||
#CONFIG_EXT_PASSWORD_TEST=y
|
||||
|
||||
# Enable Fast Session Transfer (FST)
|
||||
#CONFIG_FST=y
|
||||
|
||||
# Enable CLI commands for FST testing
|
||||
#CONFIG_FST_TEST=y
|
||||
|
||||
# OS X builds. This is only for building eapol_test.
|
||||
#CONFIG_OSX=y
|
||||
|
||||
# Automatic Channel Selection
|
||||
# This will allow wpa_supplicant to pick the channel automatically when channel
|
||||
# is set to "0".
|
||||
#
|
||||
# TODO: Extend parser to be able to parse "channel=acs_survey" as an alternative
|
||||
# to "channel=0". This would enable us to eventually add other ACS algorithms in
|
||||
# similar way.
|
||||
#
|
||||
# Automatic selection is currently only done through initialization, later on
|
||||
# we hope to do background checks to keep us moving to more ideal channels as
|
||||
# time goes by. ACS is currently only supported through the nl80211 driver and
|
||||
# your driver must have survey dump capability that is filled by the driver
|
||||
# during scanning.
|
||||
#
|
||||
# TODO: In analogy to hostapd be able to customize the ACS survey algorithm with
|
||||
# a newly to create wpa_supplicant.conf variable acs_num_scans.
|
||||
#
|
||||
# Supported ACS drivers:
|
||||
# * ath9k
|
||||
# * ath5k
|
||||
# * ath10k
|
||||
#
|
||||
# For more details refer to:
|
||||
# http://wireless.kernel.org/en/users/Documentation/acs
|
||||
#CONFIG_ACS=y
|
||||
|
||||
# Support Multi Band Operation
|
||||
#CONFIG_MBO=y
|
||||
|
||||
# Fast Initial Link Setup (FILS) (IEEE 802.11ai)
|
||||
#CONFIG_FILS=y
|
||||
# FILS shared key authentication with PFS
|
||||
#CONFIG_FILS_SK_PFS=y
|
||||
|
||||
# Support RSN on IBSS networks
|
||||
# This is needed to be able to use mode=1 network profile with proto=RSN and
|
||||
# key_mgmt=WPA-PSK (i.e., full key management instead of WPA-None).
|
||||
#CONFIG_IBSS_RSN=y
|
||||
|
||||
# External PMKSA cache control
|
||||
# This can be used to enable control interface commands that allow the current
|
||||
# PMKSA cache entries to be fetched and new entries to be added.
|
||||
#CONFIG_PMKSA_CACHE_EXTERNAL=y
|
||||
|
||||
# Mesh Networking (IEEE 802.11s)
|
||||
#CONFIG_MESH=y
|
||||
|
||||
# Background scanning modules
|
||||
# These can be used to request wpa_supplicant to perform background scanning
|
||||
# operations for roaming within an ESS (same SSID). See the bgscan parameter in
|
||||
# the wpa_supplicant.conf file for more details.
|
||||
# Periodic background scans based on signal strength
|
||||
#CONFIG_BGSCAN_SIMPLE=y
|
||||
# Learn channels used by the network and try to avoid bgscans on other
|
||||
# channels (experimental)
|
||||
#CONFIG_BGSCAN_LEARN=y
|
||||
|
||||
# Opportunistic Wireless Encryption (OWE)
|
||||
# Experimental implementation of draft-harkins-owe-07.txt
|
||||
#CONFIG_OWE=y
|
||||
|
||||
# Device Provisioning Protocol (DPP)
|
||||
# This requires CONFIG_IEEE80211W=y to be enabled, too. (see
|
||||
# wpa_supplicant/README-DPP for details)
|
||||
#CONFIG_DPP=y
|
||||
|
||||
# uBus IPC/RPC System
|
||||
# Services can connect to the bus and provide methods
|
||||
# that can be called by other services or clients.
|
||||
CONFIG_UBUS=y
|
||||
|
||||
# OpenWrt patch 380-disable-ctrl-iface-mib.patch
|
||||
# leads to the MIB only being compiled in if
|
||||
# CONFIG_CTRL_IFACE_MIB is enabled.
|
||||
#CONFIG_CTRL_IFACE_MIB=y
|
||||
@@ -1,625 +0,0 @@
|
||||
# Example wpa_supplicant build time configuration
|
||||
#
|
||||
# This file lists the configuration options that are used when building the
|
||||
# wpa_supplicant binary. All lines starting with # are ignored. Configuration
|
||||
# option lines must be commented out complete, if they are not to be included,
|
||||
# i.e., just setting VARIABLE=n is not disabling that variable.
|
||||
#
|
||||
# This file is included in Makefile, so variables like CFLAGS and LIBS can also
|
||||
# be modified from here. In most cases, these lines should use += in order not
|
||||
# to override previous values of the variables.
|
||||
|
||||
|
||||
# Uncomment following two lines and fix the paths if you have installed OpenSSL
|
||||
# or GnuTLS in non-default location
|
||||
#CFLAGS += -I/usr/local/openssl/include
|
||||
#LIBS += -L/usr/local/openssl/lib
|
||||
|
||||
# Some Red Hat versions seem to include kerberos header files from OpenSSL, but
|
||||
# the kerberos files are not in the default include path. Following line can be
|
||||
# used to fix build issues on such systems (krb5.h not found).
|
||||
#CFLAGS += -I/usr/include/kerberos
|
||||
|
||||
# Driver interface for generic Linux wireless extensions
|
||||
# Note: WEXT is deprecated in the current Linux kernel version and no new
|
||||
# functionality is added to it. nl80211-based interface is the new
|
||||
# replacement for WEXT and its use allows wpa_supplicant to properly control
|
||||
# the driver to improve existing functionality like roaming and to support new
|
||||
# functionality.
|
||||
#CONFIG_DRIVER_WEXT=y
|
||||
|
||||
# Driver interface for Linux drivers using the nl80211 kernel interface
|
||||
CONFIG_DRIVER_NL80211=y
|
||||
|
||||
# QCA vendor extensions to nl80211
|
||||
#CONFIG_DRIVER_NL80211_QCA=y
|
||||
|
||||
# driver_nl80211.c requires libnl. If you are compiling it yourself
|
||||
# you may need to point hostapd to your version of libnl.
|
||||
#
|
||||
#CFLAGS += -I$<path to libnl include files>
|
||||
#LIBS += -L$<path to libnl library files>
|
||||
|
||||
# Use libnl v2.0 (or 3.0) libraries.
|
||||
#CONFIG_LIBNL20=y
|
||||
|
||||
# Use libnl 3.2 libraries (if this is selected, CONFIG_LIBNL20 is ignored)
|
||||
#CONFIG_LIBNL32=y
|
||||
|
||||
|
||||
# Driver interface for FreeBSD net80211 layer (e.g., Atheros driver)
|
||||
#CONFIG_DRIVER_BSD=y
|
||||
#CFLAGS += -I/usr/local/include
|
||||
#LIBS += -L/usr/local/lib
|
||||
#LIBS_p += -L/usr/local/lib
|
||||
#LIBS_c += -L/usr/local/lib
|
||||
|
||||
# Driver interface for Windows NDIS
|
||||
#CONFIG_DRIVER_NDIS=y
|
||||
#CFLAGS += -I/usr/include/w32api/ddk
|
||||
#LIBS += -L/usr/local/lib
|
||||
# For native build using mingw
|
||||
#CONFIG_NATIVE_WINDOWS=y
|
||||
# Additional directories for cross-compilation on Linux host for mingw target
|
||||
#CFLAGS += -I/opt/mingw/mingw32/include/ddk
|
||||
#LIBS += -L/opt/mingw/mingw32/lib
|
||||
#CC=mingw32-gcc
|
||||
# By default, driver_ndis uses WinPcap for low-level operations. This can be
|
||||
# replaced with the following option which replaces WinPcap calls with NDISUIO.
|
||||
# However, this requires that WZC is disabled (net stop wzcsvc) before starting
|
||||
# wpa_supplicant.
|
||||
# CONFIG_USE_NDISUIO=y
|
||||
|
||||
# Driver interface for wired Ethernet drivers
|
||||
CONFIG_DRIVER_WIRED=y
|
||||
|
||||
# Driver interface for MACsec capable Qualcomm Atheros drivers
|
||||
#CONFIG_DRIVER_MACSEC_QCA=y
|
||||
|
||||
# Driver interface for Linux MACsec drivers
|
||||
#CONFIG_DRIVER_MACSEC_LINUX=y
|
||||
|
||||
# Driver interface for the Broadcom RoboSwitch family
|
||||
#CONFIG_DRIVER_ROBOSWITCH=y
|
||||
|
||||
# Driver interface for no driver (e.g., WPS ER only)
|
||||
#CONFIG_DRIVER_NONE=y
|
||||
|
||||
# Solaris libraries
|
||||
#LIBS += -lsocket -ldlpi -lnsl
|
||||
#LIBS_c += -lsocket
|
||||
|
||||
# Enable IEEE 802.1X Supplicant (automatically included if any EAP method or
|
||||
# MACsec is included)
|
||||
CONFIG_IEEE8021X_EAPOL=y
|
||||
|
||||
# EAP-MD5
|
||||
CONFIG_EAP_MD5=y
|
||||
|
||||
# EAP-MSCHAPv2
|
||||
CONFIG_EAP_MSCHAPV2=y
|
||||
|
||||
# EAP-TLS
|
||||
CONFIG_EAP_TLS=y
|
||||
|
||||
# EAL-PEAP
|
||||
CONFIG_EAP_PEAP=y
|
||||
|
||||
# EAP-TTLS
|
||||
CONFIG_EAP_TTLS=y
|
||||
|
||||
# EAP-FAST
|
||||
CONFIG_EAP_FAST=y
|
||||
|
||||
# EAP-TEAP
|
||||
# Note: The current EAP-TEAP implementation is experimental and should not be
|
||||
# enabled for production use. The IETF RFC 7170 that defines EAP-TEAP has number
|
||||
# of conflicting statements and missing details and the implementation has
|
||||
# vendor specific workarounds for those and as such, may not interoperate with
|
||||
# any other implementation. This should not be used for anything else than
|
||||
# experimentation and interoperability testing until those issues has been
|
||||
# resolved.
|
||||
#CONFIG_EAP_TEAP=y
|
||||
|
||||
# EAP-GTC
|
||||
CONFIG_EAP_GTC=y
|
||||
|
||||
# EAP-OTP
|
||||
CONFIG_EAP_OTP=y
|
||||
|
||||
# EAP-SIM (enable CONFIG_PCSC, if EAP-SIM is used)
|
||||
#CONFIG_EAP_SIM=y
|
||||
|
||||
# Enable SIM simulator (Milenage) for EAP-SIM
|
||||
#CONFIG_SIM_SIMULATOR=y
|
||||
|
||||
# EAP-PSK (experimental; this is _not_ needed for WPA-PSK)
|
||||
#CONFIG_EAP_PSK=y
|
||||
|
||||
# EAP-pwd (secure authentication using only a password)
|
||||
#CONFIG_EAP_PWD=y
|
||||
|
||||
# EAP-PAX
|
||||
#CONFIG_EAP_PAX=y
|
||||
|
||||
# LEAP
|
||||
CONFIG_EAP_LEAP=y
|
||||
|
||||
# EAP-AKA (enable CONFIG_PCSC, if EAP-AKA is used)
|
||||
#CONFIG_EAP_AKA=y
|
||||
|
||||
# EAP-AKA' (enable CONFIG_PCSC, if EAP-AKA' is used).
|
||||
# This requires CONFIG_EAP_AKA to be enabled, too.
|
||||
#CONFIG_EAP_AKA_PRIME=y
|
||||
|
||||
# Enable USIM simulator (Milenage) for EAP-AKA
|
||||
#CONFIG_USIM_SIMULATOR=y
|
||||
|
||||
# EAP-SAKE
|
||||
#CONFIG_EAP_SAKE=y
|
||||
|
||||
# EAP-GPSK
|
||||
#CONFIG_EAP_GPSK=y
|
||||
# Include support for optional SHA256 cipher suite in EAP-GPSK
|
||||
#CONFIG_EAP_GPSK_SHA256=y
|
||||
|
||||
# EAP-TNC and related Trusted Network Connect support (experimental)
|
||||
#CONFIG_EAP_TNC=y
|
||||
|
||||
# Wi-Fi Protected Setup (WPS)
|
||||
CONFIG_WPS=y
|
||||
# Enable WPS external registrar functionality
|
||||
#CONFIG_WPS_ER=y
|
||||
# Disable credentials for an open network by default when acting as a WPS
|
||||
# registrar.
|
||||
#CONFIG_WPS_REG_DISABLE_OPEN=y
|
||||
# Enable WPS support with NFC config method
|
||||
#CONFIG_WPS_NFC=y
|
||||
|
||||
# EAP-IKEv2
|
||||
#CONFIG_EAP_IKEV2=y
|
||||
|
||||
# EAP-EKE
|
||||
#CONFIG_EAP_EKE=y
|
||||
|
||||
# MACsec
|
||||
#CONFIG_MACSEC=y
|
||||
|
||||
# PKCS#12 (PFX) support (used to read private key and certificate file from
|
||||
# a file that usually has extension .p12 or .pfx)
|
||||
CONFIG_PKCS12=y
|
||||
|
||||
# Smartcard support (i.e., private key on a smartcard), e.g., with openssl
|
||||
# engine.
|
||||
CONFIG_SMARTCARD=y
|
||||
|
||||
# PC/SC interface for smartcards (USIM, GSM SIM)
|
||||
# Enable this if EAP-SIM or EAP-AKA is included
|
||||
#CONFIG_PCSC=y
|
||||
|
||||
# Support HT overrides (disable HT/HT40, mask MCS rates, etc.)
|
||||
CONFIG_HT_OVERRIDES=y
|
||||
|
||||
# Support VHT overrides (disable VHT, mask MCS rates, etc.)
|
||||
CONFIG_VHT_OVERRIDES=y
|
||||
|
||||
# Development testing
|
||||
#CONFIG_EAPOL_TEST=y
|
||||
|
||||
# Select control interface backend for external programs, e.g, wpa_cli:
|
||||
# unix = UNIX domain sockets (default for Linux/*BSD)
|
||||
# udp = UDP sockets using localhost (127.0.0.1)
|
||||
# udp6 = UDP IPv6 sockets using localhost (::1)
|
||||
# named_pipe = Windows Named Pipe (default for Windows)
|
||||
# udp-remote = UDP sockets with remote access (only for tests systems/purpose)
|
||||
# udp6-remote = UDP IPv6 sockets with remote access (only for tests purpose)
|
||||
# y = use default (backwards compatibility)
|
||||
# If this option is commented out, control interface is not included in the
|
||||
# build.
|
||||
CONFIG_CTRL_IFACE=y
|
||||
|
||||
# Include support for GNU Readline and History Libraries in wpa_cli.
|
||||
# When building a wpa_cli binary for distribution, please note that these
|
||||
# libraries are licensed under GPL and as such, BSD license may not apply for
|
||||
# the resulting binary.
|
||||
#CONFIG_READLINE=y
|
||||
|
||||
# Include internal line edit mode in wpa_cli. This can be used as a replacement
|
||||
# for GNU Readline to provide limited command line editing and history support.
|
||||
#CONFIG_WPA_CLI_EDIT=y
|
||||
|
||||
# Remove debugging code that is printing out debug message to stdout.
|
||||
# This can be used to reduce the size of the wpa_supplicant considerably
|
||||
# if debugging code is not needed. The size reduction can be around 35%
|
||||
# (e.g., 90 kB).
|
||||
#CONFIG_NO_STDOUT_DEBUG=y
|
||||
|
||||
# Remove WPA support, e.g., for wired-only IEEE 802.1X supplicant, to save
|
||||
# 35-50 kB in code size.
|
||||
#CONFIG_NO_WPA=y
|
||||
|
||||
# Remove IEEE 802.11i/WPA-Personal ASCII passphrase support
|
||||
# This option can be used to reduce code size by removing support for
|
||||
# converting ASCII passphrases into PSK. If this functionality is removed, the
|
||||
# PSK can only be configured as the 64-octet hexstring (e.g., from
|
||||
# wpa_passphrase). This saves about 0.5 kB in code size.
|
||||
#CONFIG_NO_WPA_PASSPHRASE=y
|
||||
|
||||
# Simultaneous Authentication of Equals (SAE), WPA3-Personal
|
||||
#CONFIG_SAE=y
|
||||
|
||||
# Disable scan result processing (ap_mode=1) to save code size by about 1 kB.
|
||||
# This can be used if ap_scan=1 mode is never enabled.
|
||||
#CONFIG_NO_SCAN_PROCESSING=y
|
||||
|
||||
# Select configuration backend:
|
||||
# file = text file (e.g., wpa_supplicant.conf; note: the configuration file
|
||||
# path is given on command line, not here; this option is just used to
|
||||
# select the backend that allows configuration files to be used)
|
||||
# winreg = Windows registry (see win_example.reg for an example)
|
||||
CONFIG_BACKEND=file
|
||||
|
||||
# Remove configuration write functionality (i.e., to allow the configuration
|
||||
# file to be updated based on runtime configuration changes). The runtime
|
||||
# configuration can still be changed, the changes are just not going to be
|
||||
# persistent over restarts. This option can be used to reduce code size by
|
||||
# about 3.5 kB.
|
||||
#CONFIG_NO_CONFIG_WRITE=y
|
||||
|
||||
# Remove support for configuration blobs to reduce code size by about 1.5 kB.
|
||||
#CONFIG_NO_CONFIG_BLOBS=y
|
||||
|
||||
# Select program entry point implementation:
|
||||
# main = UNIX/POSIX like main() function (default)
|
||||
# main_winsvc = Windows service (read parameters from registry)
|
||||
# main_none = Very basic example (development use only)
|
||||
#CONFIG_MAIN=main
|
||||
|
||||
# Select wrapper for operating system and C library specific functions
|
||||
# unix = UNIX/POSIX like systems (default)
|
||||
# win32 = Windows systems
|
||||
# none = Empty template
|
||||
#CONFIG_OS=unix
|
||||
|
||||
# Select event loop implementation
|
||||
# eloop = select() loop (default)
|
||||
# eloop_win = Windows events and WaitForMultipleObject() loop
|
||||
#CONFIG_ELOOP=eloop
|
||||
|
||||
# Should we use poll instead of select? Select is used by default.
|
||||
#CONFIG_ELOOP_POLL=y
|
||||
|
||||
# Should we use epoll instead of select? Select is used by default.
|
||||
CONFIG_ELOOP_EPOLL=y
|
||||
|
||||
# Should we use kqueue instead of select? Select is used by default.
|
||||
#CONFIG_ELOOP_KQUEUE=y
|
||||
|
||||
# Select layer 2 packet implementation
|
||||
# linux = Linux packet socket (default)
|
||||
# pcap = libpcap/libdnet/WinPcap
|
||||
# freebsd = FreeBSD libpcap
|
||||
# winpcap = WinPcap with receive thread
|
||||
# ndis = Windows NDISUIO (note: requires CONFIG_USE_NDISUIO=y)
|
||||
# none = Empty template
|
||||
#CONFIG_L2_PACKET=linux
|
||||
|
||||
# Disable Linux packet socket workaround applicable for station interface
|
||||
# in a bridge for EAPOL frames. This should be uncommented only if the kernel
|
||||
# is known to not have the regression issue in packet socket behavior with
|
||||
# bridge interfaces (commit 'bridge: respect RFC2863 operational state')').
|
||||
CONFIG_NO_LINUX_PACKET_SOCKET_WAR=y
|
||||
|
||||
# IEEE 802.11w (management frame protection), also known as PMF
|
||||
# Driver support is also needed for IEEE 802.11w.
|
||||
#CONFIG_IEEE80211W=y
|
||||
|
||||
# Support Operating Channel Validation
|
||||
CONFIG_OCV=y
|
||||
|
||||
# Select TLS implementation
|
||||
# openssl = OpenSSL (default)
|
||||
# gnutls = GnuTLS
|
||||
# internal = Internal TLSv1 implementation (experimental)
|
||||
# linux = Linux kernel AF_ALG and internal TLSv1 implementation (experimental)
|
||||
# none = Empty template
|
||||
CONFIG_TLS=internal
|
||||
|
||||
# TLS-based EAP methods require at least TLS v1.0. Newer version of TLS (v1.1)
|
||||
# can be enabled to get a stronger construction of messages when block ciphers
|
||||
# are used. It should be noted that some existing TLS v1.0 -based
|
||||
# implementation may not be compatible with TLS v1.1 message (ClientHello is
|
||||
# sent prior to negotiating which version will be used)
|
||||
#CONFIG_TLSV11=y
|
||||
|
||||
# TLS-based EAP methods require at least TLS v1.0. Newer version of TLS (v1.2)
|
||||
# can be enabled to enable use of stronger crypto algorithms. It should be
|
||||
# noted that some existing TLS v1.0 -based implementation may not be compatible
|
||||
# with TLS v1.2 message (ClientHello is sent prior to negotiating which version
|
||||
# will be used)
|
||||
#CONFIG_TLSV12=y
|
||||
|
||||
# Select which ciphers to use by default with OpenSSL if the user does not
|
||||
# specify them.
|
||||
#CONFIG_TLS_DEFAULT_CIPHERS="DEFAULT:!EXP:!LOW"
|
||||
|
||||
# If CONFIG_TLS=internal is used, additional library and include paths are
|
||||
# needed for LibTomMath. Alternatively, an integrated, minimal version of
|
||||
# LibTomMath can be used. See beginning of libtommath.c for details on benefits
|
||||
# and drawbacks of this option.
|
||||
CONFIG_INTERNAL_LIBTOMMATH=y
|
||||
#ifndef CONFIG_INTERNAL_LIBTOMMATH
|
||||
#LTM_PATH=/usr/src/libtommath-0.39
|
||||
#CFLAGS += -I$(LTM_PATH)
|
||||
#LIBS += -L$(LTM_PATH)
|
||||
#LIBS_p += -L$(LTM_PATH)
|
||||
#endif
|
||||
# At the cost of about 4 kB of additional binary size, the internal LibTomMath
|
||||
# can be configured to include faster routines for exptmod, sqr, and div to
|
||||
# speed up DH and RSA calculation considerably
|
||||
CONFIG_INTERNAL_LIBTOMMATH_FAST=y
|
||||
|
||||
# Include NDIS event processing through WMI into wpa_supplicant/wpasvc.
|
||||
# This is only for Windows builds and requires WMI-related header files and
|
||||
# WbemUuid.Lib from Platform SDK even when building with MinGW.
|
||||
#CONFIG_NDIS_EVENTS_INTEGRATED=y
|
||||
#PLATFORMSDKLIB="/opt/Program Files/Microsoft Platform SDK/Lib"
|
||||
|
||||
# Add support for new DBus control interface
|
||||
# (fi.w1.hostap.wpa_supplicant1)
|
||||
#CONFIG_CTRL_IFACE_DBUS_NEW=y
|
||||
|
||||
# Add introspection support for new DBus control interface
|
||||
#CONFIG_CTRL_IFACE_DBUS_INTRO=y
|
||||
|
||||
# Add support for loading EAP methods dynamically as shared libraries.
|
||||
# When this option is enabled, each EAP method can be either included
|
||||
# statically (CONFIG_EAP_<method>=y) or dynamically (CONFIG_EAP_<method>=dyn).
|
||||
# Dynamic EAP methods are build as shared objects (eap_*.so) and they need to
|
||||
# be loaded in the beginning of the wpa_supplicant configuration file
|
||||
# (see load_dynamic_eap parameter in the example file) before being used in
|
||||
# the network blocks.
|
||||
#
|
||||
# Note that some shared parts of EAP methods are included in the main program
|
||||
# and in order to be able to use dynamic EAP methods using these parts, the
|
||||
# main program must have been build with the EAP method enabled (=y or =dyn).
|
||||
# This means that EAP-TLS/PEAP/TTLS/FAST cannot be added as dynamic libraries
|
||||
# unless at least one of them was included in the main build to force inclusion
|
||||
# of the shared code. Similarly, at least one of EAP-SIM/AKA must be included
|
||||
# in the main build to be able to load these methods dynamically.
|
||||
#
|
||||
# Please also note that using dynamic libraries will increase the total binary
|
||||
# size. Thus, it may not be the best option for targets that have limited
|
||||
# amount of memory/flash.
|
||||
#CONFIG_DYNAMIC_EAP_METHODS=y
|
||||
|
||||
# IEEE Std 802.11r-2008 (Fast BSS Transition) for station mode
|
||||
CONFIG_IEEE80211R=y
|
||||
|
||||
# Add support for writing debug log to a file (/tmp/wpa_supplicant-log-#.txt)
|
||||
#CONFIG_DEBUG_FILE=y
|
||||
|
||||
# Send debug messages to syslog instead of stdout
|
||||
CONFIG_DEBUG_SYSLOG=y
|
||||
# Set syslog facility for debug messages
|
||||
CONFIG_DEBUG_SYSLOG_FACILITY=LOG_DAEMON
|
||||
|
||||
# Add support for sending all debug messages (regardless of debug verbosity)
|
||||
# to the Linux kernel tracing facility. This helps debug the entire stack by
|
||||
# making it easy to record everything happening from the driver up into the
|
||||
# same file, e.g., using trace-cmd.
|
||||
#CONFIG_DEBUG_LINUX_TRACING=y
|
||||
|
||||
# Add support for writing debug log to Android logcat instead of standard
|
||||
# output
|
||||
#CONFIG_ANDROID_LOG=y
|
||||
|
||||
# Enable privilege separation (see README 'Privilege separation' for details)
|
||||
#CONFIG_PRIVSEP=y
|
||||
|
||||
# Enable mitigation against certain attacks against TKIP by delaying Michael
|
||||
# MIC error reports by a random amount of time between 0 and 60 seconds
|
||||
#CONFIG_DELAYED_MIC_ERROR_REPORT=y
|
||||
|
||||
# Enable tracing code for developer debugging
|
||||
# This tracks use of memory allocations and other registrations and reports
|
||||
# incorrect use with a backtrace of call (or allocation) location.
|
||||
#CONFIG_WPA_TRACE=y
|
||||
# For BSD, uncomment these.
|
||||
#LIBS += -lexecinfo
|
||||
#LIBS_p += -lexecinfo
|
||||
#LIBS_c += -lexecinfo
|
||||
|
||||
# Use libbfd to get more details for developer debugging
|
||||
# This enables use of libbfd to get more detailed symbols for the backtraces
|
||||
# generated by CONFIG_WPA_TRACE=y.
|
||||
#CONFIG_WPA_TRACE_BFD=y
|
||||
# For BSD, uncomment these.
|
||||
#LIBS += -lbfd -liberty -lz
|
||||
#LIBS_p += -lbfd -liberty -lz
|
||||
#LIBS_c += -lbfd -liberty -lz
|
||||
|
||||
# wpa_supplicant depends on strong random number generation being available
|
||||
# from the operating system. os_get_random() function is used to fetch random
|
||||
# data when needed, e.g., for key generation. On Linux and BSD systems, this
|
||||
# works by reading /dev/urandom. It should be noted that the OS entropy pool
|
||||
# needs to be properly initialized before wpa_supplicant is started. This is
|
||||
# important especially on embedded devices that do not have a hardware random
|
||||
# number generator and may by default start up with minimal entropy available
|
||||
# for random number generation.
|
||||
#
|
||||
# As a safety net, wpa_supplicant is by default trying to internally collect
|
||||
# additional entropy for generating random data to mix in with the data fetched
|
||||
# from the OS. This by itself is not considered to be very strong, but it may
|
||||
# help in cases where the system pool is not initialized properly. However, it
|
||||
# is very strongly recommended that the system pool is initialized with enough
|
||||
# entropy either by using hardware assisted random number generator or by
|
||||
# storing state over device reboots.
|
||||
#
|
||||
# wpa_supplicant can be configured to maintain its own entropy store over
|
||||
# restarts to enhance random number generation. This is not perfect, but it is
|
||||
# much more secure than using the same sequence of random numbers after every
|
||||
# reboot. This can be enabled with -e<entropy file> command line option. The
|
||||
# specified file needs to be readable and writable by wpa_supplicant.
|
||||
#
|
||||
# If the os_get_random() is known to provide strong random data (e.g., on
|
||||
# Linux/BSD, the board in question is known to have reliable source of random
|
||||
# data from /dev/urandom), the internal wpa_supplicant random pool can be
|
||||
# disabled. This will save some in binary size and CPU use. However, this
|
||||
# should only be considered for builds that are known to be used on devices
|
||||
# that meet the requirements described above.
|
||||
CONFIG_NO_RANDOM_POOL=y
|
||||
|
||||
# Should we attempt to use the getrandom(2) call that provides more reliable
|
||||
# yet secure randomness source than /dev/random on Linux 3.17 and newer.
|
||||
# Requires glibc 2.25 to build, falls back to /dev/random if unavailable.
|
||||
CONFIG_GETRANDOM=y
|
||||
|
||||
# IEEE 802.11n (High Throughput) support (mainly for AP mode)
|
||||
#CONFIG_IEEE80211N=y
|
||||
|
||||
# IEEE 802.11ac (Very High Throughput) support (mainly for AP mode)
|
||||
# (depends on CONFIG_IEEE80211N)
|
||||
#CONFIG_IEEE80211AC=y
|
||||
|
||||
# Wireless Network Management (IEEE Std 802.11v-2011)
|
||||
# Note: This is experimental and not complete implementation.
|
||||
CONFIG_WNM=y
|
||||
|
||||
# Interworking (IEEE 802.11u)
|
||||
# This can be used to enable functionality to improve interworking with
|
||||
# external networks (GAS/ANQP to learn more about the networks and network
|
||||
# selection based on available credentials).
|
||||
CONFIG_INTERWORKING=y
|
||||
|
||||
# Hotspot 2.0
|
||||
CONFIG_HS20=y
|
||||
|
||||
# Enable interface matching in wpa_supplicant
|
||||
#CONFIG_MATCH_IFACE=y
|
||||
|
||||
# Disable roaming in wpa_supplicant
|
||||
#CONFIG_NO_ROAMING=y
|
||||
|
||||
# AP mode operations with wpa_supplicant
|
||||
# This can be used for controlling AP mode operations with wpa_supplicant. It
|
||||
# should be noted that this is mainly aimed at simple cases like
|
||||
# WPA2-Personal while more complex configurations like WPA2-Enterprise with an
|
||||
# external RADIUS server can be supported with hostapd.
|
||||
#CONFIG_AP=y
|
||||
|
||||
# P2P (Wi-Fi Direct)
|
||||
# This can be used to enable P2P support in wpa_supplicant. See README-P2P for
|
||||
# more information on P2P operations.
|
||||
#CONFIG_P2P=y
|
||||
|
||||
# Enable TDLS support
|
||||
#CONFIG_TDLS=y
|
||||
|
||||
# Wi-Fi Display
|
||||
# This can be used to enable Wi-Fi Display extensions for P2P using an external
|
||||
# program to control the additional information exchanges in the messages.
|
||||
#CONFIG_WIFI_DISPLAY=y
|
||||
|
||||
# Autoscan
|
||||
# This can be used to enable automatic scan support in wpa_supplicant.
|
||||
# See wpa_supplicant.conf for more information on autoscan usage.
|
||||
#
|
||||
# Enabling directly a module will enable autoscan support.
|
||||
# For exponential module:
|
||||
#CONFIG_AUTOSCAN_EXPONENTIAL=y
|
||||
# For periodic module:
|
||||
#CONFIG_AUTOSCAN_PERIODIC=y
|
||||
|
||||
# Password (and passphrase, etc.) backend for external storage
|
||||
# These optional mechanisms can be used to add support for storing passwords
|
||||
# and other secrets in external (to wpa_supplicant) location. This allows, for
|
||||
# example, operating system specific key storage to be used
|
||||
#
|
||||
# External password backend for testing purposes (developer use)
|
||||
#CONFIG_EXT_PASSWORD_TEST=y
|
||||
|
||||
# Enable Fast Session Transfer (FST)
|
||||
#CONFIG_FST=y
|
||||
|
||||
# Enable CLI commands for FST testing
|
||||
#CONFIG_FST_TEST=y
|
||||
|
||||
# OS X builds. This is only for building eapol_test.
|
||||
#CONFIG_OSX=y
|
||||
|
||||
# Automatic Channel Selection
|
||||
# This will allow wpa_supplicant to pick the channel automatically when channel
|
||||
# is set to "0".
|
||||
#
|
||||
# TODO: Extend parser to be able to parse "channel=acs_survey" as an alternative
|
||||
# to "channel=0". This would enable us to eventually add other ACS algorithms in
|
||||
# similar way.
|
||||
#
|
||||
# Automatic selection is currently only done through initialization, later on
|
||||
# we hope to do background checks to keep us moving to more ideal channels as
|
||||
# time goes by. ACS is currently only supported through the nl80211 driver and
|
||||
# your driver must have survey dump capability that is filled by the driver
|
||||
# during scanning.
|
||||
#
|
||||
# TODO: In analogy to hostapd be able to customize the ACS survey algorithm with
|
||||
# a newly to create wpa_supplicant.conf variable acs_num_scans.
|
||||
#
|
||||
# Supported ACS drivers:
|
||||
# * ath9k
|
||||
# * ath5k
|
||||
# * ath10k
|
||||
#
|
||||
# For more details refer to:
|
||||
# http://wireless.kernel.org/en/users/Documentation/acs
|
||||
#CONFIG_ACS=y
|
||||
|
||||
# Support Multi Band Operation
|
||||
#CONFIG_MBO=y
|
||||
|
||||
# Fast Initial Link Setup (FILS) (IEEE 802.11ai)
|
||||
CONFIG_FILS=y
|
||||
# FILS shared key authentication with PFS
|
||||
#CONFIG_FILS_SK_PFS=y
|
||||
|
||||
# Support RSN on IBSS networks
|
||||
# This is needed to be able to use mode=1 network profile with proto=RSN and
|
||||
# key_mgmt=WPA-PSK (i.e., full key management instead of WPA-None).
|
||||
CONFIG_IBSS_RSN=y
|
||||
|
||||
# External PMKSA cache control
|
||||
# This can be used to enable control interface commands that allow the current
|
||||
# PMKSA cache entries to be fetched and new entries to be added.
|
||||
#CONFIG_PMKSA_CACHE_EXTERNAL=y
|
||||
|
||||
# Mesh Networking (IEEE 802.11s)
|
||||
#CONFIG_MESH=y
|
||||
|
||||
# Background scanning modules
|
||||
# These can be used to request wpa_supplicant to perform background scanning
|
||||
# operations for roaming within an ESS (same SSID). See the bgscan parameter in
|
||||
# the wpa_supplicant.conf file for more details.
|
||||
# Periodic background scans based on signal strength
|
||||
#CONFIG_BGSCAN_SIMPLE=y
|
||||
# Learn channels used by the network and try to avoid bgscans on other
|
||||
# channels (experimental)
|
||||
#CONFIG_BGSCAN_LEARN=y
|
||||
|
||||
# Opportunistic Wireless Encryption (OWE)
|
||||
# Experimental implementation of draft-harkins-owe-07.txt
|
||||
#CONFIG_OWE=y
|
||||
|
||||
# Device Provisioning Protocol (DPP)
|
||||
# This requires CONFIG_IEEE80211W=y to be enabled, too. (see
|
||||
# wpa_supplicant/README-DPP for details)
|
||||
#CONFIG_DPP=y
|
||||
|
||||
# uBus IPC/RPC System
|
||||
# Services can connect to the bus and provide methods
|
||||
# that can be called by other services or clients.
|
||||
CONFIG_UBUS=y
|
||||
|
||||
# OpenWrt patch 380-disable-ctrl-iface-mib.patch
|
||||
# leads to the MIB only being compiled in if
|
||||
# CONFIG_CTRL_IFACE_MIB is enabled.
|
||||
CONFIG_CTRL_IFACE_MIB=y
|
||||
@@ -1,625 +0,0 @@
|
||||
# Example wpa_supplicant build time configuration
|
||||
#
|
||||
# This file lists the configuration options that are used when building the
|
||||
# wpa_supplicant binary. All lines starting with # are ignored. Configuration
|
||||
# option lines must be commented out complete, if they are not to be included,
|
||||
# i.e., just setting VARIABLE=n is not disabling that variable.
|
||||
#
|
||||
# This file is included in Makefile, so variables like CFLAGS and LIBS can also
|
||||
# be modified from here. In most cases, these lines should use += in order not
|
||||
# to override previous values of the variables.
|
||||
|
||||
|
||||
# Uncomment following two lines and fix the paths if you have installed OpenSSL
|
||||
# or GnuTLS in non-default location
|
||||
#CFLAGS += -I/usr/local/openssl/include
|
||||
#LIBS += -L/usr/local/openssl/lib
|
||||
|
||||
# Some Red Hat versions seem to include kerberos header files from OpenSSL, but
|
||||
# the kerberos files are not in the default include path. Following line can be
|
||||
# used to fix build issues on such systems (krb5.h not found).
|
||||
#CFLAGS += -I/usr/include/kerberos
|
||||
|
||||
# Driver interface for generic Linux wireless extensions
|
||||
# Note: WEXT is deprecated in the current Linux kernel version and no new
|
||||
# functionality is added to it. nl80211-based interface is the new
|
||||
# replacement for WEXT and its use allows wpa_supplicant to properly control
|
||||
# the driver to improve existing functionality like roaming and to support new
|
||||
# functionality.
|
||||
#CONFIG_DRIVER_WEXT=y
|
||||
|
||||
# Driver interface for Linux drivers using the nl80211 kernel interface
|
||||
CONFIG_DRIVER_NL80211=y
|
||||
|
||||
# QCA vendor extensions to nl80211
|
||||
#CONFIG_DRIVER_NL80211_QCA=y
|
||||
|
||||
# driver_nl80211.c requires libnl. If you are compiling it yourself
|
||||
# you may need to point hostapd to your version of libnl.
|
||||
#
|
||||
#CFLAGS += -I$<path to libnl include files>
|
||||
#LIBS += -L$<path to libnl library files>
|
||||
|
||||
# Use libnl v2.0 (or 3.0) libraries.
|
||||
#CONFIG_LIBNL20=y
|
||||
|
||||
# Use libnl 3.2 libraries (if this is selected, CONFIG_LIBNL20 is ignored)
|
||||
#CONFIG_LIBNL32=y
|
||||
|
||||
|
||||
# Driver interface for FreeBSD net80211 layer (e.g., Atheros driver)
|
||||
#CONFIG_DRIVER_BSD=y
|
||||
#CFLAGS += -I/usr/local/include
|
||||
#LIBS += -L/usr/local/lib
|
||||
#LIBS_p += -L/usr/local/lib
|
||||
#LIBS_c += -L/usr/local/lib
|
||||
|
||||
# Driver interface for Windows NDIS
|
||||
#CONFIG_DRIVER_NDIS=y
|
||||
#CFLAGS += -I/usr/include/w32api/ddk
|
||||
#LIBS += -L/usr/local/lib
|
||||
# For native build using mingw
|
||||
#CONFIG_NATIVE_WINDOWS=y
|
||||
# Additional directories for cross-compilation on Linux host for mingw target
|
||||
#CFLAGS += -I/opt/mingw/mingw32/include/ddk
|
||||
#LIBS += -L/opt/mingw/mingw32/lib
|
||||
#CC=mingw32-gcc
|
||||
# By default, driver_ndis uses WinPcap for low-level operations. This can be
|
||||
# replaced with the following option which replaces WinPcap calls with NDISUIO.
|
||||
# However, this requires that WZC is disabled (net stop wzcsvc) before starting
|
||||
# wpa_supplicant.
|
||||
# CONFIG_USE_NDISUIO=y
|
||||
|
||||
# Driver interface for wired Ethernet drivers
|
||||
CONFIG_DRIVER_WIRED=y
|
||||
|
||||
# Driver interface for MACsec capable Qualcomm Atheros drivers
|
||||
#CONFIG_DRIVER_MACSEC_QCA=y
|
||||
|
||||
# Driver interface for Linux MACsec drivers
|
||||
#CONFIG_DRIVER_MACSEC_LINUX=y
|
||||
|
||||
# Driver interface for the Broadcom RoboSwitch family
|
||||
#CONFIG_DRIVER_ROBOSWITCH=y
|
||||
|
||||
# Driver interface for no driver (e.g., WPS ER only)
|
||||
#CONFIG_DRIVER_NONE=y
|
||||
|
||||
# Solaris libraries
|
||||
#LIBS += -lsocket -ldlpi -lnsl
|
||||
#LIBS_c += -lsocket
|
||||
|
||||
# Enable IEEE 802.1X Supplicant (automatically included if any EAP method or
|
||||
# MACsec is included)
|
||||
#CONFIG_IEEE8021X_EAPOL=y
|
||||
|
||||
# EAP-MD5
|
||||
#CONFIG_EAP_MD5=y
|
||||
|
||||
# EAP-MSCHAPv2
|
||||
#CONFIG_EAP_MSCHAPV2=y
|
||||
|
||||
# EAP-TLS
|
||||
#CONFIG_EAP_TLS=y
|
||||
|
||||
# EAL-PEAP
|
||||
#CONFIG_EAP_PEAP=y
|
||||
|
||||
# EAP-TTLS
|
||||
#CONFIG_EAP_TTLS=y
|
||||
|
||||
# EAP-FAST
|
||||
#CONFIG_EAP_FAST=y
|
||||
|
||||
# EAP-TEAP
|
||||
# Note: The current EAP-TEAP implementation is experimental and should not be
|
||||
# enabled for production use. The IETF RFC 7170 that defines EAP-TEAP has number
|
||||
# of conflicting statements and missing details and the implementation has
|
||||
# vendor specific workarounds for those and as such, may not interoperate with
|
||||
# any other implementation. This should not be used for anything else than
|
||||
# experimentation and interoperability testing until those issues has been
|
||||
# resolved.
|
||||
#CONFIG_EAP_TEAP=y
|
||||
|
||||
# EAP-GTC
|
||||
#CONFIG_EAP_GTC=y
|
||||
|
||||
# EAP-OTP
|
||||
#CONFIG_EAP_OTP=y
|
||||
|
||||
# EAP-SIM (enable CONFIG_PCSC, if EAP-SIM is used)
|
||||
#CONFIG_EAP_SIM=y
|
||||
|
||||
# Enable SIM simulator (Milenage) for EAP-SIM
|
||||
#CONFIG_SIM_SIMULATOR=y
|
||||
|
||||
# EAP-PSK (experimental; this is _not_ needed for WPA-PSK)
|
||||
#CONFIG_EAP_PSK=y
|
||||
|
||||
# EAP-pwd (secure authentication using only a password)
|
||||
#CONFIG_EAP_PWD=y
|
||||
|
||||
# EAP-PAX
|
||||
#CONFIG_EAP_PAX=y
|
||||
|
||||
# LEAP
|
||||
#CONFIG_EAP_LEAP=y
|
||||
|
||||
# EAP-AKA (enable CONFIG_PCSC, if EAP-AKA is used)
|
||||
#CONFIG_EAP_AKA=y
|
||||
|
||||
# EAP-AKA' (enable CONFIG_PCSC, if EAP-AKA' is used).
|
||||
# This requires CONFIG_EAP_AKA to be enabled, too.
|
||||
#CONFIG_EAP_AKA_PRIME=y
|
||||
|
||||
# Enable USIM simulator (Milenage) for EAP-AKA
|
||||
#CONFIG_USIM_SIMULATOR=y
|
||||
|
||||
# EAP-SAKE
|
||||
#CONFIG_EAP_SAKE=y
|
||||
|
||||
# EAP-GPSK
|
||||
#CONFIG_EAP_GPSK=y
|
||||
# Include support for optional SHA256 cipher suite in EAP-GPSK
|
||||
#CONFIG_EAP_GPSK_SHA256=y
|
||||
|
||||
# EAP-TNC and related Trusted Network Connect support (experimental)
|
||||
#CONFIG_EAP_TNC=y
|
||||
|
||||
# Wi-Fi Protected Setup (WPS)
|
||||
#CONFIG_WPS=y
|
||||
# Enable WPS external registrar functionality
|
||||
#CONFIG_WPS_ER=y
|
||||
# Disable credentials for an open network by default when acting as a WPS
|
||||
# registrar.
|
||||
#CONFIG_WPS_REG_DISABLE_OPEN=y
|
||||
# Enable WPS support with NFC config method
|
||||
#CONFIG_WPS_NFC=y
|
||||
|
||||
# EAP-IKEv2
|
||||
#CONFIG_EAP_IKEV2=y
|
||||
|
||||
# EAP-EKE
|
||||
#CONFIG_EAP_EKE=y
|
||||
|
||||
# MACsec
|
||||
#CONFIG_MACSEC=y
|
||||
|
||||
# PKCS#12 (PFX) support (used to read private key and certificate file from
|
||||
# a file that usually has extension .p12 or .pfx)
|
||||
#CONFIG_PKCS12=y
|
||||
|
||||
# Smartcard support (i.e., private key on a smartcard), e.g., with openssl
|
||||
# engine.
|
||||
#CONFIG_SMARTCARD=y
|
||||
|
||||
# PC/SC interface for smartcards (USIM, GSM SIM)
|
||||
# Enable this if EAP-SIM or EAP-AKA is included
|
||||
#CONFIG_PCSC=y
|
||||
|
||||
# Support HT overrides (disable HT/HT40, mask MCS rates, etc.)
|
||||
CONFIG_HT_OVERRIDES=y
|
||||
|
||||
# Support VHT overrides (disable VHT, mask MCS rates, etc.)
|
||||
CONFIG_VHT_OVERRIDES=y
|
||||
|
||||
# Development testing
|
||||
#CONFIG_EAPOL_TEST=y
|
||||
|
||||
# Select control interface backend for external programs, e.g, wpa_cli:
|
||||
# unix = UNIX domain sockets (default for Linux/*BSD)
|
||||
# udp = UDP sockets using localhost (127.0.0.1)
|
||||
# udp6 = UDP IPv6 sockets using localhost (::1)
|
||||
# named_pipe = Windows Named Pipe (default for Windows)
|
||||
# udp-remote = UDP sockets with remote access (only for tests systems/purpose)
|
||||
# udp6-remote = UDP IPv6 sockets with remote access (only for tests purpose)
|
||||
# y = use default (backwards compatibility)
|
||||
# If this option is commented out, control interface is not included in the
|
||||
# build.
|
||||
CONFIG_CTRL_IFACE=y
|
||||
|
||||
# Include support for GNU Readline and History Libraries in wpa_cli.
|
||||
# When building a wpa_cli binary for distribution, please note that these
|
||||
# libraries are licensed under GPL and as such, BSD license may not apply for
|
||||
# the resulting binary.
|
||||
#CONFIG_READLINE=y
|
||||
|
||||
# Include internal line edit mode in wpa_cli. This can be used as a replacement
|
||||
# for GNU Readline to provide limited command line editing and history support.
|
||||
#CONFIG_WPA_CLI_EDIT=y
|
||||
|
||||
# Remove debugging code that is printing out debug message to stdout.
|
||||
# This can be used to reduce the size of the wpa_supplicant considerably
|
||||
# if debugging code is not needed. The size reduction can be around 35%
|
||||
# (e.g., 90 kB).
|
||||
#CONFIG_NO_STDOUT_DEBUG=y
|
||||
|
||||
# Remove WPA support, e.g., for wired-only IEEE 802.1X supplicant, to save
|
||||
# 35-50 kB in code size.
|
||||
#CONFIG_NO_WPA=y
|
||||
|
||||
# Remove IEEE 802.11i/WPA-Personal ASCII passphrase support
|
||||
# This option can be used to reduce code size by removing support for
|
||||
# converting ASCII passphrases into PSK. If this functionality is removed, the
|
||||
# PSK can only be configured as the 64-octet hexstring (e.g., from
|
||||
# wpa_passphrase). This saves about 0.5 kB in code size.
|
||||
#CONFIG_NO_WPA_PASSPHRASE=y
|
||||
|
||||
# Simultaneous Authentication of Equals (SAE), WPA3-Personal
|
||||
#CONFIG_SAE=y
|
||||
|
||||
# Disable scan result processing (ap_mode=1) to save code size by about 1 kB.
|
||||
# This can be used if ap_scan=1 mode is never enabled.
|
||||
#CONFIG_NO_SCAN_PROCESSING=y
|
||||
|
||||
# Select configuration backend:
|
||||
# file = text file (e.g., wpa_supplicant.conf; note: the configuration file
|
||||
# path is given on command line, not here; this option is just used to
|
||||
# select the backend that allows configuration files to be used)
|
||||
# winreg = Windows registry (see win_example.reg for an example)
|
||||
CONFIG_BACKEND=file
|
||||
|
||||
# Remove configuration write functionality (i.e., to allow the configuration
|
||||
# file to be updated based on runtime configuration changes). The runtime
|
||||
# configuration can still be changed, the changes are just not going to be
|
||||
# persistent over restarts. This option can be used to reduce code size by
|
||||
# about 3.5 kB.
|
||||
CONFIG_NO_CONFIG_WRITE=y
|
||||
|
||||
# Remove support for configuration blobs to reduce code size by about 1.5 kB.
|
||||
#CONFIG_NO_CONFIG_BLOBS=y
|
||||
|
||||
# Select program entry point implementation:
|
||||
# main = UNIX/POSIX like main() function (default)
|
||||
# main_winsvc = Windows service (read parameters from registry)
|
||||
# main_none = Very basic example (development use only)
|
||||
#CONFIG_MAIN=main
|
||||
|
||||
# Select wrapper for operating system and C library specific functions
|
||||
# unix = UNIX/POSIX like systems (default)
|
||||
# win32 = Windows systems
|
||||
# none = Empty template
|
||||
#CONFIG_OS=unix
|
||||
|
||||
# Select event loop implementation
|
||||
# eloop = select() loop (default)
|
||||
# eloop_win = Windows events and WaitForMultipleObject() loop
|
||||
#CONFIG_ELOOP=eloop
|
||||
|
||||
# Should we use poll instead of select? Select is used by default.
|
||||
#CONFIG_ELOOP_POLL=y
|
||||
|
||||
# Should we use epoll instead of select? Select is used by default.
|
||||
CONFIG_ELOOP_EPOLL=y
|
||||
|
||||
# Should we use kqueue instead of select? Select is used by default.
|
||||
#CONFIG_ELOOP_KQUEUE=y
|
||||
|
||||
# Select layer 2 packet implementation
|
||||
# linux = Linux packet socket (default)
|
||||
# pcap = libpcap/libdnet/WinPcap
|
||||
# freebsd = FreeBSD libpcap
|
||||
# winpcap = WinPcap with receive thread
|
||||
# ndis = Windows NDISUIO (note: requires CONFIG_USE_NDISUIO=y)
|
||||
# none = Empty template
|
||||
#CONFIG_L2_PACKET=linux
|
||||
|
||||
# Disable Linux packet socket workaround applicable for station interface
|
||||
# in a bridge for EAPOL frames. This should be uncommented only if the kernel
|
||||
# is known to not have the regression issue in packet socket behavior with
|
||||
# bridge interfaces (commit 'bridge: respect RFC2863 operational state')').
|
||||
CONFIG_NO_LINUX_PACKET_SOCKET_WAR=y
|
||||
|
||||
# IEEE 802.11w (management frame protection), also known as PMF
|
||||
# Driver support is also needed for IEEE 802.11w.
|
||||
#CONFIG_IEEE80211W=y
|
||||
|
||||
# Support Operating Channel Validation
|
||||
#CONFIG_OCV=y
|
||||
|
||||
# Select TLS implementation
|
||||
# openssl = OpenSSL (default)
|
||||
# gnutls = GnuTLS
|
||||
# internal = Internal TLSv1 implementation (experimental)
|
||||
# linux = Linux kernel AF_ALG and internal TLSv1 implementation (experimental)
|
||||
# none = Empty template
|
||||
CONFIG_TLS=internal
|
||||
|
||||
# TLS-based EAP methods require at least TLS v1.0. Newer version of TLS (v1.1)
|
||||
# can be enabled to get a stronger construction of messages when block ciphers
|
||||
# are used. It should be noted that some existing TLS v1.0 -based
|
||||
# implementation may not be compatible with TLS v1.1 message (ClientHello is
|
||||
# sent prior to negotiating which version will be used)
|
||||
#CONFIG_TLSV11=y
|
||||
|
||||
# TLS-based EAP methods require at least TLS v1.0. Newer version of TLS (v1.2)
|
||||
# can be enabled to enable use of stronger crypto algorithms. It should be
|
||||
# noted that some existing TLS v1.0 -based implementation may not be compatible
|
||||
# with TLS v1.2 message (ClientHello is sent prior to negotiating which version
|
||||
# will be used)
|
||||
#CONFIG_TLSV12=y
|
||||
|
||||
# Select which ciphers to use by default with OpenSSL if the user does not
|
||||
# specify them.
|
||||
#CONFIG_TLS_DEFAULT_CIPHERS="DEFAULT:!EXP:!LOW"
|
||||
|
||||
# If CONFIG_TLS=internal is used, additional library and include paths are
|
||||
# needed for LibTomMath. Alternatively, an integrated, minimal version of
|
||||
# LibTomMath can be used. See beginning of libtommath.c for details on benefits
|
||||
# and drawbacks of this option.
|
||||
#CONFIG_INTERNAL_LIBTOMMATH=y
|
||||
#ifndef CONFIG_INTERNAL_LIBTOMMATH
|
||||
#LTM_PATH=/usr/src/libtommath-0.39
|
||||
#CFLAGS += -I$(LTM_PATH)
|
||||
#LIBS += -L$(LTM_PATH)
|
||||
#LIBS_p += -L$(LTM_PATH)
|
||||
#endif
|
||||
# At the cost of about 4 kB of additional binary size, the internal LibTomMath
|
||||
# can be configured to include faster routines for exptmod, sqr, and div to
|
||||
# speed up DH and RSA calculation considerably
|
||||
#CONFIG_INTERNAL_LIBTOMMATH_FAST=y
|
||||
|
||||
# Include NDIS event processing through WMI into wpa_supplicant/wpasvc.
|
||||
# This is only for Windows builds and requires WMI-related header files and
|
||||
# WbemUuid.Lib from Platform SDK even when building with MinGW.
|
||||
#CONFIG_NDIS_EVENTS_INTEGRATED=y
|
||||
#PLATFORMSDKLIB="/opt/Program Files/Microsoft Platform SDK/Lib"
|
||||
|
||||
# Add support for new DBus control interface
|
||||
# (fi.w1.hostap.wpa_supplicant1)
|
||||
#CONFIG_CTRL_IFACE_DBUS_NEW=y
|
||||
|
||||
# Add introspection support for new DBus control interface
|
||||
#CONFIG_CTRL_IFACE_DBUS_INTRO=y
|
||||
|
||||
# Add support for loading EAP methods dynamically as shared libraries.
|
||||
# When this option is enabled, each EAP method can be either included
|
||||
# statically (CONFIG_EAP_<method>=y) or dynamically (CONFIG_EAP_<method>=dyn).
|
||||
# Dynamic EAP methods are build as shared objects (eap_*.so) and they need to
|
||||
# be loaded in the beginning of the wpa_supplicant configuration file
|
||||
# (see load_dynamic_eap parameter in the example file) before being used in
|
||||
# the network blocks.
|
||||
#
|
||||
# Note that some shared parts of EAP methods are included in the main program
|
||||
# and in order to be able to use dynamic EAP methods using these parts, the
|
||||
# main program must have been build with the EAP method enabled (=y or =dyn).
|
||||
# This means that EAP-TLS/PEAP/TTLS/FAST cannot be added as dynamic libraries
|
||||
# unless at least one of them was included in the main build to force inclusion
|
||||
# of the shared code. Similarly, at least one of EAP-SIM/AKA must be included
|
||||
# in the main build to be able to load these methods dynamically.
|
||||
#
|
||||
# Please also note that using dynamic libraries will increase the total binary
|
||||
# size. Thus, it may not be the best option for targets that have limited
|
||||
# amount of memory/flash.
|
||||
#CONFIG_DYNAMIC_EAP_METHODS=y
|
||||
|
||||
# IEEE Std 802.11r-2008 (Fast BSS Transition) for station mode
|
||||
#CONFIG_IEEE80211R=y
|
||||
|
||||
# Add support for writing debug log to a file (/tmp/wpa_supplicant-log-#.txt)
|
||||
#CONFIG_DEBUG_FILE=y
|
||||
|
||||
# Send debug messages to syslog instead of stdout
|
||||
CONFIG_DEBUG_SYSLOG=y
|
||||
# Set syslog facility for debug messages
|
||||
CONFIG_DEBUG_SYSLOG_FACILITY=LOG_DAEMON
|
||||
|
||||
# Add support for sending all debug messages (regardless of debug verbosity)
|
||||
# to the Linux kernel tracing facility. This helps debug the entire stack by
|
||||
# making it easy to record everything happening from the driver up into the
|
||||
# same file, e.g., using trace-cmd.
|
||||
#CONFIG_DEBUG_LINUX_TRACING=y
|
||||
|
||||
# Add support for writing debug log to Android logcat instead of standard
|
||||
# output
|
||||
#CONFIG_ANDROID_LOG=y
|
||||
|
||||
# Enable privilege separation (see README 'Privilege separation' for details)
|
||||
#CONFIG_PRIVSEP=y
|
||||
|
||||
# Enable mitigation against certain attacks against TKIP by delaying Michael
|
||||
# MIC error reports by a random amount of time between 0 and 60 seconds
|
||||
#CONFIG_DELAYED_MIC_ERROR_REPORT=y
|
||||
|
||||
# Enable tracing code for developer debugging
|
||||
# This tracks use of memory allocations and other registrations and reports
|
||||
# incorrect use with a backtrace of call (or allocation) location.
|
||||
#CONFIG_WPA_TRACE=y
|
||||
# For BSD, uncomment these.
|
||||
#LIBS += -lexecinfo
|
||||
#LIBS_p += -lexecinfo
|
||||
#LIBS_c += -lexecinfo
|
||||
|
||||
# Use libbfd to get more details for developer debugging
|
||||
# This enables use of libbfd to get more detailed symbols for the backtraces
|
||||
# generated by CONFIG_WPA_TRACE=y.
|
||||
#CONFIG_WPA_TRACE_BFD=y
|
||||
# For BSD, uncomment these.
|
||||
#LIBS += -lbfd -liberty -lz
|
||||
#LIBS_p += -lbfd -liberty -lz
|
||||
#LIBS_c += -lbfd -liberty -lz
|
||||
|
||||
# wpa_supplicant depends on strong random number generation being available
|
||||
# from the operating system. os_get_random() function is used to fetch random
|
||||
# data when needed, e.g., for key generation. On Linux and BSD systems, this
|
||||
# works by reading /dev/urandom. It should be noted that the OS entropy pool
|
||||
# needs to be properly initialized before wpa_supplicant is started. This is
|
||||
# important especially on embedded devices that do not have a hardware random
|
||||
# number generator and may by default start up with minimal entropy available
|
||||
# for random number generation.
|
||||
#
|
||||
# As a safety net, wpa_supplicant is by default trying to internally collect
|
||||
# additional entropy for generating random data to mix in with the data fetched
|
||||
# from the OS. This by itself is not considered to be very strong, but it may
|
||||
# help in cases where the system pool is not initialized properly. However, it
|
||||
# is very strongly recommended that the system pool is initialized with enough
|
||||
# entropy either by using hardware assisted random number generator or by
|
||||
# storing state over device reboots.
|
||||
#
|
||||
# wpa_supplicant can be configured to maintain its own entropy store over
|
||||
# restarts to enhance random number generation. This is not perfect, but it is
|
||||
# much more secure than using the same sequence of random numbers after every
|
||||
# reboot. This can be enabled with -e<entropy file> command line option. The
|
||||
# specified file needs to be readable and writable by wpa_supplicant.
|
||||
#
|
||||
# If the os_get_random() is known to provide strong random data (e.g., on
|
||||
# Linux/BSD, the board in question is known to have reliable source of random
|
||||
# data from /dev/urandom), the internal wpa_supplicant random pool can be
|
||||
# disabled. This will save some in binary size and CPU use. However, this
|
||||
# should only be considered for builds that are known to be used on devices
|
||||
# that meet the requirements described above.
|
||||
CONFIG_NO_RANDOM_POOL=y
|
||||
|
||||
# Should we attempt to use the getrandom(2) call that provides more reliable
|
||||
# yet secure randomness source than /dev/random on Linux 3.17 and newer.
|
||||
# Requires glibc 2.25 to build, falls back to /dev/random if unavailable.
|
||||
CONFIG_GETRANDOM=y
|
||||
|
||||
# IEEE 802.11n (High Throughput) support (mainly for AP mode)
|
||||
#CONFIG_IEEE80211N=y
|
||||
|
||||
# IEEE 802.11ac (Very High Throughput) support (mainly for AP mode)
|
||||
# (depends on CONFIG_IEEE80211N)
|
||||
#CONFIG_IEEE80211AC=y
|
||||
|
||||
# Wireless Network Management (IEEE Std 802.11v-2011)
|
||||
# Note: This is experimental and not complete implementation.
|
||||
#CONFIG_WNM=y
|
||||
|
||||
# Interworking (IEEE 802.11u)
|
||||
# This can be used to enable functionality to improve interworking with
|
||||
# external networks (GAS/ANQP to learn more about the networks and network
|
||||
# selection based on available credentials).
|
||||
#CONFIG_INTERWORKING=y
|
||||
|
||||
# Hotspot 2.0
|
||||
#CONFIG_HS20=y
|
||||
|
||||
# Enable interface matching in wpa_supplicant
|
||||
#CONFIG_MATCH_IFACE=y
|
||||
|
||||
# Disable roaming in wpa_supplicant
|
||||
#CONFIG_NO_ROAMING=y
|
||||
|
||||
# AP mode operations with wpa_supplicant
|
||||
# This can be used for controlling AP mode operations with wpa_supplicant. It
|
||||
# should be noted that this is mainly aimed at simple cases like
|
||||
# WPA2-Personal while more complex configurations like WPA2-Enterprise with an
|
||||
# external RADIUS server can be supported with hostapd.
|
||||
#CONFIG_AP=y
|
||||
|
||||
# P2P (Wi-Fi Direct)
|
||||
# This can be used to enable P2P support in wpa_supplicant. See README-P2P for
|
||||
# more information on P2P operations.
|
||||
#CONFIG_P2P=y
|
||||
|
||||
# Enable TDLS support
|
||||
#CONFIG_TDLS=y
|
||||
|
||||
# Wi-Fi Display
|
||||
# This can be used to enable Wi-Fi Display extensions for P2P using an external
|
||||
# program to control the additional information exchanges in the messages.
|
||||
#CONFIG_WIFI_DISPLAY=y
|
||||
|
||||
# Autoscan
|
||||
# This can be used to enable automatic scan support in wpa_supplicant.
|
||||
# See wpa_supplicant.conf for more information on autoscan usage.
|
||||
#
|
||||
# Enabling directly a module will enable autoscan support.
|
||||
# For exponential module:
|
||||
#CONFIG_AUTOSCAN_EXPONENTIAL=y
|
||||
# For periodic module:
|
||||
#CONFIG_AUTOSCAN_PERIODIC=y
|
||||
|
||||
# Password (and passphrase, etc.) backend for external storage
|
||||
# These optional mechanisms can be used to add support for storing passwords
|
||||
# and other secrets in external (to wpa_supplicant) location. This allows, for
|
||||
# example, operating system specific key storage to be used
|
||||
#
|
||||
# External password backend for testing purposes (developer use)
|
||||
#CONFIG_EXT_PASSWORD_TEST=y
|
||||
|
||||
# Enable Fast Session Transfer (FST)
|
||||
#CONFIG_FST=y
|
||||
|
||||
# Enable CLI commands for FST testing
|
||||
#CONFIG_FST_TEST=y
|
||||
|
||||
# OS X builds. This is only for building eapol_test.
|
||||
#CONFIG_OSX=y
|
||||
|
||||
# Automatic Channel Selection
|
||||
# This will allow wpa_supplicant to pick the channel automatically when channel
|
||||
# is set to "0".
|
||||
#
|
||||
# TODO: Extend parser to be able to parse "channel=acs_survey" as an alternative
|
||||
# to "channel=0". This would enable us to eventually add other ACS algorithms in
|
||||
# similar way.
|
||||
#
|
||||
# Automatic selection is currently only done through initialization, later on
|
||||
# we hope to do background checks to keep us moving to more ideal channels as
|
||||
# time goes by. ACS is currently only supported through the nl80211 driver and
|
||||
# your driver must have survey dump capability that is filled by the driver
|
||||
# during scanning.
|
||||
#
|
||||
# TODO: In analogy to hostapd be able to customize the ACS survey algorithm with
|
||||
# a newly to create wpa_supplicant.conf variable acs_num_scans.
|
||||
#
|
||||
# Supported ACS drivers:
|
||||
# * ath9k
|
||||
# * ath5k
|
||||
# * ath10k
|
||||
#
|
||||
# For more details refer to:
|
||||
# http://wireless.kernel.org/en/users/Documentation/acs
|
||||
#CONFIG_ACS=y
|
||||
|
||||
# Support Multi Band Operation
|
||||
#CONFIG_MBO=y
|
||||
|
||||
# Fast Initial Link Setup (FILS) (IEEE 802.11ai)
|
||||
#CONFIG_FILS=y
|
||||
# FILS shared key authentication with PFS
|
||||
#CONFIG_FILS_SK_PFS=y
|
||||
|
||||
# Support RSN on IBSS networks
|
||||
# This is needed to be able to use mode=1 network profile with proto=RSN and
|
||||
# key_mgmt=WPA-PSK (i.e., full key management instead of WPA-None).
|
||||
#CONFIG_IBSS_RSN=y
|
||||
|
||||
# External PMKSA cache control
|
||||
# This can be used to enable control interface commands that allow the current
|
||||
# PMKSA cache entries to be fetched and new entries to be added.
|
||||
#CONFIG_PMKSA_CACHE_EXTERNAL=y
|
||||
|
||||
# Mesh Networking (IEEE 802.11s)
|
||||
#CONFIG_MESH=y
|
||||
|
||||
# Background scanning modules
|
||||
# These can be used to request wpa_supplicant to perform background scanning
|
||||
# operations for roaming within an ESS (same SSID). See the bgscan parameter in
|
||||
# the wpa_supplicant.conf file for more details.
|
||||
# Periodic background scans based on signal strength
|
||||
#CONFIG_BGSCAN_SIMPLE=y
|
||||
# Learn channels used by the network and try to avoid bgscans on other
|
||||
# channels (experimental)
|
||||
#CONFIG_BGSCAN_LEARN=y
|
||||
|
||||
# Opportunistic Wireless Encryption (OWE)
|
||||
# Experimental implementation of draft-harkins-owe-07.txt
|
||||
#CONFIG_OWE=y
|
||||
|
||||
# Device Provisioning Protocol (DPP)
|
||||
# This requires CONFIG_IEEE80211W=y to be enabled, too. (see
|
||||
# wpa_supplicant/README-DPP for details)
|
||||
#CONFIG_DPP=y
|
||||
|
||||
# uBus IPC/RPC System
|
||||
# Services can connect to the bus and provide methods
|
||||
# that can be called by other services or clients.
|
||||
CONFIG_UBUS=y
|
||||
|
||||
# OpenWrt patch 380-disable-ctrl-iface-mib.patch
|
||||
# leads to the MIB only being compiled in if
|
||||
# CONFIG_CTRL_IFACE_MIB is enabled.
|
||||
#CONFIG_CTRL_IFACE_MIB=y
|
||||
@@ -1,625 +0,0 @@
|
||||
# Example wpa_supplicant build time configuration
|
||||
#
|
||||
# This file lists the configuration options that are used when building the
|
||||
# wpa_supplicant binary. All lines starting with # are ignored. Configuration
|
||||
# option lines must be commented out complete, if they are not to be included,
|
||||
# i.e., just setting VARIABLE=n is not disabling that variable.
|
||||
#
|
||||
# This file is included in Makefile, so variables like CFLAGS and LIBS can also
|
||||
# be modified from here. In most cases, these lines should use += in order not
|
||||
# to override previous values of the variables.
|
||||
|
||||
|
||||
# Uncomment following two lines and fix the paths if you have installed OpenSSL
|
||||
# or GnuTLS in non-default location
|
||||
#CFLAGS += -I/usr/local/openssl/include
|
||||
#LIBS += -L/usr/local/openssl/lib
|
||||
|
||||
# Some Red Hat versions seem to include kerberos header files from OpenSSL, but
|
||||
# the kerberos files are not in the default include path. Following line can be
|
||||
# used to fix build issues on such systems (krb5.h not found).
|
||||
#CFLAGS += -I/usr/include/kerberos
|
||||
|
||||
# Driver interface for generic Linux wireless extensions
|
||||
# Note: WEXT is deprecated in the current Linux kernel version and no new
|
||||
# functionality is added to it. nl80211-based interface is the new
|
||||
# replacement for WEXT and its use allows wpa_supplicant to properly control
|
||||
# the driver to improve existing functionality like roaming and to support new
|
||||
# functionality.
|
||||
#CONFIG_DRIVER_WEXT=y
|
||||
|
||||
# Driver interface for Linux drivers using the nl80211 kernel interface
|
||||
CONFIG_DRIVER_NL80211=y
|
||||
|
||||
# QCA vendor extensions to nl80211
|
||||
#CONFIG_DRIVER_NL80211_QCA=y
|
||||
|
||||
# driver_nl80211.c requires libnl. If you are compiling it yourself
|
||||
# you may need to point hostapd to your version of libnl.
|
||||
#
|
||||
#CFLAGS += -I$<path to libnl include files>
|
||||
#LIBS += -L$<path to libnl library files>
|
||||
|
||||
# Use libnl v2.0 (or 3.0) libraries.
|
||||
#CONFIG_LIBNL20=y
|
||||
|
||||
# Use libnl 3.2 libraries (if this is selected, CONFIG_LIBNL20 is ignored)
|
||||
#CONFIG_LIBNL32=y
|
||||
|
||||
|
||||
# Driver interface for FreeBSD net80211 layer (e.g., Atheros driver)
|
||||
#CONFIG_DRIVER_BSD=y
|
||||
#CFLAGS += -I/usr/local/include
|
||||
#LIBS += -L/usr/local/lib
|
||||
#LIBS_p += -L/usr/local/lib
|
||||
#LIBS_c += -L/usr/local/lib
|
||||
|
||||
# Driver interface for Windows NDIS
|
||||
#CONFIG_DRIVER_NDIS=y
|
||||
#CFLAGS += -I/usr/include/w32api/ddk
|
||||
#LIBS += -L/usr/local/lib
|
||||
# For native build using mingw
|
||||
#CONFIG_NATIVE_WINDOWS=y
|
||||
# Additional directories for cross-compilation on Linux host for mingw target
|
||||
#CFLAGS += -I/opt/mingw/mingw32/include/ddk
|
||||
#LIBS += -L/opt/mingw/mingw32/lib
|
||||
#CC=mingw32-gcc
|
||||
# By default, driver_ndis uses WinPcap for low-level operations. This can be
|
||||
# replaced with the following option which replaces WinPcap calls with NDISUIO.
|
||||
# However, this requires that WZC is disabled (net stop wzcsvc) before starting
|
||||
# wpa_supplicant.
|
||||
# CONFIG_USE_NDISUIO=y
|
||||
|
||||
# Driver interface for wired Ethernet drivers
|
||||
CONFIG_DRIVER_WIRED=y
|
||||
|
||||
# Driver interface for MACsec capable Qualcomm Atheros drivers
|
||||
#CONFIG_DRIVER_MACSEC_QCA=y
|
||||
|
||||
# Driver interface for Linux MACsec drivers
|
||||
#CONFIG_DRIVER_MACSEC_LINUX=y
|
||||
|
||||
# Driver interface for the Broadcom RoboSwitch family
|
||||
#CONFIG_DRIVER_ROBOSWITCH=y
|
||||
|
||||
# Driver interface for no driver (e.g., WPS ER only)
|
||||
#CONFIG_DRIVER_NONE=y
|
||||
|
||||
# Solaris libraries
|
||||
#LIBS += -lsocket -ldlpi -lnsl
|
||||
#LIBS_c += -lsocket
|
||||
|
||||
# Enable IEEE 802.1X Supplicant (automatically included if any EAP method or
|
||||
# MACsec is included)
|
||||
CONFIG_IEEE8021X_EAPOL=y
|
||||
|
||||
# EAP-MD5
|
||||
CONFIG_EAP_MD5=y
|
||||
|
||||
# EAP-MSCHAPv2
|
||||
CONFIG_EAP_MSCHAPV2=y
|
||||
|
||||
# EAP-TLS
|
||||
CONFIG_EAP_TLS=y
|
||||
|
||||
# EAL-PEAP
|
||||
CONFIG_EAP_PEAP=y
|
||||
|
||||
# EAP-TTLS
|
||||
CONFIG_EAP_TTLS=y
|
||||
|
||||
# EAP-FAST
|
||||
CONFIG_EAP_FAST=y
|
||||
|
||||
# EAP-TEAP
|
||||
# Note: The current EAP-TEAP implementation is experimental and should not be
|
||||
# enabled for production use. The IETF RFC 7170 that defines EAP-TEAP has number
|
||||
# of conflicting statements and missing details and the implementation has
|
||||
# vendor specific workarounds for those and as such, may not interoperate with
|
||||
# any other implementation. This should not be used for anything else than
|
||||
# experimentation and interoperability testing until those issues has been
|
||||
# resolved.
|
||||
#CONFIG_EAP_TEAP=y
|
||||
|
||||
# EAP-GTC
|
||||
CONFIG_EAP_GTC=y
|
||||
|
||||
# EAP-OTP
|
||||
CONFIG_EAP_OTP=y
|
||||
|
||||
# EAP-SIM (enable CONFIG_PCSC, if EAP-SIM is used)
|
||||
#CONFIG_EAP_SIM=y
|
||||
|
||||
# Enable SIM simulator (Milenage) for EAP-SIM
|
||||
#CONFIG_SIM_SIMULATOR=y
|
||||
|
||||
# EAP-PSK (experimental; this is _not_ needed for WPA-PSK)
|
||||
#CONFIG_EAP_PSK=y
|
||||
|
||||
# EAP-pwd (secure authentication using only a password)
|
||||
#CONFIG_EAP_PWD=y
|
||||
|
||||
# EAP-PAX
|
||||
#CONFIG_EAP_PAX=y
|
||||
|
||||
# LEAP
|
||||
CONFIG_EAP_LEAP=y
|
||||
|
||||
# EAP-AKA (enable CONFIG_PCSC, if EAP-AKA is used)
|
||||
#CONFIG_EAP_AKA=y
|
||||
|
||||
# EAP-AKA' (enable CONFIG_PCSC, if EAP-AKA' is used).
|
||||
# This requires CONFIG_EAP_AKA to be enabled, too.
|
||||
#CONFIG_EAP_AKA_PRIME=y
|
||||
|
||||
# Enable USIM simulator (Milenage) for EAP-AKA
|
||||
#CONFIG_USIM_SIMULATOR=y
|
||||
|
||||
# EAP-SAKE
|
||||
#CONFIG_EAP_SAKE=y
|
||||
|
||||
# EAP-GPSK
|
||||
#CONFIG_EAP_GPSK=y
|
||||
# Include support for optional SHA256 cipher suite in EAP-GPSK
|
||||
#CONFIG_EAP_GPSK_SHA256=y
|
||||
|
||||
# EAP-TNC and related Trusted Network Connect support (experimental)
|
||||
#CONFIG_EAP_TNC=y
|
||||
|
||||
# Wi-Fi Protected Setup (WPS)
|
||||
CONFIG_WPS=y
|
||||
# Enable WPS external registrar functionality
|
||||
#CONFIG_WPS_ER=y
|
||||
# Disable credentials for an open network by default when acting as a WPS
|
||||
# registrar.
|
||||
#CONFIG_WPS_REG_DISABLE_OPEN=y
|
||||
# Enable WPS support with NFC config method
|
||||
#CONFIG_WPS_NFC=y
|
||||
|
||||
# EAP-IKEv2
|
||||
#CONFIG_EAP_IKEV2=y
|
||||
|
||||
# EAP-EKE
|
||||
#CONFIG_EAP_EKE=y
|
||||
|
||||
# MACsec
|
||||
#CONFIG_MACSEC=y
|
||||
|
||||
# PKCS#12 (PFX) support (used to read private key and certificate file from
|
||||
# a file that usually has extension .p12 or .pfx)
|
||||
CONFIG_PKCS12=y
|
||||
|
||||
# Smartcard support (i.e., private key on a smartcard), e.g., with openssl
|
||||
# engine.
|
||||
CONFIG_SMARTCARD=y
|
||||
|
||||
# PC/SC interface for smartcards (USIM, GSM SIM)
|
||||
# Enable this if EAP-SIM or EAP-AKA is included
|
||||
#CONFIG_PCSC=y
|
||||
|
||||
# Support HT overrides (disable HT/HT40, mask MCS rates, etc.)
|
||||
CONFIG_HT_OVERRIDES=y
|
||||
|
||||
# Support VHT overrides (disable VHT, mask MCS rates, etc.)
|
||||
CONFIG_VHT_OVERRIDES=y
|
||||
|
||||
# Development testing
|
||||
#CONFIG_EAPOL_TEST=y
|
||||
|
||||
# Select control interface backend for external programs, e.g, wpa_cli:
|
||||
# unix = UNIX domain sockets (default for Linux/*BSD)
|
||||
# udp = UDP sockets using localhost (127.0.0.1)
|
||||
# udp6 = UDP IPv6 sockets using localhost (::1)
|
||||
# named_pipe = Windows Named Pipe (default for Windows)
|
||||
# udp-remote = UDP sockets with remote access (only for tests systems/purpose)
|
||||
# udp6-remote = UDP IPv6 sockets with remote access (only for tests purpose)
|
||||
# y = use default (backwards compatibility)
|
||||
# If this option is commented out, control interface is not included in the
|
||||
# build.
|
||||
CONFIG_CTRL_IFACE=y
|
||||
|
||||
# Include support for GNU Readline and History Libraries in wpa_cli.
|
||||
# When building a wpa_cli binary for distribution, please note that these
|
||||
# libraries are licensed under GPL and as such, BSD license may not apply for
|
||||
# the resulting binary.
|
||||
#CONFIG_READLINE=y
|
||||
|
||||
# Include internal line edit mode in wpa_cli. This can be used as a replacement
|
||||
# for GNU Readline to provide limited command line editing and history support.
|
||||
#CONFIG_WPA_CLI_EDIT=y
|
||||
|
||||
# Remove debugging code that is printing out debug message to stdout.
|
||||
# This can be used to reduce the size of the wpa_supplicant considerably
|
||||
# if debugging code is not needed. The size reduction can be around 35%
|
||||
# (e.g., 90 kB).
|
||||
#CONFIG_NO_STDOUT_DEBUG=y
|
||||
|
||||
# Remove WPA support, e.g., for wired-only IEEE 802.1X supplicant, to save
|
||||
# 35-50 kB in code size.
|
||||
#CONFIG_NO_WPA=y
|
||||
|
||||
# Remove IEEE 802.11i/WPA-Personal ASCII passphrase support
|
||||
# This option can be used to reduce code size by removing support for
|
||||
# converting ASCII passphrases into PSK. If this functionality is removed, the
|
||||
# PSK can only be configured as the 64-octet hexstring (e.g., from
|
||||
# wpa_passphrase). This saves about 0.5 kB in code size.
|
||||
#CONFIG_NO_WPA_PASSPHRASE=y
|
||||
|
||||
# Simultaneous Authentication of Equals (SAE), WPA3-Personal
|
||||
#CONFIG_SAE=y
|
||||
|
||||
# Disable scan result processing (ap_mode=1) to save code size by about 1 kB.
|
||||
# This can be used if ap_scan=1 mode is never enabled.
|
||||
#CONFIG_NO_SCAN_PROCESSING=y
|
||||
|
||||
# Select configuration backend:
|
||||
# file = text file (e.g., wpa_supplicant.conf; note: the configuration file
|
||||
# path is given on command line, not here; this option is just used to
|
||||
# select the backend that allows configuration files to be used)
|
||||
# winreg = Windows registry (see win_example.reg for an example)
|
||||
CONFIG_BACKEND=file
|
||||
|
||||
# Remove configuration write functionality (i.e., to allow the configuration
|
||||
# file to be updated based on runtime configuration changes). The runtime
|
||||
# configuration can still be changed, the changes are just not going to be
|
||||
# persistent over restarts. This option can be used to reduce code size by
|
||||
# about 3.5 kB.
|
||||
#CONFIG_NO_CONFIG_WRITE=y
|
||||
|
||||
# Remove support for configuration blobs to reduce code size by about 1.5 kB.
|
||||
#CONFIG_NO_CONFIG_BLOBS=y
|
||||
|
||||
# Select program entry point implementation:
|
||||
# main = UNIX/POSIX like main() function (default)
|
||||
# main_winsvc = Windows service (read parameters from registry)
|
||||
# main_none = Very basic example (development use only)
|
||||
#CONFIG_MAIN=main
|
||||
|
||||
# Select wrapper for operating system and C library specific functions
|
||||
# unix = UNIX/POSIX like systems (default)
|
||||
# win32 = Windows systems
|
||||
# none = Empty template
|
||||
#CONFIG_OS=unix
|
||||
|
||||
# Select event loop implementation
|
||||
# eloop = select() loop (default)
|
||||
# eloop_win = Windows events and WaitForMultipleObject() loop
|
||||
#CONFIG_ELOOP=eloop
|
||||
|
||||
# Should we use poll instead of select? Select is used by default.
|
||||
#CONFIG_ELOOP_POLL=y
|
||||
|
||||
# Should we use epoll instead of select? Select is used by default.
|
||||
CONFIG_ELOOP_EPOLL=y
|
||||
|
||||
# Should we use kqueue instead of select? Select is used by default.
|
||||
#CONFIG_ELOOP_KQUEUE=y
|
||||
|
||||
# Select layer 2 packet implementation
|
||||
# linux = Linux packet socket (default)
|
||||
# pcap = libpcap/libdnet/WinPcap
|
||||
# freebsd = FreeBSD libpcap
|
||||
# winpcap = WinPcap with receive thread
|
||||
# ndis = Windows NDISUIO (note: requires CONFIG_USE_NDISUIO=y)
|
||||
# none = Empty template
|
||||
#CONFIG_L2_PACKET=linux
|
||||
|
||||
# Disable Linux packet socket workaround applicable for station interface
|
||||
# in a bridge for EAPOL frames. This should be uncommented only if the kernel
|
||||
# is known to not have the regression issue in packet socket behavior with
|
||||
# bridge interfaces (commit 'bridge: respect RFC2863 operational state')').
|
||||
CONFIG_NO_LINUX_PACKET_SOCKET_WAR=y
|
||||
|
||||
# IEEE 802.11w (management frame protection), also known as PMF
|
||||
# Driver support is also needed for IEEE 802.11w.
|
||||
CONFIG_IEEE80211W=y
|
||||
|
||||
# Support Operating Channel Validation
|
||||
#CONFIG_OCV=y
|
||||
|
||||
# Select TLS implementation
|
||||
# openssl = OpenSSL (default)
|
||||
# gnutls = GnuTLS
|
||||
# internal = Internal TLSv1 implementation (experimental)
|
||||
# linux = Linux kernel AF_ALG and internal TLSv1 implementation (experimental)
|
||||
# none = Empty template
|
||||
CONFIG_TLS=internal
|
||||
|
||||
# TLS-based EAP methods require at least TLS v1.0. Newer version of TLS (v1.1)
|
||||
# can be enabled to get a stronger construction of messages when block ciphers
|
||||
# are used. It should be noted that some existing TLS v1.0 -based
|
||||
# implementation may not be compatible with TLS v1.1 message (ClientHello is
|
||||
# sent prior to negotiating which version will be used)
|
||||
#CONFIG_TLSV11=y
|
||||
|
||||
# TLS-based EAP methods require at least TLS v1.0. Newer version of TLS (v1.2)
|
||||
# can be enabled to enable use of stronger crypto algorithms. It should be
|
||||
# noted that some existing TLS v1.0 -based implementation may not be compatible
|
||||
# with TLS v1.2 message (ClientHello is sent prior to negotiating which version
|
||||
# will be used)
|
||||
#CONFIG_TLSV12=y
|
||||
|
||||
# Select which ciphers to use by default with OpenSSL if the user does not
|
||||
# specify them.
|
||||
#CONFIG_TLS_DEFAULT_CIPHERS="DEFAULT:!EXP:!LOW"
|
||||
|
||||
# If CONFIG_TLS=internal is used, additional library and include paths are
|
||||
# needed for LibTomMath. Alternatively, an integrated, minimal version of
|
||||
# LibTomMath can be used. See beginning of libtommath.c for details on benefits
|
||||
# and drawbacks of this option.
|
||||
CONFIG_INTERNAL_LIBTOMMATH=y
|
||||
#ifndef CONFIG_INTERNAL_LIBTOMMATH
|
||||
#LTM_PATH=/usr/src/libtommath-0.39
|
||||
#CFLAGS += -I$(LTM_PATH)
|
||||
#LIBS += -L$(LTM_PATH)
|
||||
#LIBS_p += -L$(LTM_PATH)
|
||||
#endif
|
||||
# At the cost of about 4 kB of additional binary size, the internal LibTomMath
|
||||
# can be configured to include faster routines for exptmod, sqr, and div to
|
||||
# speed up DH and RSA calculation considerably
|
||||
CONFIG_INTERNAL_LIBTOMMATH_FAST=y
|
||||
|
||||
# Include NDIS event processing through WMI into wpa_supplicant/wpasvc.
|
||||
# This is only for Windows builds and requires WMI-related header files and
|
||||
# WbemUuid.Lib from Platform SDK even when building with MinGW.
|
||||
#CONFIG_NDIS_EVENTS_INTEGRATED=y
|
||||
#PLATFORMSDKLIB="/opt/Program Files/Microsoft Platform SDK/Lib"
|
||||
|
||||
# Add support for new DBus control interface
|
||||
# (fi.w1.hostap.wpa_supplicant1)
|
||||
#CONFIG_CTRL_IFACE_DBUS_NEW=y
|
||||
|
||||
# Add introspection support for new DBus control interface
|
||||
#CONFIG_CTRL_IFACE_DBUS_INTRO=y
|
||||
|
||||
# Add support for loading EAP methods dynamically as shared libraries.
|
||||
# When this option is enabled, each EAP method can be either included
|
||||
# statically (CONFIG_EAP_<method>=y) or dynamically (CONFIG_EAP_<method>=dyn).
|
||||
# Dynamic EAP methods are build as shared objects (eap_*.so) and they need to
|
||||
# be loaded in the beginning of the wpa_supplicant configuration file
|
||||
# (see load_dynamic_eap parameter in the example file) before being used in
|
||||
# the network blocks.
|
||||
#
|
||||
# Note that some shared parts of EAP methods are included in the main program
|
||||
# and in order to be able to use dynamic EAP methods using these parts, the
|
||||
# main program must have been build with the EAP method enabled (=y or =dyn).
|
||||
# This means that EAP-TLS/PEAP/TTLS/FAST cannot be added as dynamic libraries
|
||||
# unless at least one of them was included in the main build to force inclusion
|
||||
# of the shared code. Similarly, at least one of EAP-SIM/AKA must be included
|
||||
# in the main build to be able to load these methods dynamically.
|
||||
#
|
||||
# Please also note that using dynamic libraries will increase the total binary
|
||||
# size. Thus, it may not be the best option for targets that have limited
|
||||
# amount of memory/flash.
|
||||
#CONFIG_DYNAMIC_EAP_METHODS=y
|
||||
|
||||
# IEEE Std 802.11r-2008 (Fast BSS Transition) for station mode
|
||||
#CONFIG_IEEE80211R=y
|
||||
|
||||
# Add support for writing debug log to a file (/tmp/wpa_supplicant-log-#.txt)
|
||||
#CONFIG_DEBUG_FILE=y
|
||||
|
||||
# Send debug messages to syslog instead of stdout
|
||||
CONFIG_DEBUG_SYSLOG=y
|
||||
# Set syslog facility for debug messages
|
||||
CONFIG_DEBUG_SYSLOG_FACILITY=LOG_DAEMON
|
||||
|
||||
# Add support for sending all debug messages (regardless of debug verbosity)
|
||||
# to the Linux kernel tracing facility. This helps debug the entire stack by
|
||||
# making it easy to record everything happening from the driver up into the
|
||||
# same file, e.g., using trace-cmd.
|
||||
#CONFIG_DEBUG_LINUX_TRACING=y
|
||||
|
||||
# Add support for writing debug log to Android logcat instead of standard
|
||||
# output
|
||||
#CONFIG_ANDROID_LOG=y
|
||||
|
||||
# Enable privilege separation (see README 'Privilege separation' for details)
|
||||
#CONFIG_PRIVSEP=y
|
||||
|
||||
# Enable mitigation against certain attacks against TKIP by delaying Michael
|
||||
# MIC error reports by a random amount of time between 0 and 60 seconds
|
||||
#CONFIG_DELAYED_MIC_ERROR_REPORT=y
|
||||
|
||||
# Enable tracing code for developer debugging
|
||||
# This tracks use of memory allocations and other registrations and reports
|
||||
# incorrect use with a backtrace of call (or allocation) location.
|
||||
#CONFIG_WPA_TRACE=y
|
||||
# For BSD, uncomment these.
|
||||
#LIBS += -lexecinfo
|
||||
#LIBS_p += -lexecinfo
|
||||
#LIBS_c += -lexecinfo
|
||||
|
||||
# Use libbfd to get more details for developer debugging
|
||||
# This enables use of libbfd to get more detailed symbols for the backtraces
|
||||
# generated by CONFIG_WPA_TRACE=y.
|
||||
#CONFIG_WPA_TRACE_BFD=y
|
||||
# For BSD, uncomment these.
|
||||
#LIBS += -lbfd -liberty -lz
|
||||
#LIBS_p += -lbfd -liberty -lz
|
||||
#LIBS_c += -lbfd -liberty -lz
|
||||
|
||||
# wpa_supplicant depends on strong random number generation being available
|
||||
# from the operating system. os_get_random() function is used to fetch random
|
||||
# data when needed, e.g., for key generation. On Linux and BSD systems, this
|
||||
# works by reading /dev/urandom. It should be noted that the OS entropy pool
|
||||
# needs to be properly initialized before wpa_supplicant is started. This is
|
||||
# important especially on embedded devices that do not have a hardware random
|
||||
# number generator and may by default start up with minimal entropy available
|
||||
# for random number generation.
|
||||
#
|
||||
# As a safety net, wpa_supplicant is by default trying to internally collect
|
||||
# additional entropy for generating random data to mix in with the data fetched
|
||||
# from the OS. This by itself is not considered to be very strong, but it may
|
||||
# help in cases where the system pool is not initialized properly. However, it
|
||||
# is very strongly recommended that the system pool is initialized with enough
|
||||
# entropy either by using hardware assisted random number generator or by
|
||||
# storing state over device reboots.
|
||||
#
|
||||
# wpa_supplicant can be configured to maintain its own entropy store over
|
||||
# restarts to enhance random number generation. This is not perfect, but it is
|
||||
# much more secure than using the same sequence of random numbers after every
|
||||
# reboot. This can be enabled with -e<entropy file> command line option. The
|
||||
# specified file needs to be readable and writable by wpa_supplicant.
|
||||
#
|
||||
# If the os_get_random() is known to provide strong random data (e.g., on
|
||||
# Linux/BSD, the board in question is known to have reliable source of random
|
||||
# data from /dev/urandom), the internal wpa_supplicant random pool can be
|
||||
# disabled. This will save some in binary size and CPU use. However, this
|
||||
# should only be considered for builds that are known to be used on devices
|
||||
# that meet the requirements described above.
|
||||
CONFIG_NO_RANDOM_POOL=y
|
||||
|
||||
# Should we attempt to use the getrandom(2) call that provides more reliable
|
||||
# yet secure randomness source than /dev/random on Linux 3.17 and newer.
|
||||
# Requires glibc 2.25 to build, falls back to /dev/random if unavailable.
|
||||
CONFIG_GETRANDOM=y
|
||||
|
||||
# IEEE 802.11n (High Throughput) support (mainly for AP mode)
|
||||
#CONFIG_IEEE80211N=y
|
||||
|
||||
# IEEE 802.11ac (Very High Throughput) support (mainly for AP mode)
|
||||
# (depends on CONFIG_IEEE80211N)
|
||||
#CONFIG_IEEE80211AC=y
|
||||
|
||||
# Wireless Network Management (IEEE Std 802.11v-2011)
|
||||
# Note: This is experimental and not complete implementation.
|
||||
#CONFIG_WNM=y
|
||||
|
||||
# Interworking (IEEE 802.11u)
|
||||
# This can be used to enable functionality to improve interworking with
|
||||
# external networks (GAS/ANQP to learn more about the networks and network
|
||||
# selection based on available credentials).
|
||||
#CONFIG_INTERWORKING=y
|
||||
|
||||
# Hotspot 2.0
|
||||
#CONFIG_HS20=y
|
||||
|
||||
# Enable interface matching in wpa_supplicant
|
||||
#CONFIG_MATCH_IFACE=y
|
||||
|
||||
# Disable roaming in wpa_supplicant
|
||||
#CONFIG_NO_ROAMING=y
|
||||
|
||||
# AP mode operations with wpa_supplicant
|
||||
# This can be used for controlling AP mode operations with wpa_supplicant. It
|
||||
# should be noted that this is mainly aimed at simple cases like
|
||||
# WPA2-Personal while more complex configurations like WPA2-Enterprise with an
|
||||
# external RADIUS server can be supported with hostapd.
|
||||
CONFIG_AP=y
|
||||
|
||||
# P2P (Wi-Fi Direct)
|
||||
# This can be used to enable P2P support in wpa_supplicant. See README-P2P for
|
||||
# more information on P2P operations.
|
||||
CONFIG_P2P=y
|
||||
|
||||
# Enable TDLS support
|
||||
#CONFIG_TDLS=y
|
||||
|
||||
# Wi-Fi Display
|
||||
# This can be used to enable Wi-Fi Display extensions for P2P using an external
|
||||
# program to control the additional information exchanges in the messages.
|
||||
#CONFIG_WIFI_DISPLAY=y
|
||||
|
||||
# Autoscan
|
||||
# This can be used to enable automatic scan support in wpa_supplicant.
|
||||
# See wpa_supplicant.conf for more information on autoscan usage.
|
||||
#
|
||||
# Enabling directly a module will enable autoscan support.
|
||||
# For exponential module:
|
||||
#CONFIG_AUTOSCAN_EXPONENTIAL=y
|
||||
# For periodic module:
|
||||
#CONFIG_AUTOSCAN_PERIODIC=y
|
||||
|
||||
# Password (and passphrase, etc.) backend for external storage
|
||||
# These optional mechanisms can be used to add support for storing passwords
|
||||
# and other secrets in external (to wpa_supplicant) location. This allows, for
|
||||
# example, operating system specific key storage to be used
|
||||
#
|
||||
# External password backend for testing purposes (developer use)
|
||||
#CONFIG_EXT_PASSWORD_TEST=y
|
||||
|
||||
# Enable Fast Session Transfer (FST)
|
||||
#CONFIG_FST=y
|
||||
|
||||
# Enable CLI commands for FST testing
|
||||
#CONFIG_FST_TEST=y
|
||||
|
||||
# OS X builds. This is only for building eapol_test.
|
||||
#CONFIG_OSX=y
|
||||
|
||||
# Automatic Channel Selection
|
||||
# This will allow wpa_supplicant to pick the channel automatically when channel
|
||||
# is set to "0".
|
||||
#
|
||||
# TODO: Extend parser to be able to parse "channel=acs_survey" as an alternative
|
||||
# to "channel=0". This would enable us to eventually add other ACS algorithms in
|
||||
# similar way.
|
||||
#
|
||||
# Automatic selection is currently only done through initialization, later on
|
||||
# we hope to do background checks to keep us moving to more ideal channels as
|
||||
# time goes by. ACS is currently only supported through the nl80211 driver and
|
||||
# your driver must have survey dump capability that is filled by the driver
|
||||
# during scanning.
|
||||
#
|
||||
# TODO: In analogy to hostapd be able to customize the ACS survey algorithm with
|
||||
# a newly to create wpa_supplicant.conf variable acs_num_scans.
|
||||
#
|
||||
# Supported ACS drivers:
|
||||
# * ath9k
|
||||
# * ath5k
|
||||
# * ath10k
|
||||
#
|
||||
# For more details refer to:
|
||||
# http://wireless.kernel.org/en/users/Documentation/acs
|
||||
#CONFIG_ACS=y
|
||||
|
||||
# Support Multi Band Operation
|
||||
#CONFIG_MBO=y
|
||||
|
||||
# Fast Initial Link Setup (FILS) (IEEE 802.11ai)
|
||||
CONFIG_FILS=y
|
||||
# FILS shared key authentication with PFS
|
||||
#CONFIG_FILS_SK_PFS=y
|
||||
|
||||
# Support RSN on IBSS networks
|
||||
# This is needed to be able to use mode=1 network profile with proto=RSN and
|
||||
# key_mgmt=WPA-PSK (i.e., full key management instead of WPA-None).
|
||||
CONFIG_IBSS_RSN=y
|
||||
|
||||
# External PMKSA cache control
|
||||
# This can be used to enable control interface commands that allow the current
|
||||
# PMKSA cache entries to be fetched and new entries to be added.
|
||||
#CONFIG_PMKSA_CACHE_EXTERNAL=y
|
||||
|
||||
# Mesh Networking (IEEE 802.11s)
|
||||
#CONFIG_MESH=y
|
||||
|
||||
# Background scanning modules
|
||||
# These can be used to request wpa_supplicant to perform background scanning
|
||||
# operations for roaming within an ESS (same SSID). See the bgscan parameter in
|
||||
# the wpa_supplicant.conf file for more details.
|
||||
# Periodic background scans based on signal strength
|
||||
#CONFIG_BGSCAN_SIMPLE=y
|
||||
# Learn channels used by the network and try to avoid bgscans on other
|
||||
# channels (experimental)
|
||||
#CONFIG_BGSCAN_LEARN=y
|
||||
|
||||
# Opportunistic Wireless Encryption (OWE)
|
||||
# Experimental implementation of draft-harkins-owe-07.txt
|
||||
#CONFIG_OWE=y
|
||||
|
||||
# Device Provisioning Protocol (DPP)
|
||||
# This requires CONFIG_IEEE80211W=y to be enabled, too. (see
|
||||
# wpa_supplicant/README-DPP for details)
|
||||
#CONFIG_DPP=y
|
||||
|
||||
# uBus IPC/RPC System
|
||||
# Services can connect to the bus and provide methods
|
||||
# that can be called by other services or clients.
|
||||
CONFIG_UBUS=y
|
||||
|
||||
# OpenWrt patch 380-disable-ctrl-iface-mib.patch
|
||||
# leads to the MIB only being compiled in if
|
||||
# CONFIG_CTRL_IFACE_MIB is enabled.
|
||||
CONFIG_CTRL_IFACE_MIB=y
|
||||
@@ -1,16 +0,0 @@
|
||||
{
|
||||
"user": "network",
|
||||
"access": {
|
||||
"service": {
|
||||
"methods": [ "event" ]
|
||||
},
|
||||
"wpa_supplicant": {
|
||||
"methods": [ "phy_set_state", "phy_set_macaddr_list", "phy_status" ]
|
||||
},
|
||||
"hostapd": {
|
||||
"methods": [ "apsta_state" ]
|
||||
}
|
||||
},
|
||||
"publish": [ "hostapd", "hostapd.*", "wpa_supplicant", "wpa_supplicant.*" ],
|
||||
"send": [ "bss.*", "wps_credentials" ]
|
||||
}
|
||||
@@ -1,69 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
wps_catch_credentials() {
|
||||
local iface ifaces ifc ifname ssid encryption key radio radios
|
||||
local found=0
|
||||
|
||||
. /usr/share/libubox/jshn.sh
|
||||
ubus -S -t 30 listen wps_credentials | while read creds; do
|
||||
json_init
|
||||
json_load "$creds"
|
||||
json_select wps_credentials || continue
|
||||
json_get_vars ifname ssid key encryption
|
||||
local ifcname="$ifname"
|
||||
json_init
|
||||
json_load "$(ubus -S call network.wireless status)"
|
||||
json_get_keys radios
|
||||
for radio in $radios; do
|
||||
json_select $radio
|
||||
json_select interfaces
|
||||
json_get_keys ifaces
|
||||
for ifc in $ifaces; do
|
||||
json_select $ifc
|
||||
json_get_vars ifname
|
||||
[ "$ifname" = "$ifcname" ] && {
|
||||
ubus -S call uci set "{\"config\":\"wireless\", \"type\":\"wifi-iface\", \
|
||||
\"match\": { \"device\": \"$radio\", \"encryption\": \"wps\" }, \
|
||||
\"values\": { \"encryption\": \"$encryption\", \
|
||||
\"ssid\": \"$ssid\", \
|
||||
\"key\": \"$key\" } }"
|
||||
ubus -S call uci commit '{"config": "wireless"}'
|
||||
ubus -S call uci apply
|
||||
}
|
||||
json_select ..
|
||||
done
|
||||
json_select ..
|
||||
json_select ..
|
||||
done
|
||||
done
|
||||
}
|
||||
|
||||
if [ "$ACTION" = "released" ] && [ "$BUTTON" = "wps" ]; then
|
||||
# If the button was pressed for 3 seconds or more, trigger WPS on
|
||||
# wpa_supplicant only, no matter if hostapd is running or not. If
|
||||
# was pressed for less than 3 seconds, try triggering on
|
||||
# hostapd. If there is no hostapd instance to trigger it on or WPS
|
||||
# is not enabled on them, trigger it on wpa_supplicant.
|
||||
if [ "$SEEN" -lt 3 ] ; then
|
||||
wps_done=0
|
||||
ubusobjs="$( ubus -S list hostapd.* )"
|
||||
for ubusobj in $ubusobjs; do
|
||||
ubus -S call $ubusobj wps_start && wps_done=1
|
||||
done
|
||||
[ $wps_done = 0 ] || return 0
|
||||
fi
|
||||
wps_done=0
|
||||
ubusobjs="$( ubus -S list wpa_supplicant.* )"
|
||||
for ubusobj in $ubusobjs; do
|
||||
ifname="$(echo $ubusobj | cut -d'.' -f2 )"
|
||||
multi_ap=""
|
||||
if [ -e "/var/run/wpa_supplicant-${ifname}.conf.is_multiap" ]; then
|
||||
ubus -S call $ubusobj wps_start '{ "multi_ap": true }' && wps_done=1
|
||||
else
|
||||
ubus -S call $ubusobj wps_start && wps_done=1
|
||||
fi
|
||||
done
|
||||
[ $wps_done = 0 ] || wps_catch_credentials &
|
||||
fi
|
||||
|
||||
return 0
|
||||
@@ -1,135 +0,0 @@
|
||||
From 8de8cd8380af0c43d4fde67a668d79ef73b26b26 Mon Sep 17 00:00:00 2001
|
||||
From: Peter Oh <peter.oh@bowerswilkins.com>
|
||||
Date: Tue, 30 Jun 2020 14:18:58 +0200
|
||||
Subject: [PATCH 10/19] mesh: Allow DFS channels to be selected if dfs is
|
||||
enabled
|
||||
|
||||
Note: DFS is assumed to be usable if a country code has been set
|
||||
|
||||
Signed-off-by: Benjamin Berg <benjamin@sipsolutions.net>
|
||||
Signed-off-by: Peter Oh <peter.oh@bowerswilkins.com>
|
||||
---
|
||||
wpa_supplicant/wpa_supplicant.c | 25 +++++++++++++++++++------
|
||||
1 file changed, 19 insertions(+), 6 deletions(-)
|
||||
|
||||
--- a/wpa_supplicant/wpa_supplicant.c
|
||||
+++ b/wpa_supplicant/wpa_supplicant.c
|
||||
@@ -2638,7 +2638,7 @@ static int drv_supports_vht(struct wpa_s
|
||||
}
|
||||
|
||||
|
||||
-static bool ibss_mesh_is_80mhz_avail(int channel, struct hostapd_hw_modes *mode)
|
||||
+static bool ibss_mesh_is_80mhz_avail(int channel, struct hostapd_hw_modes *mode, bool dfs_enabled)
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -2647,7 +2647,10 @@ static bool ibss_mesh_is_80mhz_avail(int
|
||||
|
||||
chan = hw_get_channel_chan(mode, i, NULL);
|
||||
if (!chan ||
|
||||
- chan->flag & (HOSTAPD_CHAN_DISABLED | HOSTAPD_CHAN_NO_IR))
|
||||
+ chan->flag & HOSTAPD_CHAN_DISABLED)
|
||||
+ return false;
|
||||
+
|
||||
+ if (!dfs_enabled && chan->flag & (HOSTAPD_CHAN_RADAR | HOSTAPD_CHAN_NO_IR))
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -2774,7 +2777,7 @@ static void ibss_mesh_select_40mhz(struc
|
||||
const struct wpa_ssid *ssid,
|
||||
struct hostapd_hw_modes *mode,
|
||||
struct hostapd_freq_params *freq,
|
||||
- int obss_scan) {
|
||||
+ int obss_scan, bool dfs_enabled) {
|
||||
int chan_idx;
|
||||
struct hostapd_channel_data *pri_chan = NULL, *sec_chan = NULL;
|
||||
int i, res;
|
||||
@@ -2798,8 +2801,11 @@ static void ibss_mesh_select_40mhz(struc
|
||||
return;
|
||||
|
||||
/* Check primary channel flags */
|
||||
- if (pri_chan->flag & (HOSTAPD_CHAN_DISABLED | HOSTAPD_CHAN_NO_IR))
|
||||
+ if (pri_chan->flag & HOSTAPD_CHAN_DISABLED)
|
||||
return;
|
||||
+ if (pri_chan->flag & (HOSTAPD_CHAN_RADAR | HOSTAPD_CHAN_NO_IR))
|
||||
+ if (!dfs_enabled)
|
||||
+ return;
|
||||
|
||||
#ifdef CONFIG_HT_OVERRIDES
|
||||
if (ssid->disable_ht40)
|
||||
@@ -2825,8 +2831,11 @@ static void ibss_mesh_select_40mhz(struc
|
||||
return;
|
||||
|
||||
/* Check secondary channel flags */
|
||||
- if (sec_chan->flag & (HOSTAPD_CHAN_DISABLED | HOSTAPD_CHAN_NO_IR))
|
||||
+ if (sec_chan->flag & HOSTAPD_CHAN_DISABLED)
|
||||
return;
|
||||
+ if (sec_chan->flag & (HOSTAPD_CHAN_RADAR | HOSTAPD_CHAN_NO_IR))
|
||||
+ if (!dfs_enabled)
|
||||
+ return;
|
||||
|
||||
if (ht40 == -1) {
|
||||
if (!(pri_chan->flag & HOSTAPD_CHAN_HT40MINUS))
|
||||
@@ -2880,7 +2889,7 @@ static bool ibss_mesh_select_80_160mhz(s
|
||||
const struct wpa_ssid *ssid,
|
||||
struct hostapd_hw_modes *mode,
|
||||
struct hostapd_freq_params *freq,
|
||||
- int ieee80211_mode, bool is_6ghz) {
|
||||
+ int ieee80211_mode, bool is_6ghz, bool dfs_enabled) {
|
||||
static const int bw80[] = {
|
||||
5180, 5260, 5500, 5580, 5660, 5745, 5825,
|
||||
5955, 6035, 6115, 6195, 6275, 6355, 6435,
|
||||
@@ -2925,7 +2934,7 @@ static bool ibss_mesh_select_80_160mhz(s
|
||||
goto skip_80mhz;
|
||||
|
||||
/* Use 40 MHz if channel not usable */
|
||||
- if (!ibss_mesh_is_80mhz_avail(channel, mode))
|
||||
+ if (!ibss_mesh_is_80mhz_avail(channel, mode, dfs_enabled))
|
||||
goto skip_80mhz;
|
||||
|
||||
chwidth = CONF_OPER_CHWIDTH_80MHZ;
|
||||
@@ -2939,7 +2948,7 @@ static bool ibss_mesh_select_80_160mhz(s
|
||||
if ((mode->he_capab[ieee80211_mode].phy_cap[
|
||||
HE_PHYCAP_CHANNEL_WIDTH_SET_IDX] &
|
||||
HE_PHYCAP_CHANNEL_WIDTH_SET_160MHZ_IN_5G) && is_6ghz &&
|
||||
- ibss_mesh_is_80mhz_avail(channel + 16, mode)) {
|
||||
+ ibss_mesh_is_80mhz_avail(channel + 16, mode, dfs_enabled)) {
|
||||
for (j = 0; j < ARRAY_SIZE(bw160); j++) {
|
||||
if (freq->freq == bw160[j]) {
|
||||
chwidth = CONF_OPER_CHWIDTH_160MHZ;
|
||||
@@ -2967,10 +2976,12 @@ static bool ibss_mesh_select_80_160mhz(s
|
||||
if (!chan)
|
||||
continue;
|
||||
|
||||
- if (chan->flag & (HOSTAPD_CHAN_DISABLED |
|
||||
- HOSTAPD_CHAN_NO_IR |
|
||||
- HOSTAPD_CHAN_RADAR))
|
||||
+ if (chan->flag & HOSTAPD_CHAN_DISABLED)
|
||||
continue;
|
||||
+ if (chan->flag & (HOSTAPD_CHAN_RADAR |
|
||||
+ HOSTAPD_CHAN_NO_IR))
|
||||
+ if (!dfs_enabled)
|
||||
+ continue;
|
||||
|
||||
/* Found a suitable second segment for 80+80 */
|
||||
chwidth = CONF_OPER_CHWIDTH_80P80MHZ;
|
||||
@@ -3025,6 +3036,7 @@ void ibss_mesh_setup_freq(struct wpa_sup
|
||||
int i, obss_scan = 1;
|
||||
u8 channel;
|
||||
bool is_6ghz;
|
||||
+ bool dfs_enabled = wpa_s->conf->country[0] && (wpa_s->drv_flags & WPA_DRIVER_FLAGS_RADAR);
|
||||
|
||||
freq->freq = ssid->frequency;
|
||||
|
||||
@@ -3070,9 +3082,9 @@ void ibss_mesh_setup_freq(struct wpa_sup
|
||||
freq->channel = channel;
|
||||
/* Setup higher BW only for 5 GHz */
|
||||
if (mode->mode == HOSTAPD_MODE_IEEE80211A) {
|
||||
- ibss_mesh_select_40mhz(wpa_s, ssid, mode, freq, obss_scan);
|
||||
+ ibss_mesh_select_40mhz(wpa_s, ssid, mode, freq, obss_scan, dfs_enabled);
|
||||
if (!ibss_mesh_select_80_160mhz(wpa_s, ssid, mode, freq,
|
||||
- ieee80211_mode, is_6ghz))
|
||||
+ ieee80211_mode, is_6ghz, dfs_enabled))
|
||||
freq->he_enabled = freq->vht_enabled = false;
|
||||
}
|
||||
|
||||
@@ -1,81 +0,0 @@
|
||||
From fc8ea40f6130ac18d9c66797de2cf1d5af55d496 Mon Sep 17 00:00:00 2001
|
||||
From: Markus Theil <markus.theil@tu-ilmenau.de>
|
||||
Date: Tue, 30 Jun 2020 14:19:07 +0200
|
||||
Subject: [PATCH 19/19] mesh: use deterministic channel on channel switch
|
||||
|
||||
This patch uses a deterministic channel on DFS channel switch
|
||||
in mesh networks. Otherwise, when switching to a usable but not
|
||||
available channel, no CSA can be sent and a random channel is choosen
|
||||
without notification of other nodes. It is then quite likely, that
|
||||
the mesh network gets disconnected.
|
||||
|
||||
Fix this by using a deterministic number, based on the sha256 hash
|
||||
of the mesh ID, in order to use at least a different number in each
|
||||
mesh network.
|
||||
|
||||
Signed-off-by: Markus Theil <markus.theil@tu-ilmenau.de>
|
||||
---
|
||||
src/ap/dfs.c | 20 +++++++++++++++++++-
|
||||
src/drivers/driver_nl80211.c | 4 ++++
|
||||
2 files changed, 23 insertions(+), 1 deletion(-)
|
||||
|
||||
--- a/src/ap/dfs.c
|
||||
+++ b/src/ap/dfs.c
|
||||
@@ -17,6 +17,7 @@
|
||||
#include "ap_drv_ops.h"
|
||||
#include "drivers/driver.h"
|
||||
#include "dfs.h"
|
||||
+#include "crypto/crypto.h"
|
||||
|
||||
|
||||
enum dfs_channel_type {
|
||||
@@ -526,9 +527,14 @@ dfs_get_valid_channel(struct hostapd_ifa
|
||||
int num_available_chandefs;
|
||||
int chan_idx, chan_idx2;
|
||||
int sec_chan_idx_80p80 = -1;
|
||||
+ bool is_mesh = false;
|
||||
int i;
|
||||
u32 _rand;
|
||||
|
||||
+#ifdef CONFIG_MESH
|
||||
+ is_mesh = iface->mconf;
|
||||
+#endif
|
||||
+
|
||||
wpa_printf(MSG_DEBUG, "DFS: Selecting random channel");
|
||||
*secondary_channel = 0;
|
||||
*oper_centr_freq_seg0_idx = 0;
|
||||
@@ -548,8 +554,20 @@ dfs_get_valid_channel(struct hostapd_ifa
|
||||
if (num_available_chandefs == 0)
|
||||
return NULL;
|
||||
|
||||
- if (os_get_random((u8 *) &_rand, sizeof(_rand)) < 0)
|
||||
+ /* try to use deterministic channel in mesh, so that both sides
|
||||
+ * have a chance to switch to the same channel */
|
||||
+ if (is_mesh) {
|
||||
+#ifdef CONFIG_MESH
|
||||
+ u64 hash[4];
|
||||
+ const u8 *meshid[1] = { &iface->mconf->meshid[0] };
|
||||
+ const size_t meshid_len = iface->mconf->meshid_len;
|
||||
+
|
||||
+ sha256_vector(1, meshid, &meshid_len, (u8 *)&hash[0]);
|
||||
+ _rand = hash[0] + hash[1] + hash[2] + hash[3];
|
||||
+#endif
|
||||
+ } else if (os_get_random((u8 *) &_rand, sizeof(_rand)) < 0)
|
||||
return NULL;
|
||||
+
|
||||
chan_idx = _rand % num_available_chandefs;
|
||||
dfs_find_channel(iface, &chan, chan_idx, type);
|
||||
if (!chan) {
|
||||
--- a/src/drivers/driver_nl80211.c
|
||||
+++ b/src/drivers/driver_nl80211.c
|
||||
@@ -11017,6 +11017,10 @@ static int nl80211_switch_channel(void *
|
||||
if (ret)
|
||||
goto error;
|
||||
|
||||
+ if (drv->nlmode == NL80211_IFTYPE_MESH_POINT) {
|
||||
+ nla_put_flag(msg, NL80211_ATTR_HANDLE_DFS);
|
||||
+ }
|
||||
+
|
||||
/* beacon_csa params */
|
||||
beacon_csa = nla_nest_start(msg, NL80211_ATTR_CSA_IES);
|
||||
if (!beacon_csa)
|
||||
@@ -1,25 +0,0 @@
|
||||
From: Felix Fietkau <nbd@nbd.name>
|
||||
Date: Thu, 8 Jul 2021 16:33:03 +0200
|
||||
Subject: [PATCH] hostapd: fix use of uninitialized stack variables
|
||||
|
||||
When a CSA is performed on an 80 MHz channel, hostapd_change_config_freq
|
||||
unconditionally calls hostapd_set_oper_centr_freq_seg0/1_idx with seg0/1
|
||||
filled by ieee80211_freq_to_chan.
|
||||
However, if ieee80211_freq_to_chan fails (because the freq is 0 or invalid),
|
||||
seg0/1 remains uninitialized and filled with stack garbage, causing errors
|
||||
such as "hostapd: 80 MHz: center segment 1 configured"
|
||||
|
||||
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
---
|
||||
|
||||
--- a/src/ap/hostapd.c
|
||||
+++ b/src/ap/hostapd.c
|
||||
@@ -3764,7 +3764,7 @@ static int hostapd_change_config_freq(st
|
||||
struct hostapd_freq_params *old_params)
|
||||
{
|
||||
int channel;
|
||||
- u8 seg0, seg1;
|
||||
+ u8 seg0 = 0, seg1 = 0;
|
||||
struct hostapd_hw_modes *mode;
|
||||
|
||||
if (!params->channel) {
|
||||
@@ -1,275 +0,0 @@
|
||||
From: Felix Fietkau <nbd@nbd.name>
|
||||
Date: Wed, 28 Jul 2021 05:49:46 +0200
|
||||
Subject: [PATCH] driver_nl80211: rewrite neigh code to not depend on
|
||||
libnl3-route
|
||||
|
||||
Removes an unnecessary dependency and also makes the code smaller
|
||||
|
||||
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
---
|
||||
|
||||
--- a/src/drivers/driver_nl80211.c
|
||||
+++ b/src/drivers/driver_nl80211.c
|
||||
@@ -16,9 +16,6 @@
|
||||
#include <net/if.h>
|
||||
#include <netlink/genl/genl.h>
|
||||
#include <netlink/genl/ctrl.h>
|
||||
-#ifdef CONFIG_LIBNL3_ROUTE
|
||||
-#include <netlink/route/neighbour.h>
|
||||
-#endif /* CONFIG_LIBNL3_ROUTE */
|
||||
#include <linux/rtnetlink.h>
|
||||
#include <netpacket/packet.h>
|
||||
#include <linux/errqueue.h>
|
||||
@@ -5783,26 +5780,29 @@ fail:
|
||||
|
||||
static void rtnl_neigh_delete_fdb_entry(struct i802_bss *bss, const u8 *addr)
|
||||
{
|
||||
-#ifdef CONFIG_LIBNL3_ROUTE
|
||||
struct wpa_driver_nl80211_data *drv = bss->drv;
|
||||
- struct rtnl_neigh *rn;
|
||||
- struct nl_addr *nl_addr;
|
||||
+ struct ndmsg nhdr = {
|
||||
+ .ndm_state = NUD_PERMANENT,
|
||||
+ .ndm_ifindex = bss->ifindex,
|
||||
+ .ndm_family = AF_BRIDGE,
|
||||
+ };
|
||||
+ struct nl_msg *msg;
|
||||
int err;
|
||||
|
||||
- rn = rtnl_neigh_alloc();
|
||||
- if (!rn)
|
||||
+ msg = nlmsg_alloc_simple(RTM_DELNEIGH, NLM_F_CREATE);
|
||||
+ if (!msg)
|
||||
return;
|
||||
|
||||
- rtnl_neigh_set_family(rn, AF_BRIDGE);
|
||||
- rtnl_neigh_set_ifindex(rn, bss->ifindex);
|
||||
- nl_addr = nl_addr_build(AF_BRIDGE, (void *) addr, ETH_ALEN);
|
||||
- if (!nl_addr) {
|
||||
- rtnl_neigh_put(rn);
|
||||
- return;
|
||||
- }
|
||||
- rtnl_neigh_set_lladdr(rn, nl_addr);
|
||||
+ if (nlmsg_append(msg, &nhdr, sizeof(nhdr), NLMSG_ALIGNTO) < 0)
|
||||
+ goto errout;
|
||||
+
|
||||
+ if (nla_put(msg, NDA_LLADDR, ETH_ALEN, (void *)addr))
|
||||
+ goto errout;
|
||||
+
|
||||
+ if (nl_send_auto_complete(drv->rtnl_sk, msg) < 0)
|
||||
+ goto errout;
|
||||
|
||||
- err = rtnl_neigh_delete(drv->rtnl_sk, rn, 0);
|
||||
+ err = nl_wait_for_ack(drv->rtnl_sk);
|
||||
if (err < 0) {
|
||||
wpa_printf(MSG_DEBUG, "nl80211: bridge FDB entry delete for "
|
||||
MACSTR " ifindex=%d failed: %s", MAC2STR(addr),
|
||||
@@ -5812,9 +5812,8 @@ static void rtnl_neigh_delete_fdb_entry(
|
||||
MACSTR, MAC2STR(addr));
|
||||
}
|
||||
|
||||
- nl_addr_put(nl_addr);
|
||||
- rtnl_neigh_put(rn);
|
||||
-#endif /* CONFIG_LIBNL3_ROUTE */
|
||||
+errout:
|
||||
+ nlmsg_free(msg);
|
||||
}
|
||||
|
||||
|
||||
@@ -8492,7 +8491,6 @@ static void *i802_init(struct hostapd_da
|
||||
(params->num_bridge == 0 || !params->bridge[0]))
|
||||
add_ifidx(drv, br_ifindex, drv->ifindex);
|
||||
|
||||
-#ifdef CONFIG_LIBNL3_ROUTE
|
||||
if (bss->added_if_into_bridge || bss->already_in_bridge) {
|
||||
int err;
|
||||
|
||||
@@ -8509,7 +8507,6 @@ static void *i802_init(struct hostapd_da
|
||||
goto failed;
|
||||
}
|
||||
}
|
||||
-#endif /* CONFIG_LIBNL3_ROUTE */
|
||||
|
||||
if (drv->capa.flags2 & WPA_DRIVER_FLAGS2_CONTROL_PORT_RX) {
|
||||
wpa_printf(MSG_DEBUG,
|
||||
@@ -11883,13 +11880,14 @@ static int wpa_driver_br_add_ip_neigh(vo
|
||||
const u8 *ipaddr, int prefixlen,
|
||||
const u8 *addr)
|
||||
{
|
||||
-#ifdef CONFIG_LIBNL3_ROUTE
|
||||
struct i802_bss *bss = priv;
|
||||
struct wpa_driver_nl80211_data *drv = bss->drv;
|
||||
- struct rtnl_neigh *rn;
|
||||
- struct nl_addr *nl_ipaddr = NULL;
|
||||
- struct nl_addr *nl_lladdr = NULL;
|
||||
- int family, addrsize;
|
||||
+ struct ndmsg nhdr = {
|
||||
+ .ndm_state = NUD_PERMANENT,
|
||||
+ .ndm_ifindex = bss->br_ifindex,
|
||||
+ };
|
||||
+ struct nl_msg *msg;
|
||||
+ int addrsize;
|
||||
int res;
|
||||
|
||||
if (!ipaddr || prefixlen == 0 || !addr)
|
||||
@@ -11908,85 +11906,66 @@ static int wpa_driver_br_add_ip_neigh(vo
|
||||
}
|
||||
|
||||
if (version == 4) {
|
||||
- family = AF_INET;
|
||||
+ nhdr.ndm_family = AF_INET;
|
||||
addrsize = 4;
|
||||
} else if (version == 6) {
|
||||
- family = AF_INET6;
|
||||
+ nhdr.ndm_family = AF_INET6;
|
||||
addrsize = 16;
|
||||
} else {
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
- rn = rtnl_neigh_alloc();
|
||||
- if (rn == NULL)
|
||||
+ msg = nlmsg_alloc_simple(RTM_NEWNEIGH, NLM_F_CREATE);
|
||||
+ if (!msg)
|
||||
return -ENOMEM;
|
||||
|
||||
- /* set the destination ip address for neigh */
|
||||
- nl_ipaddr = nl_addr_build(family, (void *) ipaddr, addrsize);
|
||||
- if (nl_ipaddr == NULL) {
|
||||
- wpa_printf(MSG_DEBUG, "nl80211: nl_ipaddr build failed");
|
||||
- res = -ENOMEM;
|
||||
+ res = -ENOMEM;
|
||||
+ if (nlmsg_append(msg, &nhdr, sizeof(nhdr), NLMSG_ALIGNTO) < 0)
|
||||
goto errout;
|
||||
- }
|
||||
- nl_addr_set_prefixlen(nl_ipaddr, prefixlen);
|
||||
- res = rtnl_neigh_set_dst(rn, nl_ipaddr);
|
||||
- if (res) {
|
||||
- wpa_printf(MSG_DEBUG,
|
||||
- "nl80211: neigh set destination addr failed");
|
||||
+
|
||||
+ if (nla_put(msg, NDA_DST, addrsize, (void *)ipaddr))
|
||||
goto errout;
|
||||
- }
|
||||
|
||||
- /* set the corresponding lladdr for neigh */
|
||||
- nl_lladdr = nl_addr_build(AF_BRIDGE, (u8 *) addr, ETH_ALEN);
|
||||
- if (nl_lladdr == NULL) {
|
||||
- wpa_printf(MSG_DEBUG, "nl80211: neigh set lladdr failed");
|
||||
- res = -ENOMEM;
|
||||
+ if (nla_put(msg, NDA_LLADDR, ETH_ALEN, (void *)addr))
|
||||
goto errout;
|
||||
- }
|
||||
- rtnl_neigh_set_lladdr(rn, nl_lladdr);
|
||||
|
||||
- rtnl_neigh_set_ifindex(rn, bss->br_ifindex);
|
||||
- rtnl_neigh_set_state(rn, NUD_PERMANENT);
|
||||
+ res = nl_send_auto_complete(drv->rtnl_sk, msg);
|
||||
+ if (res < 0)
|
||||
+ goto errout;
|
||||
|
||||
- res = rtnl_neigh_add(drv->rtnl_sk, rn, NLM_F_CREATE);
|
||||
+ res = nl_wait_for_ack(drv->rtnl_sk);
|
||||
if (res) {
|
||||
wpa_printf(MSG_DEBUG,
|
||||
"nl80211: Adding bridge ip neigh failed: %s",
|
||||
nl_geterror(res));
|
||||
}
|
||||
errout:
|
||||
- if (nl_lladdr)
|
||||
- nl_addr_put(nl_lladdr);
|
||||
- if (nl_ipaddr)
|
||||
- nl_addr_put(nl_ipaddr);
|
||||
- if (rn)
|
||||
- rtnl_neigh_put(rn);
|
||||
+ nlmsg_free(msg);
|
||||
return res;
|
||||
-#else /* CONFIG_LIBNL3_ROUTE */
|
||||
- return -1;
|
||||
-#endif /* CONFIG_LIBNL3_ROUTE */
|
||||
}
|
||||
|
||||
|
||||
static int wpa_driver_br_delete_ip_neigh(void *priv, u8 version,
|
||||
const u8 *ipaddr)
|
||||
{
|
||||
-#ifdef CONFIG_LIBNL3_ROUTE
|
||||
struct i802_bss *bss = priv;
|
||||
struct wpa_driver_nl80211_data *drv = bss->drv;
|
||||
- struct rtnl_neigh *rn;
|
||||
- struct nl_addr *nl_ipaddr;
|
||||
- int family, addrsize;
|
||||
+ struct ndmsg nhdr = {
|
||||
+ .ndm_state = NUD_PERMANENT,
|
||||
+ .ndm_ifindex = bss->br_ifindex,
|
||||
+ };
|
||||
+ struct nl_msg *msg;
|
||||
+ int addrsize;
|
||||
int res;
|
||||
|
||||
if (!ipaddr)
|
||||
return -EINVAL;
|
||||
|
||||
if (version == 4) {
|
||||
- family = AF_INET;
|
||||
+ nhdr.ndm_family = AF_INET;
|
||||
addrsize = 4;
|
||||
} else if (version == 6) {
|
||||
- family = AF_INET6;
|
||||
+ nhdr.ndm_family = AF_INET6;
|
||||
addrsize = 16;
|
||||
} else {
|
||||
return -EINVAL;
|
||||
@@ -12004,41 +11983,30 @@ static int wpa_driver_br_delete_ip_neigh
|
||||
return -1;
|
||||
}
|
||||
|
||||
- rn = rtnl_neigh_alloc();
|
||||
- if (rn == NULL)
|
||||
+ msg = nlmsg_alloc_simple(RTM_DELNEIGH, NLM_F_CREATE);
|
||||
+ if (!msg)
|
||||
return -ENOMEM;
|
||||
|
||||
- /* set the destination ip address for neigh */
|
||||
- nl_ipaddr = nl_addr_build(family, (void *) ipaddr, addrsize);
|
||||
- if (nl_ipaddr == NULL) {
|
||||
- wpa_printf(MSG_DEBUG, "nl80211: nl_ipaddr build failed");
|
||||
- res = -ENOMEM;
|
||||
+ res = -ENOMEM;
|
||||
+ if (nlmsg_append(msg, &nhdr, sizeof(nhdr), NLMSG_ALIGNTO) < 0)
|
||||
goto errout;
|
||||
- }
|
||||
- res = rtnl_neigh_set_dst(rn, nl_ipaddr);
|
||||
- if (res) {
|
||||
- wpa_printf(MSG_DEBUG,
|
||||
- "nl80211: neigh set destination addr failed");
|
||||
+
|
||||
+ if (nla_put(msg, NDA_DST, addrsize, (void *)ipaddr))
|
||||
goto errout;
|
||||
- }
|
||||
|
||||
- rtnl_neigh_set_ifindex(rn, bss->br_ifindex);
|
||||
+ res = nl_send_auto_complete(drv->rtnl_sk, msg);
|
||||
+ if (res < 0)
|
||||
+ goto errout;
|
||||
|
||||
- res = rtnl_neigh_delete(drv->rtnl_sk, rn, 0);
|
||||
+ res = nl_wait_for_ack(drv->rtnl_sk);
|
||||
if (res) {
|
||||
wpa_printf(MSG_DEBUG,
|
||||
"nl80211: Deleting bridge ip neigh failed: %s",
|
||||
nl_geterror(res));
|
||||
}
|
||||
errout:
|
||||
- if (nl_ipaddr)
|
||||
- nl_addr_put(nl_ipaddr);
|
||||
- if (rn)
|
||||
- rtnl_neigh_put(rn);
|
||||
+ nlmsg_free(msg);
|
||||
return res;
|
||||
-#else /* CONFIG_LIBNL3_ROUTE */
|
||||
- return -1;
|
||||
-#endif /* CONFIG_LIBNL3_ROUTE */
|
||||
}
|
||||
|
||||
|
||||
@@ -1,34 +0,0 @@
|
||||
From: Felix Fietkau <nbd@nbd.name>
|
||||
Date: Mon, 18 Feb 2019 12:57:11 +0100
|
||||
Subject: [PATCH] mesh: allow processing authentication frames in blocked state
|
||||
|
||||
If authentication fails repeatedly e.g. because of a weak signal, the link
|
||||
can end up in blocked state. If one of the nodes tries to establish a link
|
||||
again before it is unblocked on the other side, it will block the link to
|
||||
that other side. The same happens on the other side when it unblocks the
|
||||
link. In that scenario, the link never recovers on its own.
|
||||
|
||||
To fix this, allow restarting authentication even if the link is in blocked
|
||||
state, but don't initiate the attempt until the blocked period is over.
|
||||
|
||||
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
---
|
||||
|
||||
--- a/src/ap/ieee802_11.c
|
||||
+++ b/src/ap/ieee802_11.c
|
||||
@@ -3020,15 +3020,6 @@ static void handle_auth(struct hostapd_d
|
||||
seq_ctrl);
|
||||
return;
|
||||
}
|
||||
-#ifdef CONFIG_MESH
|
||||
- if ((hapd->conf->mesh & MESH_ENABLED) &&
|
||||
- sta->plink_state == PLINK_BLOCKED) {
|
||||
- wpa_printf(MSG_DEBUG, "Mesh peer " MACSTR
|
||||
- " is blocked - drop Authentication frame",
|
||||
- MAC2STR(sa));
|
||||
- return;
|
||||
- }
|
||||
-#endif /* CONFIG_MESH */
|
||||
#ifdef CONFIG_PASN
|
||||
if (auth_alg == WLAN_AUTH_PASN &&
|
||||
(sta->flags & WLAN_STA_ASSOC)) {
|
||||
@@ -1,141 +0,0 @@
|
||||
From d4c4ef302f98fd6bce173b8636e7e350d8b44981 Mon Sep 17 00:00:00 2001
|
||||
From: P Praneesh <ppranees@codeaurora.org>
|
||||
Date: Fri, 19 Mar 2021 12:17:27 +0530
|
||||
Subject: [PATCH] hostapd: update cfs0 and cfs1 for 160MHz
|
||||
|
||||
As per standard Draft P802.11ax_D8.0,( Table 26-9—Setting
|
||||
of the VHT Channel Width and VHT NSS at an HE STA
|
||||
transmitting the OM Control subfield ), center frequency of
|
||||
160MHz should be published in HT information subset 2 of
|
||||
HT information when EXT NSS BW field is enabled.
|
||||
|
||||
If the supported number of NSS in 160MHz is at least max NSS
|
||||
support, then center_freq_seg0 indicates the center frequency of 80MHz and
|
||||
center_freq_seg1 indicates the center frequency of 160MHz.
|
||||
|
||||
If the supported number of NSS in 160MHz is less than max NSS
|
||||
support, then center_freq_seg0 indicates the center frequency of 80MHz and
|
||||
center_freq_seg1 is 0. The center frequency of 160MHz is published in HT
|
||||
operation information element instead.
|
||||
|
||||
Signed-off-by: P Praneesh <ppranees@codeaurora.org>
|
||||
---
|
||||
hostapd/config_file.c | 2 ++
|
||||
src/ap/ieee802_11_ht.c | 7 +++++++
|
||||
src/ap/ieee802_11_vht.c | 16 ++++++++++++++++
|
||||
src/common/hw_features_common.c | 1 +
|
||||
src/common/ieee802_11_defs.h | 1 +
|
||||
5 files changed, 27 insertions(+)
|
||||
|
||||
--- a/hostapd/config_file.c
|
||||
+++ b/hostapd/config_file.c
|
||||
@@ -1153,6 +1153,8 @@ static int hostapd_config_vht_capab(stru
|
||||
conf->vht_capab |= VHT_CAP_RX_ANTENNA_PATTERN;
|
||||
if (os_strstr(capab, "[TX-ANTENNA-PATTERN]"))
|
||||
conf->vht_capab |= VHT_CAP_TX_ANTENNA_PATTERN;
|
||||
+ if (os_strstr(capab, "[EXT-NSS-BW-SUPP]"))
|
||||
+ conf->vht_capab |= VHT_CAP_EXTENDED_NSS_BW_SUPPORT;
|
||||
return 0;
|
||||
}
|
||||
#endif /* CONFIG_IEEE80211AC */
|
||||
--- a/src/ap/ieee802_11_ht.c
|
||||
+++ b/src/ap/ieee802_11_ht.c
|
||||
@@ -82,7 +82,9 @@ u8 * hostapd_eid_ht_capabilities(struct
|
||||
u8 * hostapd_eid_ht_operation(struct hostapd_data *hapd, u8 *eid)
|
||||
{
|
||||
struct ieee80211_ht_operation *oper;
|
||||
+ le32 vht_capabilities_info;
|
||||
u8 *pos = eid;
|
||||
+ u8 chwidth;
|
||||
|
||||
if (!hapd->iconf->ieee80211n || hapd->conf->disable_11n ||
|
||||
is_6ghz_op_class(hapd->iconf->op_class))
|
||||
@@ -103,6 +105,13 @@ u8 * hostapd_eid_ht_operation(struct hos
|
||||
oper->ht_param |= HT_INFO_HT_PARAM_SECONDARY_CHNL_BELOW |
|
||||
HT_INFO_HT_PARAM_STA_CHNL_WIDTH;
|
||||
|
||||
+ vht_capabilities_info = host_to_le32(hapd->iface->current_mode->vht_capab);
|
||||
+ chwidth = hostapd_get_oper_chwidth(hapd->iconf);
|
||||
+ if (vht_capabilities_info & VHT_CAP_EXTENDED_NSS_BW_SUPPORT
|
||||
+ && ((chwidth == CHANWIDTH_160MHZ) || (chwidth == CHANWIDTH_80P80MHZ))) {
|
||||
+ oper->operation_mode = host_to_le16(hapd->iconf->vht_oper_centr_freq_seg0_idx << 5);
|
||||
+ }
|
||||
+
|
||||
pos += sizeof(*oper);
|
||||
|
||||
return pos;
|
||||
--- a/src/ap/ieee802_11_vht.c
|
||||
+++ b/src/ap/ieee802_11_vht.c
|
||||
@@ -25,6 +25,7 @@ u8 * hostapd_eid_vht_capabilities(struct
|
||||
struct ieee80211_vht_capabilities *cap;
|
||||
struct hostapd_hw_modes *mode = hapd->iface->current_mode;
|
||||
u8 *pos = eid;
|
||||
+ u8 chwidth;
|
||||
|
||||
if (!mode || is_6ghz_op_class(hapd->iconf->op_class))
|
||||
return eid;
|
||||
@@ -62,6 +63,17 @@ u8 * hostapd_eid_vht_capabilities(struct
|
||||
host_to_le32(nsts << VHT_CAP_BEAMFORMEE_STS_OFFSET);
|
||||
}
|
||||
|
||||
+ chwidth = hostapd_get_oper_chwidth(hapd->iconf);
|
||||
+ if (((host_to_le32(mode->vht_capab)) & VHT_CAP_EXTENDED_NSS_BW_SUPPORT)
|
||||
+ && ((chwidth == CHANWIDTH_160MHZ) || (chwidth == CHANWIDTH_80P80MHZ))) {
|
||||
+ cap->vht_capabilities_info |= VHT_CAP_EXTENDED_NSS_BW_SUPPORT;
|
||||
+ cap->vht_capabilities_info &= ~(host_to_le32(VHT_CAP_SUPP_CHAN_WIDTH_160_80PLUS80MHZ));
|
||||
+ cap->vht_capabilities_info &= ~(host_to_le32(VHT_CAP_SUPP_CHAN_WIDTH_160MHZ));
|
||||
+ cap->vht_capabilities_info &= ~(host_to_le32(VHT_CAP_SUPP_CHAN_WIDTH_MASK));
|
||||
+ } else {
|
||||
+ cap->vht_capabilities_info &= ~VHT_CAP_EXTENDED_NSS_BW_SUPPORT_MASK;
|
||||
+ }
|
||||
+
|
||||
/* Supported MCS set comes from hw */
|
||||
os_memcpy(&cap->vht_supported_mcs_set, mode->vht_mcs_set, 8);
|
||||
|
||||
@@ -74,6 +86,7 @@ u8 * hostapd_eid_vht_capabilities(struct
|
||||
u8 * hostapd_eid_vht_operation(struct hostapd_data *hapd, u8 *eid)
|
||||
{
|
||||
struct ieee80211_vht_operation *oper;
|
||||
+ le32 vht_capabilities_info;
|
||||
u8 *pos = eid;
|
||||
enum oper_chan_width oper_chwidth =
|
||||
hostapd_get_oper_chwidth(hapd->iconf);
|
||||
@@ -106,6 +119,7 @@ u8 * hostapd_eid_vht_operation(struct ho
|
||||
oper->vht_op_info_chan_center_freq_seg1_idx = seg1;
|
||||
|
||||
oper->vht_op_info_chwidth = oper_chwidth;
|
||||
+ vht_capabilities_info = host_to_le32(hapd->iface->current_mode->vht_capab);
|
||||
if (oper_chwidth == CONF_OPER_CHWIDTH_160MHZ) {
|
||||
/*
|
||||
* Convert 160 MHz channel width to new style as interop
|
||||
@@ -119,6 +133,9 @@ u8 * hostapd_eid_vht_operation(struct ho
|
||||
oper->vht_op_info_chan_center_freq_seg0_idx -= 8;
|
||||
else
|
||||
oper->vht_op_info_chan_center_freq_seg0_idx += 8;
|
||||
+
|
||||
+ if (vht_capabilities_info & VHT_CAP_EXTENDED_NSS_BW_SUPPORT)
|
||||
+ oper->vht_op_info_chan_center_freq_seg1_idx = 0;
|
||||
} else if (oper_chwidth == CONF_OPER_CHWIDTH_80P80MHZ) {
|
||||
/*
|
||||
* Convert 80+80 MHz channel width to new style as interop
|
||||
--- a/src/common/hw_features_common.c
|
||||
+++ b/src/common/hw_features_common.c
|
||||
@@ -811,6 +811,7 @@ int ieee80211ac_cap_check(u32 hw, u32 co
|
||||
VHT_CAP_CHECK(VHT_CAP_VHT_LINK_ADAPTATION_VHT_MRQ_MFB);
|
||||
VHT_CAP_CHECK(VHT_CAP_RX_ANTENNA_PATTERN);
|
||||
VHT_CAP_CHECK(VHT_CAP_TX_ANTENNA_PATTERN);
|
||||
+ VHT_CAP_CHECK(VHT_CAP_EXTENDED_NSS_BW_SUPPORT);
|
||||
|
||||
#undef VHT_CAP_CHECK
|
||||
#undef VHT_CAP_CHECK_MAX
|
||||
--- a/src/common/ieee802_11_defs.h
|
||||
+++ b/src/common/ieee802_11_defs.h
|
||||
@@ -1349,6 +1349,8 @@ struct ieee80211_ampe_ie {
|
||||
#define VHT_CAP_VHT_LINK_ADAPTATION_VHT_MRQ_MFB ((u32) BIT(26) | BIT(27))
|
||||
#define VHT_CAP_RX_ANTENNA_PATTERN ((u32) BIT(28))
|
||||
#define VHT_CAP_TX_ANTENNA_PATTERN ((u32) BIT(29))
|
||||
+#define VHT_CAP_EXTENDED_NSS_BW_SUPPORT ((u32) BIT(30))
|
||||
+#define VHT_CAP_EXTENDED_NSS_BW_SUPPORT_MASK ((u32) BIT(30) | BIT(31))
|
||||
|
||||
#define VHT_OPMODE_CHANNEL_WIDTH_MASK ((u8) BIT(0) | BIT(1))
|
||||
#define VHT_OPMODE_CHANNEL_RxNSS_MASK ((u8) BIT(4) | BIT(5) | \
|
||||
@@ -1,71 +0,0 @@
|
||||
--- a/wpa_supplicant/config.c
|
||||
+++ b/wpa_supplicant/config.c
|
||||
@@ -2600,6 +2600,7 @@ static const struct parse_data ssid_fiel
|
||||
#else /* CONFIG_MESH */
|
||||
{ INT_RANGE(mode, 0, 4) },
|
||||
#endif /* CONFIG_MESH */
|
||||
+ { INT_RANGE(noscan, 0, 1) },
|
||||
{ INT_RANGE(proactive_key_caching, 0, 1) },
|
||||
{ INT_RANGE(disabled, 0, 2) },
|
||||
{ STR(id_str) },
|
||||
--- a/wpa_supplicant/config_file.c
|
||||
+++ b/wpa_supplicant/config_file.c
|
||||
@@ -775,6 +775,7 @@ static void wpa_config_write_network(FIL
|
||||
#endif /* IEEE8021X_EAPOL */
|
||||
INT(mode);
|
||||
INT(no_auto_peer);
|
||||
+ INT(noscan);
|
||||
INT(mesh_fwding);
|
||||
INT(frequency);
|
||||
INT(enable_edmg);
|
||||
--- a/wpa_supplicant/mesh.c
|
||||
+++ b/wpa_supplicant/mesh.c
|
||||
@@ -506,6 +506,8 @@ static int wpa_supplicant_mesh_init(stru
|
||||
frequency);
|
||||
goto out_free;
|
||||
}
|
||||
+ if (ssid->noscan)
|
||||
+ conf->noscan = 1;
|
||||
|
||||
if (ssid->mesh_basic_rates == NULL) {
|
||||
/*
|
||||
--- a/wpa_supplicant/wpa_supplicant.c
|
||||
+++ b/wpa_supplicant/wpa_supplicant.c
|
||||
@@ -2710,7 +2710,7 @@ static bool ibss_mesh_can_use_vht(struct
|
||||
const struct wpa_ssid *ssid,
|
||||
struct hostapd_hw_modes *mode)
|
||||
{
|
||||
- if (mode->mode != HOSTAPD_MODE_IEEE80211A)
|
||||
+ if (mode->mode != HOSTAPD_MODE_IEEE80211A && !(ssid->noscan))
|
||||
return false;
|
||||
|
||||
if (!drv_supports_vht(wpa_s, ssid))
|
||||
@@ -2783,7 +2783,7 @@ static void ibss_mesh_select_40mhz(struc
|
||||
int i, res;
|
||||
unsigned int j;
|
||||
static const int ht40plus[] = {
|
||||
- 36, 44, 52, 60, 100, 108, 116, 124, 132, 149, 157, 165, 173,
|
||||
+ 1, 2, 3, 4, 5, 6, 36, 44, 52, 60, 100, 108, 116, 124, 132, 149, 157, 165, 173,
|
||||
184, 192
|
||||
};
|
||||
int ht40 = -1;
|
||||
@@ -3033,7 +3033,7 @@ void ibss_mesh_setup_freq(struct wpa_sup
|
||||
int ieee80211_mode = wpas_mode_to_ieee80211_mode(ssid->mode);
|
||||
enum hostapd_hw_mode hw_mode;
|
||||
struct hostapd_hw_modes *mode = NULL;
|
||||
- int i, obss_scan = 1;
|
||||
+ int i, obss_scan = !(ssid->noscan);
|
||||
u8 channel;
|
||||
bool is_6ghz;
|
||||
bool dfs_enabled = wpa_s->conf->country[0] && (wpa_s->drv_flags & WPA_DRIVER_FLAGS_RADAR);
|
||||
--- a/wpa_supplicant/config_ssid.h
|
||||
+++ b/wpa_supplicant/config_ssid.h
|
||||
@@ -1035,6 +1035,8 @@ struct wpa_ssid {
|
||||
*/
|
||||
int no_auto_peer;
|
||||
|
||||
+ int noscan;
|
||||
+
|
||||
/**
|
||||
* mesh_rssi_threshold - Set mesh parameter mesh_rssi_threshold (dBm)
|
||||
*
|
||||
@@ -1,11 +0,0 @@
|
||||
--- a/wpa_supplicant/wpa_supplicant.c
|
||||
+++ b/wpa_supplicant/wpa_supplicant.c
|
||||
@@ -5767,7 +5767,7 @@ wpa_supplicant_alloc(struct wpa_supplica
|
||||
if (wpa_s == NULL)
|
||||
return NULL;
|
||||
wpa_s->scan_req = INITIAL_SCAN_REQ;
|
||||
- wpa_s->scan_interval = 5;
|
||||
+ wpa_s->scan_interval = 1;
|
||||
wpa_s->new_connection = 1;
|
||||
wpa_s->parent = parent ? parent : wpa_s;
|
||||
wpa_s->p2pdev = wpa_s->parent;
|
||||
@@ -1,39 +0,0 @@
|
||||
--- a/wpa_supplicant/ap.c
|
||||
+++ b/wpa_supplicant/ap.c
|
||||
@@ -1825,15 +1825,35 @@ int ap_switch_channel(struct wpa_supplic
|
||||
|
||||
|
||||
#ifdef CONFIG_CTRL_IFACE
|
||||
+
|
||||
+static int __ap_ctrl_iface_chanswitch(struct hostapd_iface *iface,
|
||||
+ struct csa_settings *settings)
|
||||
+{
|
||||
+#ifdef NEED_AP_MLME
|
||||
+ if (!iface || !iface->bss[0])
|
||||
+ return 0;
|
||||
+
|
||||
+ return hostapd_switch_channel(iface->bss[0], settings);
|
||||
+#else
|
||||
+ return -1;
|
||||
+#endif
|
||||
+}
|
||||
+
|
||||
+
|
||||
int ap_ctrl_iface_chanswitch(struct wpa_supplicant *wpa_s, const char *pos)
|
||||
{
|
||||
struct csa_settings settings;
|
||||
int ret = hostapd_parse_csa_settings(pos, &settings);
|
||||
|
||||
+ if (!(wpa_s->ap_iface && wpa_s->ap_iface->bss[0]) &&
|
||||
+ !(wpa_s->ifmsh && wpa_s->ifmsh->bss[0]))
|
||||
+ return -1;
|
||||
+
|
||||
+ ret = __ap_ctrl_iface_chanswitch(wpa_s->ap_iface, &settings);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
- return ap_switch_channel(wpa_s, &settings);
|
||||
+ return __ap_ctrl_iface_chanswitch(wpa_s->ifmsh, &settings);
|
||||
}
|
||||
#endif /* CONFIG_CTRL_IFACE */
|
||||
|
||||
@@ -1,35 +0,0 @@
|
||||
--- a/src/drivers/driver_nl80211.c
|
||||
+++ b/src/drivers/driver_nl80211.c
|
||||
@@ -3008,12 +3008,12 @@ static int wpa_driver_nl80211_del_beacon
|
||||
return 0;
|
||||
|
||||
wpa_printf(MSG_DEBUG, "nl80211: Remove beacon (ifindex=%d)",
|
||||
- drv->ifindex);
|
||||
+ bss->ifindex);
|
||||
link->beacon_set = 0;
|
||||
link->freq = 0;
|
||||
|
||||
nl80211_put_wiphy_data_ap(bss);
|
||||
- msg = nl80211_drv_msg(drv, 0, NL80211_CMD_DEL_BEACON);
|
||||
+ msg = nl80211_bss_msg(bss, 0, NL80211_CMD_DEL_BEACON);
|
||||
if (!msg)
|
||||
return -ENOBUFS;
|
||||
|
||||
@@ -6100,7 +6100,7 @@ static void nl80211_teardown_ap(struct i
|
||||
nl80211_mgmt_unsubscribe(bss, "AP teardown");
|
||||
|
||||
nl80211_put_wiphy_data_ap(bss);
|
||||
- bss->flink->beacon_set = 0;
|
||||
+ wpa_driver_nl80211_del_beacon_all(bss);
|
||||
}
|
||||
|
||||
|
||||
@@ -8859,8 +8859,6 @@ static int wpa_driver_nl80211_if_remove(
|
||||
} else {
|
||||
wpa_printf(MSG_DEBUG, "nl80211: First BSS - reassign context");
|
||||
nl80211_teardown_ap(bss);
|
||||
- if (!bss->added_if && !drv->first_bss->next)
|
||||
- wpa_driver_nl80211_del_beacon_all(bss);
|
||||
nl80211_destroy_bss(bss);
|
||||
if (!bss->added_if)
|
||||
i802_set_iface_flags(bss, 0);
|
||||
@@ -1,239 +0,0 @@
|
||||
--- a/hostapd/Makefile
|
||||
+++ b/hostapd/Makefile
|
||||
@@ -221,6 +221,9 @@ endif
|
||||
ifdef CONFIG_NO_CTRL_IFACE
|
||||
CFLAGS += -DCONFIG_NO_CTRL_IFACE
|
||||
else
|
||||
+ifdef CONFIG_CTRL_IFACE_MIB
|
||||
+CFLAGS += -DCONFIG_CTRL_IFACE_MIB
|
||||
+endif
|
||||
ifeq ($(CONFIG_CTRL_IFACE), udp)
|
||||
CFLAGS += -DCONFIG_CTRL_IFACE_UDP
|
||||
else
|
||||
--- a/hostapd/ctrl_iface.c
|
||||
+++ b/hostapd/ctrl_iface.c
|
||||
@@ -3314,6 +3314,7 @@ static int hostapd_ctrl_iface_receive_pr
|
||||
reply_size);
|
||||
} else if (os_strcmp(buf, "STATUS-DRIVER") == 0) {
|
||||
reply_len = hostapd_drv_status(hapd, reply, reply_size);
|
||||
+#ifdef CONFIG_CTRL_IFACE_MIB
|
||||
} else if (os_strcmp(buf, "MIB") == 0) {
|
||||
reply_len = ieee802_11_get_mib(hapd, reply, reply_size);
|
||||
if (reply_len >= 0) {
|
||||
@@ -3355,6 +3356,7 @@ static int hostapd_ctrl_iface_receive_pr
|
||||
} else if (os_strncmp(buf, "STA-NEXT ", 9) == 0) {
|
||||
reply_len = hostapd_ctrl_iface_sta_next(hapd, buf + 9, reply,
|
||||
reply_size);
|
||||
+#endif
|
||||
} else if (os_strcmp(buf, "ATTACH") == 0) {
|
||||
if (hostapd_ctrl_iface_attach(hapd, from, fromlen, NULL))
|
||||
reply_len = -1;
|
||||
--- a/wpa_supplicant/Makefile
|
||||
+++ b/wpa_supplicant/Makefile
|
||||
@@ -983,6 +983,9 @@ ifdef CONFIG_FILS
|
||||
OBJS += ../src/ap/fils_hlp.o
|
||||
endif
|
||||
ifdef CONFIG_CTRL_IFACE
|
||||
+ifdef CONFIG_CTRL_IFACE_MIB
|
||||
+CFLAGS += -DCONFIG_CTRL_IFACE_MIB
|
||||
+endif
|
||||
OBJS += ../src/ap/ctrl_iface_ap.o
|
||||
endif
|
||||
|
||||
--- a/wpa_supplicant/ctrl_iface.c
|
||||
+++ b/wpa_supplicant/ctrl_iface.c
|
||||
@@ -2326,7 +2326,7 @@ static int wpa_supplicant_ctrl_iface_sta
|
||||
pos += ret;
|
||||
}
|
||||
|
||||
-#ifdef CONFIG_AP
|
||||
+#if defined(CONFIG_AP) && defined(CONFIG_CTRL_IFACE_MIB)
|
||||
if (wpa_s->ap_iface) {
|
||||
pos += ap_ctrl_iface_wpa_get_status(wpa_s, pos,
|
||||
end - pos,
|
||||
@@ -12087,6 +12087,7 @@ char * wpa_supplicant_ctrl_iface_process
|
||||
reply_len = -1;
|
||||
} else if (os_strncmp(buf, "NOTE ", 5) == 0) {
|
||||
wpa_printf(MSG_INFO, "NOTE: %s", buf + 5);
|
||||
+#ifdef CONFIG_CTRL_IFACE_MIB
|
||||
} else if (os_strcmp(buf, "MIB") == 0) {
|
||||
reply_len = wpa_sm_get_mib(wpa_s->wpa, reply, reply_size);
|
||||
if (reply_len >= 0) {
|
||||
@@ -12099,6 +12100,7 @@ char * wpa_supplicant_ctrl_iface_process
|
||||
reply_size - reply_len);
|
||||
#endif /* CONFIG_MACSEC */
|
||||
}
|
||||
+#endif
|
||||
} else if (os_strncmp(buf, "STATUS", 6) == 0) {
|
||||
reply_len = wpa_supplicant_ctrl_iface_status(
|
||||
wpa_s, buf + 6, reply, reply_size);
|
||||
@@ -12587,6 +12589,7 @@ char * wpa_supplicant_ctrl_iface_process
|
||||
reply_len = wpa_supplicant_ctrl_iface_bss(
|
||||
wpa_s, buf + 4, reply, reply_size);
|
||||
#ifdef CONFIG_AP
|
||||
+#ifdef CONFIG_CTRL_IFACE_MIB
|
||||
} else if (os_strcmp(buf, "STA-FIRST") == 0) {
|
||||
reply_len = ap_ctrl_iface_sta_first(wpa_s, reply, reply_size);
|
||||
} else if (os_strncmp(buf, "STA ", 4) == 0) {
|
||||
@@ -12595,12 +12598,15 @@ char * wpa_supplicant_ctrl_iface_process
|
||||
} else if (os_strncmp(buf, "STA-NEXT ", 9) == 0) {
|
||||
reply_len = ap_ctrl_iface_sta_next(wpa_s, buf + 9, reply,
|
||||
reply_size);
|
||||
+#endif
|
||||
+#ifdef CONFIG_CTRL_IFACE_MIB
|
||||
} else if (os_strncmp(buf, "DEAUTHENTICATE ", 15) == 0) {
|
||||
if (ap_ctrl_iface_sta_deauthenticate(wpa_s, buf + 15))
|
||||
reply_len = -1;
|
||||
} else if (os_strncmp(buf, "DISASSOCIATE ", 13) == 0) {
|
||||
if (ap_ctrl_iface_sta_disassociate(wpa_s, buf + 13))
|
||||
reply_len = -1;
|
||||
+#endif
|
||||
} else if (os_strncmp(buf, "CHAN_SWITCH ", 12) == 0) {
|
||||
if (ap_ctrl_iface_chanswitch(wpa_s, buf + 12))
|
||||
reply_len = -1;
|
||||
--- a/src/ap/ctrl_iface_ap.c
|
||||
+++ b/src/ap/ctrl_iface_ap.c
|
||||
@@ -26,6 +26,26 @@
|
||||
#include "taxonomy.h"
|
||||
#include "wnm_ap.h"
|
||||
|
||||
+static const char * hw_mode_str(enum hostapd_hw_mode mode)
|
||||
+{
|
||||
+ switch (mode) {
|
||||
+ case HOSTAPD_MODE_IEEE80211B:
|
||||
+ return "b";
|
||||
+ case HOSTAPD_MODE_IEEE80211G:
|
||||
+ return "g";
|
||||
+ case HOSTAPD_MODE_IEEE80211A:
|
||||
+ return "a";
|
||||
+ case HOSTAPD_MODE_IEEE80211AD:
|
||||
+ return "ad";
|
||||
+ case HOSTAPD_MODE_IEEE80211ANY:
|
||||
+ return "any";
|
||||
+ case NUM_HOSTAPD_MODES:
|
||||
+ return "invalid";
|
||||
+ }
|
||||
+ return "unknown";
|
||||
+}
|
||||
+
|
||||
+#ifdef CONFIG_CTRL_IFACE_MIB
|
||||
|
||||
static size_t hostapd_write_ht_mcs_bitmask(char *buf, size_t buflen,
|
||||
size_t curr_len, const u8 *mcs_set)
|
||||
@@ -212,26 +232,6 @@ static const char * timeout_next_str(int
|
||||
}
|
||||
|
||||
|
||||
-static const char * hw_mode_str(enum hostapd_hw_mode mode)
|
||||
-{
|
||||
- switch (mode) {
|
||||
- case HOSTAPD_MODE_IEEE80211B:
|
||||
- return "b";
|
||||
- case HOSTAPD_MODE_IEEE80211G:
|
||||
- return "g";
|
||||
- case HOSTAPD_MODE_IEEE80211A:
|
||||
- return "a";
|
||||
- case HOSTAPD_MODE_IEEE80211AD:
|
||||
- return "ad";
|
||||
- case HOSTAPD_MODE_IEEE80211ANY:
|
||||
- return "any";
|
||||
- case NUM_HOSTAPD_MODES:
|
||||
- return "invalid";
|
||||
- }
|
||||
- return "unknown";
|
||||
-}
|
||||
-
|
||||
-
|
||||
static int hostapd_ctrl_iface_sta_mib(struct hostapd_data *hapd,
|
||||
struct sta_info *sta,
|
||||
char *buf, size_t buflen)
|
||||
@@ -493,6 +493,7 @@ int hostapd_ctrl_iface_sta_next(struct h
|
||||
return hostapd_ctrl_iface_sta_mib(hapd, sta->next, buf, buflen);
|
||||
}
|
||||
|
||||
+#endif
|
||||
|
||||
#ifdef CONFIG_P2P_MANAGER
|
||||
static int p2p_manager_disconnect(struct hostapd_data *hapd, u16 stype,
|
||||
@@ -884,12 +885,12 @@ int hostapd_ctrl_iface_status(struct hos
|
||||
return len;
|
||||
len += ret;
|
||||
}
|
||||
-
|
||||
+#ifdef CONFIG_CTRL_IFACE_MIB
|
||||
if (iface->conf->ieee80211n && !hapd->conf->disable_11n && mode) {
|
||||
len = hostapd_write_ht_mcs_bitmask(buf, buflen, len,
|
||||
mode->mcs_set);
|
||||
}
|
||||
-
|
||||
+#endif /* CONFIG_CTRL_IFACE_MIB */
|
||||
if (iface->current_rates && iface->num_rates) {
|
||||
ret = os_snprintf(buf + len, buflen - len, "supported_rates=");
|
||||
if (os_snprintf_error(buflen - len, ret))
|
||||
--- a/src/ap/ieee802_1x.c
|
||||
+++ b/src/ap/ieee802_1x.c
|
||||
@@ -2834,6 +2834,7 @@ static const char * bool_txt(bool val)
|
||||
return val ? "TRUE" : "FALSE";
|
||||
}
|
||||
|
||||
+#ifdef CONFIG_CTRL_IFACE_MIB
|
||||
|
||||
int ieee802_1x_get_mib(struct hostapd_data *hapd, char *buf, size_t buflen)
|
||||
{
|
||||
@@ -3020,6 +3021,7 @@ int ieee802_1x_get_mib_sta(struct hostap
|
||||
return len;
|
||||
}
|
||||
|
||||
+#endif
|
||||
|
||||
#ifdef CONFIG_HS20
|
||||
static void ieee802_1x_wnm_notif_send(void *eloop_ctx, void *timeout_ctx)
|
||||
--- a/src/ap/wpa_auth.c
|
||||
+++ b/src/ap/wpa_auth.c
|
||||
@@ -5328,6 +5328,7 @@ static const char * wpa_bool_txt(int val
|
||||
return val ? "TRUE" : "FALSE";
|
||||
}
|
||||
|
||||
+#ifdef CONFIG_CTRL_IFACE_MIB
|
||||
|
||||
#define RSN_SUITE "%02x-%02x-%02x-%d"
|
||||
#define RSN_SUITE_ARG(s) \
|
||||
@@ -5480,7 +5481,7 @@ int wpa_get_mib_sta(struct wpa_state_mac
|
||||
|
||||
return len;
|
||||
}
|
||||
-
|
||||
+#endif
|
||||
|
||||
void wpa_auth_countermeasures_start(struct wpa_authenticator *wpa_auth)
|
||||
{
|
||||
--- a/src/rsn_supp/wpa.c
|
||||
+++ b/src/rsn_supp/wpa.c
|
||||
@@ -3834,6 +3834,8 @@ static u32 wpa_key_mgmt_suite(struct wpa
|
||||
}
|
||||
|
||||
|
||||
+#ifdef CONFIG_CTRL_IFACE_MIB
|
||||
+
|
||||
#define RSN_SUITE "%02x-%02x-%02x-%d"
|
||||
#define RSN_SUITE_ARG(s) \
|
||||
((s) >> 24) & 0xff, ((s) >> 16) & 0xff, ((s) >> 8) & 0xff, (s) & 0xff
|
||||
@@ -3915,6 +3917,7 @@ int wpa_sm_get_mib(struct wpa_sm *sm, ch
|
||||
|
||||
return (int) len;
|
||||
}
|
||||
+#endif
|
||||
#endif /* CONFIG_CTRL_IFACE */
|
||||
|
||||
|
||||
--- a/wpa_supplicant/ap.c
|
||||
+++ b/wpa_supplicant/ap.c
|
||||
@@ -1499,7 +1499,7 @@ int wpas_ap_wps_nfc_report_handover(stru
|
||||
#endif /* CONFIG_WPS */
|
||||
|
||||
|
||||
-#ifdef CONFIG_CTRL_IFACE
|
||||
+#if defined(CONFIG_CTRL_IFACE) && defined(CONFIG_CTRL_IFACE_MIB)
|
||||
|
||||
int ap_ctrl_iface_sta_first(struct wpa_supplicant *wpa_s,
|
||||
char *buf, size_t buflen)
|
||||
@@ -1,189 +0,0 @@
|
||||
From 4bb69d15477e0f2b00e166845341dc933de47c58 Mon Sep 17 00:00:00 2001
|
||||
From: Antonio Quartulli <ordex@autistici.org>
|
||||
Date: Sun, 3 Jun 2012 18:22:56 +0200
|
||||
Subject: [PATCHv2 601/602] wpa_supplicant: add new config params to be used
|
||||
with the ibss join command
|
||||
|
||||
Signed-hostap: Antonio Quartulli <ordex@autistici.org>
|
||||
---
|
||||
src/drivers/driver.h | 6 +++
|
||||
wpa_supplicant/config.c | 96 +++++++++++++++++++++++++++++++++++++++
|
||||
wpa_supplicant/config_ssid.h | 6 +++
|
||||
wpa_supplicant/wpa_supplicant.c | 23 +++++++---
|
||||
4 files changed, 124 insertions(+), 7 deletions(-)
|
||||
|
||||
--- a/src/drivers/driver.h
|
||||
+++ b/src/drivers/driver.h
|
||||
@@ -19,6 +19,7 @@
|
||||
|
||||
#define WPA_SUPPLICANT_DRIVER_VERSION 4
|
||||
|
||||
+#include "ap/sta_info.h"
|
||||
#include "common/defs.h"
|
||||
#include "common/ieee802_11_defs.h"
|
||||
#include "common/wpa_common.h"
|
||||
@@ -953,6 +954,9 @@ struct wpa_driver_associate_params {
|
||||
* responsible for selecting with which BSS to associate. */
|
||||
const u8 *bssid;
|
||||
|
||||
+ unsigned char rates[WLAN_SUPP_RATES_MAX];
|
||||
+ int mcast_rate;
|
||||
+
|
||||
/**
|
||||
* bssid_hint - BSSID of a proposed AP
|
||||
*
|
||||
--- a/wpa_supplicant/config.c
|
||||
+++ b/wpa_supplicant/config.c
|
||||
@@ -18,6 +18,7 @@
|
||||
#include "eap_peer/eap.h"
|
||||
#include "p2p/p2p.h"
|
||||
#include "fst/fst.h"
|
||||
+#include "ap/sta_info.h"
|
||||
#include "config.h"
|
||||
|
||||
|
||||
@@ -2389,6 +2390,97 @@ static char * wpa_config_write_mac_value
|
||||
#endif /* NO_CONFIG_WRITE */
|
||||
|
||||
|
||||
+static int wpa_config_parse_mcast_rate(const struct parse_data *data,
|
||||
+ struct wpa_ssid *ssid, int line,
|
||||
+ const char *value)
|
||||
+{
|
||||
+ ssid->mcast_rate = (int)(strtod(value, NULL) * 10);
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+#ifndef NO_CONFIG_WRITE
|
||||
+static char * wpa_config_write_mcast_rate(const struct parse_data *data,
|
||||
+ struct wpa_ssid *ssid)
|
||||
+{
|
||||
+ char *value;
|
||||
+ int res;
|
||||
+
|
||||
+ if (!ssid->mcast_rate == 0)
|
||||
+ return NULL;
|
||||
+
|
||||
+ value = os_malloc(6); /* longest: 300.0 */
|
||||
+ if (value == NULL)
|
||||
+ return NULL;
|
||||
+ res = os_snprintf(value, 5, "%.1f", (double)ssid->mcast_rate / 10);
|
||||
+ if (res < 0) {
|
||||
+ os_free(value);
|
||||
+ return NULL;
|
||||
+ }
|
||||
+ return value;
|
||||
+}
|
||||
+#endif /* NO_CONFIG_WRITE */
|
||||
+
|
||||
+static int wpa_config_parse_rates(const struct parse_data *data,
|
||||
+ struct wpa_ssid *ssid, int line,
|
||||
+ const char *value)
|
||||
+{
|
||||
+ int i;
|
||||
+ char *pos, *r, *sptr, *end;
|
||||
+ double rate;
|
||||
+
|
||||
+ pos = (char *)value;
|
||||
+ r = strtok_r(pos, ",", &sptr);
|
||||
+ i = 0;
|
||||
+ while (pos && i < WLAN_SUPP_RATES_MAX) {
|
||||
+ rate = 0.0;
|
||||
+ if (r)
|
||||
+ rate = strtod(r, &end);
|
||||
+ ssid->rates[i] = rate * 2;
|
||||
+ if (*end != '\0' || rate * 2 != ssid->rates[i])
|
||||
+ return 1;
|
||||
+
|
||||
+ i++;
|
||||
+ r = strtok_r(NULL, ",", &sptr);
|
||||
+ }
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+#ifndef NO_CONFIG_WRITE
|
||||
+static char * wpa_config_write_rates(const struct parse_data *data,
|
||||
+ struct wpa_ssid *ssid)
|
||||
+{
|
||||
+ char *value, *pos;
|
||||
+ int res, i;
|
||||
+
|
||||
+ if (ssid->rates[0] <= 0)
|
||||
+ return NULL;
|
||||
+
|
||||
+ value = os_malloc(6 * WLAN_SUPP_RATES_MAX + 1);
|
||||
+ if (value == NULL)
|
||||
+ return NULL;
|
||||
+ pos = value;
|
||||
+ for (i = 0; i < WLAN_SUPP_RATES_MAX - 1; i++) {
|
||||
+ res = os_snprintf(pos, 6, "%.1f,", (double)ssid->rates[i] / 2);
|
||||
+ if (res < 0) {
|
||||
+ os_free(value);
|
||||
+ return NULL;
|
||||
+ }
|
||||
+ pos += res;
|
||||
+ }
|
||||
+ res = os_snprintf(pos, 6, "%.1f",
|
||||
+ (double)ssid->rates[WLAN_SUPP_RATES_MAX - 1] / 2);
|
||||
+ if (res < 0) {
|
||||
+ os_free(value);
|
||||
+ return NULL;
|
||||
+ }
|
||||
+
|
||||
+ value[6 * WLAN_SUPP_RATES_MAX] = '\0';
|
||||
+ return value;
|
||||
+}
|
||||
+#endif /* NO_CONFIG_WRITE */
|
||||
+
|
||||
/* Helper macros for network block parser */
|
||||
|
||||
#ifdef OFFSET
|
||||
@@ -2674,6 +2766,8 @@ static const struct parse_data ssid_fiel
|
||||
{ INT(ap_max_inactivity) },
|
||||
{ INT(dtim_period) },
|
||||
{ INT(beacon_int) },
|
||||
+ { FUNC(rates) },
|
||||
+ { FUNC(mcast_rate) },
|
||||
#ifdef CONFIG_MACSEC
|
||||
{ INT_RANGE(macsec_policy, 0, 1) },
|
||||
{ INT_RANGE(macsec_integ_only, 0, 1) },
|
||||
--- a/wpa_supplicant/config_ssid.h
|
||||
+++ b/wpa_supplicant/config_ssid.h
|
||||
@@ -10,8 +10,10 @@
|
||||
#define CONFIG_SSID_H
|
||||
|
||||
#include "common/defs.h"
|
||||
+#include "ap/sta_info.h"
|
||||
#include "utils/list.h"
|
||||
#include "eap_peer/eap_config.h"
|
||||
+#include "drivers/nl80211_copy.h"
|
||||
|
||||
|
||||
#define DEFAULT_EAP_WORKAROUND ((unsigned int) -1)
|
||||
@@ -879,6 +881,9 @@ struct wpa_ssid {
|
||||
*/
|
||||
void *parent_cred;
|
||||
|
||||
+ unsigned char rates[WLAN_SUPP_RATES_MAX];
|
||||
+ double mcast_rate;
|
||||
+
|
||||
#ifdef CONFIG_MACSEC
|
||||
/**
|
||||
* macsec_policy - Determines the policy for MACsec secure session
|
||||
--- a/wpa_supplicant/wpa_supplicant.c
|
||||
+++ b/wpa_supplicant/wpa_supplicant.c
|
||||
@@ -4175,6 +4175,12 @@ static void wpas_start_assoc_cb(struct w
|
||||
params.beacon_int = ssid->beacon_int;
|
||||
else
|
||||
params.beacon_int = wpa_s->conf->beacon_int;
|
||||
+ int i = 0;
|
||||
+ while (i < WLAN_SUPP_RATES_MAX) {
|
||||
+ params.rates[i] = ssid->rates[i];
|
||||
+ i++;
|
||||
+ }
|
||||
+ params.mcast_rate = ssid->mcast_rate;
|
||||
}
|
||||
|
||||
if (bss && ssid->enable_edmg)
|
||||
@@ -1,68 +0,0 @@
|
||||
From: Sven Eckelmann <sven.eckelmann@openmesh.com>
|
||||
Date: Thu, 11 May 2017 08:21:45 +0200
|
||||
Subject: [PATCH] set mcast_rate in mesh mode
|
||||
|
||||
The wpa_supplicant code for IBSS allows to set the mcast rate. It is
|
||||
recommended to increase this value from 1 or 6 Mbit/s to something higher
|
||||
when using a mesh protocol on top which uses the multicast packet loss as
|
||||
indicator for the link quality.
|
||||
|
||||
This setting was unfortunately not applied for mesh mode. But it would be
|
||||
beneficial when wpa_supplicant would behave similar to IBSS mode and set
|
||||
this argument during mesh join like authsae already does. At least it is
|
||||
helpful for companies/projects which are currently switching to 802.11s
|
||||
(without mesh_fwding and with mesh_ttl set to 1) as replacement for IBSS
|
||||
because newer drivers seem to support 802.11s but not IBSS anymore.
|
||||
|
||||
Signed-off-by: Sven Eckelmann <sven.eckelmann@openmesh.com>
|
||||
Tested-by: Simon Wunderlich <simon.wunderlich@openmesh.com>
|
||||
|
||||
--- a/src/drivers/driver.h
|
||||
+++ b/src/drivers/driver.h
|
||||
@@ -1827,6 +1827,7 @@ struct wpa_driver_mesh_join_params {
|
||||
#define WPA_DRIVER_MESH_FLAG_AMPE 0x00000008
|
||||
unsigned int flags;
|
||||
bool handle_dfs;
|
||||
+ int mcast_rate;
|
||||
};
|
||||
|
||||
struct wpa_driver_set_key_params {
|
||||
--- a/src/drivers/driver_nl80211.c
|
||||
+++ b/src/drivers/driver_nl80211.c
|
||||
@@ -11667,6 +11667,18 @@ static int nl80211_put_mesh_id(struct nl
|
||||
}
|
||||
|
||||
|
||||
+static int nl80211_put_mcast_rate(struct nl_msg *msg, int mcast_rate)
|
||||
+{
|
||||
+ if (mcast_rate > 0) {
|
||||
+ wpa_printf(MSG_DEBUG, " * mcast_rate=%.1f",
|
||||
+ (double)mcast_rate / 10);
|
||||
+ return nla_put_u32(msg, NL80211_ATTR_MCAST_RATE, mcast_rate);
|
||||
+ }
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+
|
||||
static int nl80211_put_mesh_config(struct nl_msg *msg,
|
||||
struct wpa_driver_mesh_bss_params *params)
|
||||
{
|
||||
@@ -11728,6 +11740,7 @@ static int nl80211_join_mesh(struct i802
|
||||
nl80211_put_basic_rates(msg, params->basic_rates) ||
|
||||
nl80211_put_mesh_id(msg, params->meshid, params->meshid_len) ||
|
||||
nl80211_put_beacon_int(msg, params->beacon_int) ||
|
||||
+ nl80211_put_mcast_rate(msg, params->mcast_rate) ||
|
||||
nl80211_put_dtim_period(msg, params->dtim_period))
|
||||
goto fail;
|
||||
|
||||
--- a/wpa_supplicant/mesh.c
|
||||
+++ b/wpa_supplicant/mesh.c
|
||||
@@ -632,6 +632,7 @@ int wpa_supplicant_join_mesh(struct wpa_
|
||||
|
||||
params->meshid = ssid->ssid;
|
||||
params->meshid_len = ssid->ssid_len;
|
||||
+ params->mcast_rate = ssid->mcast_rate;
|
||||
ibss_mesh_setup_freq(wpa_s, ssid, ¶ms->freq);
|
||||
wpa_s->mesh_ht_enabled = !!params->freq.ht_enabled;
|
||||
wpa_s->mesh_vht_enabled = !!params->freq.vht_enabled;
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user