Example #1
0
/*
 * Schedule property to be sent only to service
 */
void prop_send_req_to_ads_only(const char *name)
{
	struct prop *prop;

	prop = prop_lookup(name);
	if (prop) {
		prop->send_mask = ADS_BIT;
	}
}
Example #2
0
/*
 * Schedule property to be sent to module.
 */
void prop_send_req(const char *name)
{
	struct prop *prop;

	prop = prop_lookup(name);
	if (prop) {
		prop->send_mask = ALL_DESTS_BIT;
	}
}
Example #3
0
MBSTRING_API int php_unicode_is_prop(unsigned long code, unsigned long mask1,
		unsigned long mask2)
{
	unsigned long i;

	if (mask1 == 0 && mask2 == 0)
		return 0;

	for (i = 0; mask1 && i < 32; i++) {
		if ((mask1 & masks32[i]) && prop_lookup(code, i))
			return 1;
	}

	for (i = 32; mask2 && i < _ucprop_size; i++) {
		if ((mask2 & masks32[i & 31]) && prop_lookup(code, i))
			return 1;
	}

	return 0;
}
Example #4
0
/*
 * Set length of test pattern stream to send up to module.
 * Setting this causes the transfer to start, unless it is already in progress.
 */
void set_length_up(struct prop *prop, void *arg, void *valp, size_t len)
{
	s32 i = *(s32 *)valp;
	struct prop *stream_prop;

	if (len != sizeof(s32) || i <= 0) {
		return;
	}
	stream_prop = prop_lookup("stream_up");	
	if (!stream_prop) {
		return;
	}
	prop_dp_start_send(stream_prop, &stream_up_state, i);
	prop->send_mask = valid_dest_mask; /* set stream_up_len back to 0 */
}
Example #5
0
/*
 * prop_request_value(const char *).
 * Request the value of the specified property from ADS.
 * If name is null, ask for all "to-device" properties.
 * If the name isn't in the prop table, it'll return -1.
 */
int prop_request_value(const char *name)
{
	struct prop *prop;

	if (name) {
		prop = prop_lookup(name);
		if (!prop) {
			return -1;
		}
		if (prop->name_len == 0) {
			prop->name_len = strlen(prop->name);
		}
		prop->get_val = 1;
	} else {
		prop_request_all = 1;
	}
	
	return 0;
}
Example #6
0
/*
 * Reads the schedule action and fires it.
 */
void sched_set_prop(struct ayla_tlv *atlv, u8 tot_len)
{
	struct prop *prop;
	struct ayla_tlv *tlv;
	char name[PROP_NAME_LEN];
	long val;
	int name_tlv_len;

	tlv = (struct ayla_tlv *)(atlv);
	if (tlv->type != ATLV_NAME || tlv->len >= sizeof(name) ||
	    tlv->len + sizeof(struct ayla_tlv) > tot_len) {
		return;
	}
	memcpy(name, tlv + 1, tlv->len);
	name[tlv->len] = '\0';
	name_tlv_len = tlv->len;

	prop = prop_lookup(name);
	if (!prop) {
		return;
	}
	if (prop->type != ATLV_BOOL &&
	    prop->type != ATLV_INT) {
		/* only bool and int sched actions
		 * are supported for now.
		 */
		return;
	}

	tlv = (struct ayla_tlv *)((u8 *)tlv + tlv->len +
	    sizeof(struct ayla_tlv));

	if (tlv->len + name_tlv_len + 2 * sizeof(struct ayla_tlv) > tot_len) {
		return;
	}
	if (sched_int_get(tlv, &val)) {
		return;
	}
	prop->set(prop, prop->arg, &val, tlv->len);
	prop->echo = 1;
	prop->send_mask = ALL_DESTS_BIT;
}