Merge remote-tracking branch 'origin/from-iop-3.4' into v3.5

This commit is contained in:
Martin Schröder 2015-12-02 16:35:58 +01:00
commit 00555a7a2e
8 changed files with 147 additions and 90 deletions

View file

@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=asterisk18-mod
PKG_VERSION:=1.8.10.1
PKG_SOURCE_VERSION:=8d5a855296f61391d0166b66b11e4e6055fd86c6
PKG_SOURCE_VERSION:=ffa46ba1d5abf22fa83d0bd06ea56fe8e638dd43
PKG_SOURCE_PROTO:=git
ifeq ($(CONFIG_BCM_OPEN),y)
PKG_SOURCE_URL:=http://ihgsp.inteno.se/git/asterisk-aa

View file

@ -32,13 +32,13 @@ export CONFIG_BCM_KERNEL_PROFILE
export CONFIG_SECURE_BOOT_CFE
IBOARDID = $(shell echo $(CONFIG_TARGET_IBOARDID) |sed s/\"//g)
BCM_BS_PROFILE = $(shell echo $(CONFIG_BCM_KERNEL_PROFILE) | sed s/\"//g)
BCM_KERNEL_VERSION:=3.4.11-rt19
BCM_SDK_VERSION:=bcm963xx
RSTRIP:=true
define Package/bcmkernel/removevoice
touch $(1)/lib/modules/$(BCM_KERNEL_VERSION)/extra/endpointdd.ko
rm $(1)/lib/modules/$(BCM_KERNEL_VERSION)/extra/endpointdd.ko
@ -206,6 +206,20 @@ define Package/bcmkernel/install
sed -i '/bcm_usb\.ko/d' $(1)/lib/bcm-base-drivers.sh
sed -i 's|/kernel/.*/|/|' $(1)/lib/bcm-base-drivers.sh
ifneq ($(findstring _$(IBOARDID)_,_DG200AL_DG301AL_DG400_VG50_),)
# Don't load any DECT drivers (have external voice or no voice at all)
sed -i '/dect\.ko/d' $(1)/lib/bcm-base-drivers.sh
sed -i '/dectshim\.ko/d' $(1)/lib/bcm-base-drivers.sh
else ifneq ($(findstring _$(IBOARDID)_,_D150_DG200_VOX25_),)
# Load dectshim driver only (have voice but no dect)
sed -i '/dect\.ko/d' $(1)/lib/bcm-base-drivers.sh
else ifneq ($(findstring _$(IBOARDID)_,_CG300_CG301_D301_EG300_),)
# Load both dect and dectshim driver (have internal dect)
else
echo Error: Unknown IBOARDID "$(IBOARDID)"!
false
endif
if [ -a $(PKG_BUILD_DIR)/$(BCM_SDK_VERSION)/targets/$(BCM_BS_PROFILE)/fs/etc/rdpa_init.sh ]; then $(CP) $(PKG_BUILD_DIR)/$(BCM_SDK_VERSION)/targets/$(BCM_BS_PROFILE)/fs/etc/rdpa_init.sh $(1)/etc/; fi;

View file

@ -16,14 +16,14 @@ export PLATFORM_INCLUDE:=platforms/iopsys/build.mk
export DATE:=$(shell date +%Y-%m-%d-%H-%M-%S)
export LOGIN:=$(shell whoami)
BASE_PKG_VERSION:=3.4.0
PKG_RELEASE:=RC2
PKG_RELEASE:=RC5
PKG_VERSION:=$(BASE_PKG_VERSION)-$(PKG_RELEASE)_$(DATE)_$(LOGIN)
export PKG_VERSION
###########################--RELEASE--################################
PKG_SOURCE_URL:=ssh://git@iopsys.inteno.se/ice-client.git
PKG_SOURCE_VERSION:=d780b60a6dcc9d67642d0989bfe33ee1b9ce88eb
PKG_SOURCE_VERSION:=3bdc4863e9b6343b92909b4cf9acb938c87efa21
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(BASE_PKG_VERSION)
PKG_SOURCE:=$(PKG_NAME)-$(BASE_PKG_VERSION)-$(PKG_RELEASE).tar.gz

View file

@ -158,7 +158,15 @@ handle_Downloaded_file()
local KEY
[ -n "$1" ] && DECKEY=$(echo $1 | hexdump -e '16/1 "%02x"')
KEY=${DECKEY:-$DESKEY}
if [ "$(brcm_fw_tool -i check "$IUPCONFFILES")" == "UNKNOWN" ] ; then
local img_type
case "$(get_image_type "$IUPCONFFILES")" in
"INTENO") img_type=2 ;;
"CFE+FS") img_type=1 ;;
"FS") img_type=0 ;;
*) img_type="UNKNOWN";;
esac
if [ "$img_type" == "UNKNOWN" ] ; then
case "$(hexdump -v -n 2 -e '1/1 "%02x"' $IUPCONFFILES)" in
1f8b)
v "Found Config"

View file

@ -9,7 +9,8 @@ AC_CONFIG_HEADERS([config.h])
AC_CONFIG_FILES([Makefile])
CC_CHECK_FLAGS_APPEND([with_cflags], [CFLAGS], [\
-pipe \
-std=gnu11 \
-pipe \
-Wall \
-Wextra \
-Wno-inline \

View file

@ -12,8 +12,9 @@
static struct ubus_context *global_ubus_ctx;
static struct blob_buf bblob;
static void button_ubus_interface_event(struct ubus_context *ubus_ctx, char *button, button_state_t pressed);
void button_ubus_interface_event(struct ubus_context *ubus_ctx, char *button, button_state_t pressed)
static void button_ubus_interface_event(struct ubus_context *ubus_ctx, char *button, button_state_t pressed)
{
char s[UBUS_BUTTON_NAME_PREPEND_LEN+BUTTON_MAX_NAME_LEN];
s[0]=0;
@ -140,8 +141,8 @@ struct button_status_all {
static struct button_status_all * read_button_states(void)
{
static struct button_status_all p;
p.n=0;
struct list_head *i;
p.n=0;
#ifdef HAVE_BOARD_H
/* sx9512 driver needs to read out all buttons at once */
/* so call it once at beginning of scanning inputs */
@ -299,7 +300,7 @@ static void button_handler(struct uloop_timeout *timeout)
if (! timer_started(drv_node)) {
timer_start(drv_node);
DBG(1, " %s pressed", drv_node->drv->name);
button_ubus_interface_event(global_ubus_ctx, node->name, BUTTON_PRESSED);
// button_ubus_interface_event(global_ubus_ctx, node->name, BUTTON_PRESSED);
}
if(timer_valid(drv_node, node->minpress, 0))
led_pressindicator_set();
@ -328,8 +329,9 @@ static void button_handler(struct uloop_timeout *timeout)
static int button_state_method(struct ubus_context *ubus_ctx, struct ubus_object *obj,
struct ubus_request_data *req, const char *method, struct blob_attr *msg)
{
// button_state_t state = read_button_state(obj->name+UBUS_BUTTON_NAME_PREPEND_LEN);
blob_buf_init(&bblob, 0);
button_state_t state = read_button_state(obj->name+UBUS_BUTTON_NAME_PREPEND_LEN);
switch(read_button_state(obj->name+UBUS_BUTTON_NAME_PREPEND_LEN)) {
case BUTTON_RELEASED:
blobmsg_add_string(&bblob, "state", "released");
@ -414,7 +416,7 @@ void button_init( struct server_ctx *s_ctx)
LIST_HEAD(buttonnames);
int default_minpress = 0;
char *s;
int i,r;
int r;
global_ubus_ctx=s_ctx->ubus_ctx;
@ -513,17 +515,20 @@ void button_init( struct server_ctx *s_ctx)
list_add(&function->list, &buttons);
/* register each button with ubus */
struct ubus_object *ubo;
ubo = malloc(sizeof(struct ubus_object));
memset(ubo, 0, sizeof(struct ubus_object));
char name[UBUS_BUTTON_NAME_PREPEND_LEN+BUTTON_MAX_NAME_LEN];
snprintf(name, UBUS_BUTTON_NAME_PREPEND_LEN+BUTTON_MAX_NAME_LEN, "%s%s", UBUS_BUTTON_NAME_PREPEND, node->val);
ubo->name = strdup(name);
ubo->methods = button_methods;
ubo->n_methods = ARRAY_SIZE(button_methods);
ubo->type = &button_object_type;
if((r=ubus_add_object(s_ctx->ubus_ctx, ubo)))
DBG(1,"Failed to add object: %s", ubus_strerror(r));
{
struct ubus_object *ubo;
char name[UBUS_BUTTON_NAME_PREPEND_LEN+BUTTON_MAX_NAME_LEN];
ubo = malloc(sizeof(struct ubus_object));
memset(ubo, 0, sizeof(struct ubus_object));
snprintf(name, UBUS_BUTTON_NAME_PREPEND_LEN+BUTTON_MAX_NAME_LEN, "%s%s", UBUS_BUTTON_NAME_PREPEND, node->val);
ubo->name = strdup(name);
ubo->methods = button_methods;
ubo->n_methods = ARRAY_SIZE(button_methods);
ubo->type = &button_object_type;
if((r=ubus_add_object(s_ctx->ubus_ctx, ubo)))
DBG(1,"Failed to add object: %s", ubus_strerror(r));
}
}
uloop_timeout_set(&button_inform_timer, BUTTON_TIMEOUT);

View file

@ -73,6 +73,7 @@ struct function_led {
led_action_t state; /* state of the function led. contain what action is currently set */
int dimming; /* should this led be dimmed */
int brightness; /* Brightness of the led */
int timeout; /* if time is after */
int press_indicator; /* record if this is part of press indictor */
struct function_action actions[LED_ACTION_MAX];
};
@ -87,6 +88,8 @@ static led_action_t dimming_level; /* The min level where dimming should not hap
static int dimming_timeout; /* The time to turn on leds when we have dimming on */
static int dimming_count; /* as long as this is not zero show all leds */
#define FLASH_TIMEOUT 250 /* this is the delay for the update loop. 4 times a second */
#define FLASH_HZ (1000/FLASH_TIMEOUT)
int get_index_by_name(const char *const*array, int max, const char *name);
int get_index_for_function(const char *name);
@ -347,15 +350,32 @@ static int brightness_function_led(const char* fn_name, int brightness) {
return 0;
}
static int timeout_function_led(const char* fn_name, int timeout) {
int led_idx = get_index_for_function(fn_name);
if(led_idx == -1) {
syslog(LOG_WARNING, "called over ubus with non valid led name [%s]", fn_name);
return -1;
}
/* store timeout as number of passes on the flash loop */
/* in the loop decrement the timeout */
leds[led_idx].timeout = FLASH_HZ * timeout;
return 0;
}
enum {
LED_STATE,
LED_BRIGHTNESS,
LED_TIMEOUT,
__LED_MAX
};
static const struct blobmsg_policy led_policy[] = {
[LED_STATE] = { .name = "state", .type = BLOBMSG_TYPE_STRING },
[LED_BRIGHTNESS] = { .name = "brightness", .type = BLOBMSG_TYPE_INT32 },
[LED_TIMEOUT] = { .name = "timeout", .type = BLOBMSG_TYPE_INT32 },
};
static int led_set_method(struct ubus_context *ubus_ctx, struct ubus_object *obj,
@ -364,7 +384,7 @@ static int led_set_method(struct ubus_context *ubus_ctx, struct ubus_object *obj
{
struct blob_attr *tb[__LED_MAX];
char* state;
int *number;
int number;
char *fn_name = strchr(obj->name, '.') + 1;
blobmsg_parse(led_policy, ARRAY_SIZE(led_policy), tb, blob_data(msg), blob_len(msg));
@ -377,13 +397,20 @@ static int led_set_method(struct ubus_context *ubus_ctx, struct ubus_object *obj
}
if (tb[LED_BRIGHTNESS]) {
number = blobmsg_data(tb[LED_BRIGHTNESS]);
DBG(1,"set brightness [%s]->[%d]", fn_name, *number);
if (brightness_function_led(fn_name, *number) ){
number = blobmsg_get_u32(tb[LED_BRIGHTNESS]);
DBG(1,"set brightness [%s]->[%x]", fn_name, number);
if (brightness_function_led(fn_name, number) ){
return UBUS_STATUS_NO_DATA;
}
}
if (tb[LED_TIMEOUT]) {
number = blobmsg_get_u32(tb[LED_TIMEOUT]);
DBG(1,"set timeout [%s]->[%x]", fn_name, number);
timeout_function_led(fn_name, number);
} else // remove timeout
timeout_function_led(fn_name, 0);
return 0;
}
@ -485,8 +512,6 @@ static struct ubus_object led_objects[LED_OBJECTS] = {
{ .name = "leds", .type = &leds_object_type, .methods = leds_methods, .n_methods = ARRAY_SIZE(leds_methods), },
};
#define FLASH_TIMEOUT 250
static void flash_handler(struct uloop_timeout *timeout);
static struct uloop_timeout flash_inform_timer = { .cb = flash_handler };
@ -538,6 +563,15 @@ static void flash_handler(struct uloop_timeout *timeout)
}
}
/* is there a timeout on this led ?*/
if (leds[i].timeout) {
leds[i].timeout--;
/* if it has timedout set state to OFF */
if (! leds[i].timeout) {
leds[i].state = LED_OFF;
}
}
list_for_each_entry(led, &leds[i].actions[action_state].led_list, list) {
if (led->state == FLASH_FAST) {
@ -841,7 +875,7 @@ void led_init( struct server_ctx *s_ctx)
if (s) {
DBG(1,"Dimming init");
for(i=0 ; i < LED_ACTION_MAX ; i++) {
if (! strncasecmp(s, fn_actions[i], sizeof(fn_actions[i]))){
if (! strncasecmp(s, fn_actions[i], strlen(fn_actions[i]))){
dimming_level = i;
}
}

View file

@ -452,58 +452,48 @@ wireless_assoclist()
}
}
/*static bool*/
/*wireless_sta(Client *clnt, Detail *dtl)*/
/*{*/
/* FILE *stainfo;*/
/* char cmnd[64];*/
/* char line[128];*/
/* int i = 0;*/
/* bool there = false;*/
/* char tab[16];*/
/* int tmp;*/
/* int noise;*/
static void
wireless_details(Client *clnt, Detail *dtl)
{
FILE *stainfo;
char cmnd[64];
char line[128];
int i = 0;
int tmp;
int noise;
/* for (i = 0; wireless[i].device; i++) {*/
/* sprintf(cmnd, "wlctl -i %s sta_info %s 2>/dev/null", wireless[i].vif, clnt->macaddr);*/
/* if ((stainfo = popen(cmnd, "r"))) {*/
/* while(fgets(line, sizeof(line), stainfo) != NULL)*/
/* {*/
/* remove_newline(line);*/
/* if(sscanf(line, "%sstate: AUTHENTICATED ASSOCIATED AUTHORIZED", tab)) {*/
/* there = true;*/
/* strncpy(clnt->wdev, wireless[i].vif, sizeof(clnt->wdev));*/
/* }*/
/* sscanf(line, "\t idle %d seconds", &(dtl->idle));*/
/* sscanf(line, "\t in network %d seconds", &(dtl->in_network));*/
/* sscanf(line, "\t tx total bytes: %ld\n", &(dtl->tx_bytes));*/
/* sscanf(line, "\t rx data bytes: %ld", &(dtl->rx_bytes));*/
/* sscanf(line, "\t rate of last tx pkt: %d kbps - %d kbps", &tmp, &(dtl->tx_rate));*/
/* sscanf(line, "\t rate of last rx pkt: %d kbps", &(dtl->rx_rate));*/
/* }*/
/* pclose(stainfo);*/
/* }*/
/* if (there) {*/
/* sprintf(cmnd, "wlctl -i %s noise", wireless[i].device);*/
/* if ((stainfo = popen(cmnd, "r"))) {*/
/* fgets(line, sizeof(line), stainfo);*/
/* remove_newline(line);*/
/* noise = atoi(line);*/
/* pclose(stainfo);*/
/* }*/
/* sprintf(cmnd, "wlctl -i %s rssi %s", wireless[i].vif, clnt->macaddr);*/
/* if ((stainfo = popen(cmnd, "r"))) {*/
/* fgets(line, sizeof(line), stainfo);*/
/* remove_newline(line);*/
/* dtl->snr = atoi(line) - noise;*/
/* pclose(stainfo);*/
/* }*/
/* }*/
/* if (there)*/
/* break;*/
/* }*/
/* return there;*/
/*}*/
sprintf(cmnd, "wlctl -i %s sta_info %s 2>/dev/null", clnt->wdev, clnt->macaddr);
if ((stainfo = popen(cmnd, "r"))) {
while(fgets(line, sizeof(line), stainfo) != NULL)
{
remove_newline(line);
sscanf(line, "\t idle %d seconds", &(dtl->idle));
sscanf(line, "\t in network %d seconds", &(dtl->in_network));
sscanf(line, "\t tx total bytes: %ld\n", &(dtl->tx_bytes));
sscanf(line, "\t rx data bytes: %ld", &(dtl->rx_bytes));
sscanf(line, "\t rate of last tx pkt: %d kbps - %d kbps", &tmp, &(dtl->tx_rate));
if (dtl->tx_rate < 0) dtl->tx_rate = tmp;
sscanf(line, "\t rate of last rx pkt: %d kbps", &(dtl->rx_rate));
}
pclose(stainfo);
}
sprintf(cmnd, "wlctl -i %s noise", clnt->wdev);
if ((stainfo = popen(cmnd, "r"))) {
fgets(line, sizeof(line), stainfo);
remove_newline(line);
noise = atoi(line);
pclose(stainfo);
}
sprintf(cmnd, "wlctl -i %s rssi %s", clnt->wdev, clnt->macaddr);
if ((stainfo = popen(cmnd, "r"))) {
fgets(line, sizeof(line), stainfo);
remove_newline(line);
dtl->snr = atoi(line) - noise;
pclose(stainfo);
}
}
static bool
wireless_sta(Client *clnt, Detail *dtl)
@ -594,8 +584,10 @@ ipv4_clients()
clients[cno].exists = true;
clients[cno].dhcp = true;
handle_client(&clients[cno]);
if((clients[cno].connected = wireless_sta(&clients[cno], &details[cno])))
if((clients[cno].connected = wireless_sta(&clients[cno], &details[cno]))) {
clients[cno].wireless = true;
wireless_details(&clients[cno], &details[cno]);
}
else if(!(clients[cno].connected = arping(clients[cno].ipaddr, clients[cno].device, toms)))
recalc_sleep_time(true, toms);
@ -637,9 +629,10 @@ ipv4_clients()
if(clients[cno].local) {
clients[cno].exists = true;
clients[cno].dhcp = false;
if((clients[cno].connected = wireless_sta(&clients[cno], &details[cno])))
if((clients[cno].connected = wireless_sta(&clients[cno], &details[cno]))) {
clients[cno].wireless = true;
else if(!(clients[cno].connected = arping(clients[cno].ipaddr, clients[cno].device, toms)))
wireless_details(&clients[cno], &details[cno]);
} else if(!(clients[cno].connected = arping(clients[cno].ipaddr, clients[cno].device, toms)))
recalc_sleep_time(true, toms);
if (clients[cno].connected)
@ -686,8 +679,10 @@ ipv6_clients()
clear_macaddr();
if((clients6[cno].connected = ndisc (clients6[cno].hostname, clients6[cno].device, 0x8, 1, toms))) {
sprintf(clients6[cno].macaddr, get_macaddr());
if (wireless_sta6(&clients6[cno], &details6[cno]))
if (wireless_sta6(&clients6[cno], &details6[cno])) {
clients6[cno].wireless = true;
//wireless_details(&clients6[cno], &details6[cno]);
}
} else
recalc_sleep_time(true, toms);
@ -953,13 +948,13 @@ router_dump_clients(struct blob_buf *b)
blobmsg_add_u32(b, "active_cons", active_connections(clients[i].ipaddr));*/
if(clients[i].wireless) {
blobmsg_add_string(b, "wdev", clients[i].wdev);
//blobmsg_add_u32(b, "idle", details[i].idle);
//blobmsg_add_u32(b, "in_network", details[i].in_network);
blobmsg_add_u32(b, "idle", details[i].idle);
blobmsg_add_u32(b, "in_network", details[i].in_network);
blobmsg_add_u32(b, "snr", details[i].snr);
//blobmsg_add_u64(b, "tx_bytes", details[i].tx_bytes);
//blobmsg_add_u64(b, "rx_bytes", details[i].rx_bytes);
//blobmsg_add_u32(b, "tx_rate", details[i].tx_rate);
//blobmsg_add_u32(b, "rx_rate", details[i].rx_rate);
blobmsg_add_u64(b, "tx_bytes", details[i].tx_bytes);
blobmsg_add_u64(b, "rx_bytes", details[i].rx_bytes);
blobmsg_add_u32(b, "tx_rate", details[i].tx_rate);
blobmsg_add_u32(b, "rx_rate", details[i].rx_rate);
}
blobmsg_close_table(b, t);
num++;