Beispiel #1
0
int cwmp_agent_upload_file(upload_arg_t * ularg)
{
    int faultcode = 0;
    FUNCTION_TRACE();
    char * fromfile;

	if(strcpy(ularg->filetype, "1 Vendor Configuration File") == 0)
	{
		//根据实际情况, 修改这里的配置文件路径
		
		fromfile = "/tmp/mysystem.cfg";
	}
	else if(strcpy(ularg->filetype, "2 Vendor Log File") == 0)
	{
		//根据实际情况, 修改这里的配置文件路径
		fromfile = "/tmp/mysystem.log";
	}
	else
	{
		fromfile = "/tmp/mysystem.cfg";
	}
	
    faultcode = http_send_file(fromfile, ularg->url);

    if(faultcode != CWMP_OK)
    {
	faultcode = 9001;
    }
   


    return faultcode;
}
Beispiel #2
0
acpi_status
pr_remove_device (
	void			**context)
{
	acpi_status		status = AE_OK;
	PR_CONTEXT		*processor= NULL;

	FUNCTION_TRACE("pr_remove_device");

	if (!context || !*context) {
		return_ACPI_STATUS(AE_BAD_PARAMETER);
	}

	processor = (PR_CONTEXT*)(*context);

	ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Removing processor device [%02x].\n", processor->device_handle));

	pr_osl_remove_device(processor);

	pr_perf_remove_device(processor);

	pr_power_remove_device(processor);

	acpi_os_free(processor);

	return_ACPI_STATUS(status);
}
Beispiel #3
0
void
pr_print (
	PR_CONTEXT              *processor)
{
#ifdef ACPI_DEBUG
	acpi_buffer             buffer;

	FUNCTION_TRACE("pr_print");

	buffer.length = 256;
	buffer.pointer = acpi_os_callocate(buffer.length);
	if (!buffer.pointer) {
		return;
	}

	/*
	 * Get the full pathname for this ACPI object.
	 */
	acpi_get_name(processor->acpi_handle, ACPI_FULL_PATHNAME, &buffer);

	/*
	 * Print out basic processor information.
	 */
	ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "+------------------------------------------------------------\n"));
	ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "| Processor[%02x]:[%p] uid[%02x] %s\n", processor->device_handle, processor->acpi_handle, processor->uid, (char*)buffer.pointer));
	ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "|   power: %cC0 %cC1 %cC2[%d] %cC3[%d]\n", (processor->power.state[0].is_valid?'+':'-'), (processor->power.state[1].is_valid?'+':'-'), (processor->power.state[2].is_valid?'+':'-'), processor->power.state[2].latency, (processor->power.state[3].is_valid?'+':'-'), processor->power.state[3].latency));
	ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "|   performance: states[%d]\n", processor->performance.state_count));
	ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "+------------------------------------------------------------\n"));

	acpi_os_free(buffer.pointer);
#endif /* ACPI_DEBUG */

	return;
}
Beispiel #4
0
ACPI_STATUS
AcpiDsMethodDataSetEntry (
    UINT16                  Opcode,
    UINT32                  Index,
    ACPI_OPERAND_OBJECT     *Object,
    ACPI_WALK_STATE         *WalkState)
{
    ACPI_STATUS             Status;
    ACPI_OPERAND_OBJECT     **Entry;


    FUNCTION_TRACE ("DsMethodDataSetEntry");


    /* Get a pointer to the stack entry to set */

    Status = AcpiDsMethodDataGetEntry (Opcode, Index, WalkState, &Entry);
    if (ACPI_FAILURE (Status))
    {
        return_ACPI_STATUS (Status);
    }

    /* Increment ref count so object can't be deleted while installed */

    AcpiUtAddReference (Object);

    /* Install the object into the stack entry */

    *Entry = Object;

    return_ACPI_STATUS (AE_OK);
}
Beispiel #5
0
acpi_status
acpi_ds_scope_stack_pop (
	acpi_walk_state         *walk_state)
{
	acpi_generic_state      *scope_info;


	FUNCTION_TRACE ("Ds_scope_stack_pop");


	/*
	 * Pop scope info object off the stack.
	 */
	scope_info = acpi_ut_pop_generic_state (&walk_state->scope_info);
	if (!scope_info) {
		return_ACPI_STATUS (AE_STACK_UNDERFLOW);
	}

	ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
		"Popped object type %X\n", scope_info->common.value));

	acpi_ut_delete_generic_state (scope_info);

	return_ACPI_STATUS (AE_OK);
}
Beispiel #6
0
acpi_status
acpi_ns_unload_namespace (
	acpi_handle             handle)
{
	acpi_status             status;


	FUNCTION_TRACE ("Ns_unload_name_space");


	/* Parameter validation */

	if (!acpi_gbl_root_node) {
		return_ACPI_STATUS (AE_NO_NAMESPACE);
	}

	if (!handle) {
		return_ACPI_STATUS (AE_BAD_PARAMETER);
	}


	/* This function does the real work */

	status = acpi_ns_delete_subtree (handle);

	return_ACPI_STATUS (status);
}
Beispiel #7
0
acpi_status
ec_notify (
	BM_NOTIFY               notify,
	BM_HANDLE               device_handle,
	void                    **context)
{
	acpi_status             status = AE_OK;

	FUNCTION_TRACE("ec_notify");

	switch (notify) {

	case BM_NOTIFY_DEVICE_ADDED:
		status = ec_add_device(device_handle, context);
		break;

	case BM_NOTIFY_DEVICE_REMOVED:
		status = ec_remove_device(context);
		break;

	default:
		status = AE_SUPPORT;
		break;
	}

	return_ACPI_STATUS(status);
}
Beispiel #8
0
acpi_status
acpi_get_firmware_waking_vector (
	ACPI_PHYSICAL_ADDRESS *physical_address)
{

	FUNCTION_TRACE ("Acpi_get_firmware_waking_vector");


	if (!physical_address) {
		return_ACPI_STATUS (AE_BAD_PARAMETER);
	}

	/* Make sure that we have an FACS */

	if (!acpi_gbl_FACS) {
		return_ACPI_STATUS (AE_NO_ACPI_TABLES);
	}

	/* Get the vector */

	if (acpi_gbl_FACS->vector_width == 32) {
		*physical_address = * (u32 *) acpi_gbl_FACS->firmware_waking_vector;
	}
	else {
		*physical_address = *acpi_gbl_FACS->firmware_waking_vector;
	}

	return_ACPI_STATUS (AE_OK);
}
void
tz_policy_run (
	unsigned long           data)
{
	acpi_status             status = AE_OK;

	FUNCTION_TRACE("tz_policy_run");

	if (!data) {
		ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Invalid (NULL) context.\n"));
		return_VOID;
	}

	/*
	 * Defer to Non-Interrupt Level:
	 * -----------------------------
	 * Note that all Linux kernel timers run at interrupt-level (ack!).
	 */
	status = acpi_os_queue_for_execution(OSD_PRIORITY_GPE,  tz_policy_check, (void*)data);
	if (ACPI_FAILURE(status)) {
		ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Error invoking thermal policy.\n"));
	}

	return_VOID;
}
Beispiel #10
0
acpi_status
acpi_leave_sleep_state (
	u8                  sleep_state)
{
	acpi_object_list    arg_list;
	acpi_object         arg;


	FUNCTION_TRACE ("Acpi_leave_sleep_state");


	MEMSET (&arg_list, 0, sizeof(arg_list));
	arg_list.count = 1;
	arg_list.pointer = &arg;

	MEMSET (&arg, 0, sizeof(arg));
	arg.type = ACPI_TYPE_INTEGER;
	arg.integer.value = sleep_state;

	acpi_evaluate_object (NULL, "\\_BFS", &arg_list, NULL);
	acpi_evaluate_object (NULL, "\\_WAK", &arg_list, NULL);

	/* _WAK returns stuff - do we want to look at it? */

	acpi_hw_enable_non_wakeup_gpes();

	return_ACPI_STATUS (AE_OK);
}
Beispiel #11
0
acpi_status
acpi_set_firmware_waking_vector (
	ACPI_PHYSICAL_ADDRESS physical_address)
{

	FUNCTION_TRACE ("Acpi_set_firmware_waking_vector");


	/* Make sure that we have an FACS */

	if (!acpi_gbl_FACS) {
		return_ACPI_STATUS (AE_NO_ACPI_TABLES);
	}

	/* Set the vector */

	if (acpi_gbl_FACS->vector_width == 32) {
		* (u32 *) acpi_gbl_FACS->firmware_waking_vector = (u32) physical_address;
	}
	else {
		*acpi_gbl_FACS->firmware_waking_vector = physical_address;
	}

	return_ACPI_STATUS (AE_OK);
}
acpi_status
acpi_ex_pci_config_space_handler (
	u32                     function,
	ACPI_PHYSICAL_ADDRESS   address,
	u32                     bit_width,
	u32                     *value,
	void                    *handler_context,
	void                    *region_context)
{
	acpi_status             status = AE_OK;
	acpi_pci_id             *pci_id;
	u16                     pci_register;


	FUNCTION_TRACE ("Ex_pci_config_space_handler");


	/*
	 *  The arguments to Acpi_os(Read|Write)Pci_cfg(Byte|Word|Dword) are:
	 *
	 *  Pci_segment is the PCI bus segment range 0-31
	 *  Pci_bus     is the PCI bus number range 0-255
	 *  Pci_device  is the PCI device number range 0-31
	 *  Pci_function is the PCI device function number
	 *  Pci_register is the Config space register range 0-255 bytes
	 *
	 *  Value - input value for write, output address for read
	 *
	 */
	pci_id      = (acpi_pci_id *) region_context;
	pci_register = (u16) address;

	ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
		"Pci_config %d (%d) Seg(%04x) Bus(%04x) Dev(%04x) Func(%04x) Reg(%04x)\n",
		function, bit_width, pci_id->segment, pci_id->bus, pci_id->device,
		pci_id->function, pci_register));

	switch (function) {

	case ACPI_READ_ADR_SPACE:

		*value = 0;
		status = acpi_os_read_pci_configuration (pci_id, pci_register, value, bit_width);
		break;


	case ACPI_WRITE_ADR_SPACE:

		status = acpi_os_write_pci_configuration (pci_id, pci_register, *value, bit_width);
		break;


	default:

		status = AE_BAD_PARAMETER;
		break;
	}

	return_ACPI_STATUS (status);
}
Beispiel #13
0
acpi_status
bn_terminate (void)
{
	acpi_status		status = AE_OK;
	BM_DEVICE_ID		criteria;
	BM_DRIVER		driver;

	FUNCTION_TRACE("bn_terminate");

	MEMSET(&criteria, 0, sizeof(BM_DEVICE_ID));
	MEMSET(&driver, 0, sizeof(BM_DRIVER));

	driver.notify = &bn_notify;
	driver.request = &bn_request;

	/*
	 * Unregister for power buttons.
	 */
	MEMCPY(criteria.hid, BN_HID_POWER_BUTTON, sizeof(BN_HID_POWER_BUTTON));
	status = bm_unregister_driver(&criteria, &driver);

	/*
	 * Unregister for sleep buttons.
	 */
	MEMCPY(criteria.hid, BN_HID_SLEEP_BUTTON, sizeof(BN_HID_SLEEP_BUTTON));
	status = bm_unregister_driver(&criteria, &driver);

	/*
	 * Unregister for LID switches.
	 */
	MEMCPY(criteria.hid, BN_HID_LID_SWITCH, sizeof(BN_HID_LID_SWITCH));
	status = bm_unregister_driver(&criteria, &driver);

	return_ACPI_STATUS(status);
}
Beispiel #14
0
ACPI_PARSE_STATE *
AcpiPsCreateState (
    UINT8                   *Aml,
    UINT32                  AmlSize)
{
    ACPI_PARSE_STATE        *ParserState;


    FUNCTION_TRACE ("PsCreateState");


    ParserState = ACPI_MEM_CALLOCATE (sizeof (ACPI_PARSE_STATE));
    if (!ParserState)
    {
        return_PTR (NULL);
    }

    ParserState->Aml       = Aml;
    ParserState->AmlEnd    = Aml + AmlSize;
    ParserState->PkgEnd    = ParserState->AmlEnd;
    ParserState->AmlStart  = Aml;


    return_PTR (ParserState);
}
Beispiel #15
0
acpi_status
acpi_ns_initialize_devices (
	void)
{
	acpi_status             status;
	acpi_device_walk_info   info;


	FUNCTION_TRACE ("Ns_initialize_devices");


	info.device_count = 0;
	info.num_STA = 0;
	info.num_INI = 0;


	ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OK, "Executing device _INI methods:"));

	status = acpi_ns_walk_namespace (ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT,
			  ACPI_UINT32_MAX, FALSE, acpi_ns_init_one_device, &info, NULL);

	if (ACPI_FAILURE (status)) {
		ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Walk_namespace failed! %x\n", status));
	}


	ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OK,
		"\n%d Devices found: %d _STA, %d _INI\n",
		info.device_count, info.num_STA, info.num_INI));

	return_ACPI_STATUS (status);
}
acpi_status
tz_policy_remove_device(
	TZ_CONTEXT		*tz)
{
	u32			i = 0;

	FUNCTION_TRACE("tz_remove_device");

	if (!tz) {
		return_ACPI_STATUS(AE_BAD_PARAMETER);
	}

	ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Removing policy for thermal zone [%02x].\n", tz->device_handle));

	/*
	 * Delete the thermal zone policy timer entry, if exists.
	 */
	if (timer_pending(&(tz->policy.timer)))
		del_timer(&(tz->policy.timer));

	/*
	 * Reset thermal performance limit on all processors back to max.
	 */
	if (tz->policy.thresholds.passive.is_valid) {
		for (i=0; i<tz->policy.thresholds.passive.devices.count; i++)
			set_performance_limit(tz->policy.thresholds.passive.devices.handles[i], PR_PERF_MAX);
	}

	return_ACPI_STATUS(AE_OK);
}
Beispiel #17
0
acpi_status
acpi_ns_load_table (
	acpi_table_desc         *table_desc,
	acpi_namespace_node     *node)
{
	acpi_status             status;


	FUNCTION_TRACE ("Ns_load_table");


	if (!table_desc->aml_start) {
		ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Null AML pointer\n"));
		return_ACPI_STATUS (AE_BAD_PARAMETER);
	}

	ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "AML block at %p\n", table_desc->aml_start));


	if (!table_desc->aml_length) {
		ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Zero-length AML block\n"));
		return_ACPI_STATUS (AE_BAD_PARAMETER);
	}


	/*
	 * Parse the table and load the namespace with all named
	 * objects found within.  Control methods are NOT parsed
	 * at this time.  In fact, the control methods cannot be
	 * parsed until the entire namespace is loaded, because
	 * if a control method makes a forward reference (call)
	 * to another control method, we can't continue parsing
	 * because we don't know how many arguments to parse next!
	 */
	ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "**** Loading table into namespace ****\n"));

	acpi_ut_acquire_mutex (ACPI_MTX_NAMESPACE);
	status = acpi_ns_parse_table (table_desc, node->child);
	acpi_ut_release_mutex (ACPI_MTX_NAMESPACE);

	if (ACPI_FAILURE (status)) {
		return_ACPI_STATUS (status);
	}

	/*
	 * Now we can parse the control methods.  We always parse
	 * them here for a sanity check, and if configured for
	 * just-in-time parsing, we delete the control method
	 * parse trees.
	 */
	ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
		"**** Begin Table Method Parsing and Object Initialization ****\n"));

	status = acpi_ds_initialize_objects (table_desc, node);

	ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
		"**** Completed Table Method Parsing and Object Initialization ****\n"));

	return_ACPI_STATUS (status);
}
Beispiel #18
0
acpi_status
tz_remove_device (
	void			**context)
{
	acpi_status		status = AE_OK;
	TZ_CONTEXT		*tz = NULL;

	FUNCTION_TRACE("tz_remove_device");

	if (!context || !*context) {
		return_ACPI_STATUS(AE_BAD_PARAMETER);
	}

	tz = (TZ_CONTEXT*)(*context);

	ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Removing thermal zone [%02x].\n", tz->device_handle));

	status = tz_osl_remove_device(tz);

	/*
	 * Remove Policy:
	 * --------------
	 * TBD: Move all thermal zone policy to user-mode daemon...
	 */
	status = tz_policy_remove_device(tz);
	if (ACPI_FAILURE(status)) {
		return_ACPI_STATUS(status);
	}

	acpi_os_free(tz);

	return_ACPI_STATUS(status);
}
Beispiel #19
0
acpi_status
ec_remove_device(
	void                    **context)
{
	acpi_status             status = AE_OK;
	EC_CONTEXT              *ec = NULL;

	FUNCTION_TRACE("ec_remove_device");

	if (!context || !*context) {
		return_ACPI_STATUS(AE_BAD_PARAMETER);
	}

	ec = (EC_CONTEXT*)*context;

	ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Removing EC device [%02x].\n", ec->device_handle));

	ec_remove_space_handler(ec);

	ec_remove_gpe_handler(ec);

	if (ec->mutex) {
		acpi_os_delete_semaphore(ec->mutex);
	}

	acpi_os_free(ec);

	*context = NULL;

	return_ACPI_STATUS(status);
}
Beispiel #20
0
acpi_status
tz_request (
	BM_REQUEST		*request,
	void                    *context)
{
	acpi_status             status = AE_OK;
	TZ_CONTEXT              *tz = NULL;

	FUNCTION_TRACE("tz_request");

	/*
	 * Must have a valid request structure and context.
	 */
	if (!request || !context) {
		return_ACPI_STATUS(AE_BAD_PARAMETER);
	}

	tz = (TZ_CONTEXT*)context;

	/*
	 * Handle request:
	 * ---------------
	 */
	switch (request->command) {

	default:
		status = AE_SUPPORT;
		break;
	}

	request->status = status;

	return_ACPI_STATUS(status);
}
Beispiel #21
0
//InternetGatewayDevice.DeviceInfo.Manufacturer
int cpe_get_igd_di_manufacturer(cwmp_t * cwmp, const char * name, char ** value, pool_t * pool)
{
    FUNCTION_TRACE();
    *value = cwmp_conf_pool_get(pool, "cwmp:cpe_manufacture");
    cwmp_log_debug("cpe_get_igd_di_manufacturer: value is %s", *value);
    return	FAULT_CODE_OK;
}
Beispiel #22
0
void
ec_query_handler (
	void                    *context)
{
	EC_CONTEXT		*ec = (EC_CONTEXT*)context;
	static char		object_name[5] = {'_','Q','0','0','\0'};
	const char		hex[] = {'0','1','2','3','4','5','6','7','8',
					'9','A','B','C','D','E','F'};

	FUNCTION_TRACE("ec_query_handler");

	if (!ec) {
		ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Invalid (NULL) context.\n"));
		return_VOID;
	}

	/*
	 * Evaluate _Qxx:
	 * --------------
	 * Evaluate corresponding _Qxx method.  Note that a zero query value
	 * indicates a spurious EC_SCI (no such thing as _Q00).
	 */
	object_name[2] = hex[((ec->query_data >> 4) & 0x0F)];
	object_name[3] = hex[(ec->query_data & 0x0F)];

	ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Evaluating [%s] for ec [%02x].\n", object_name, ec->device_handle));

	bm_evaluate_object(ec->acpi_handle, object_name, NULL, NULL);

	return_VOID;
}
Beispiel #23
0
void
AcpiNsDumpTables (
    ACPI_HANDLE             SearchBase,
    UINT32                  MaxDepth)
{
    ACPI_HANDLE             SearchHandle = SearchBase;


    FUNCTION_TRACE ("NsDumpTables");


    if (!AcpiGbl_RootNode)
    {
        /*
         * If the name space has not been initialized,
         * there is nothing to dump.
         */
        ACPI_DEBUG_PRINT ((ACPI_DB_TABLES, "name space not initialized!\n"));
        return_VOID;
    }

    if (NS_ALL == SearchBase)
    {
        /*  entire namespace    */

        SearchHandle = AcpiGbl_RootNode;
        ACPI_DEBUG_PRINT ((ACPI_DB_TABLES, "\\\n"));
    }


    AcpiNsDumpObjects (ACPI_TYPE_ANY, MaxDepth, ACPI_UINT32_MAX, SearchHandle);
    return_VOID;
}
Beispiel #24
0
ACPI_STATUS
AcpiDisable (void)
{
    ACPI_STATUS             Status;


    FUNCTION_TRACE ("AcpiDisable");


    /* Ensure that ACPI has been initialized */

    ACPI_IS_INITIALIZATION_COMPLETE (Status);
    if (ACPI_FAILURE (Status))
    {
        return_ACPI_STATUS (Status);
    }

    /* Restore original mode  */

    Status = AcpiHwSetMode (AcpiGbl_OriginalMode);
    if (ACPI_FAILURE (Status))
    {
        ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Unable to transition to original mode"));
        return_ACPI_STATUS (Status);
    }

    /* Unload the SCI interrupt handler  */

    AcpiEvRemoveSciHandler ();
    AcpiEvRestoreAcpiState ();

    return_ACPI_STATUS (Status);
}
Beispiel #25
0
acpi_status
acpi_tb_install_table (
    acpi_table_header       *table_ptr,
    acpi_table_desc         *table_info)
{
    acpi_status             status;

    FUNCTION_TRACE ("Tb_install_table");


    /*
     * Check the table signature and make sure it is recognized
     * Also checks the header checksum
     */
    status = acpi_tb_recognize_table (table_ptr, table_info);
    if (ACPI_FAILURE (status)) {
        return_ACPI_STATUS (status);
    }

    /* Lock tables while installing */

    acpi_ut_acquire_mutex (ACPI_MTX_TABLES);

    /* Install the table into the global data structure */

    status = acpi_tb_init_table_descriptor (table_info->type, table_info);

    ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "%s located at %p\n",
                       acpi_gbl_acpi_table_data[table_info->type].name, table_info->pointer));

    acpi_ut_release_mutex (ACPI_MTX_TABLES);
    return_ACPI_STATUS (status);
}
void *
acpi_ut_allocate_object_desc_dbg (
	NATIVE_CHAR             *module_name,
	u32                     line_number,
	u32                     component_id)
{
	acpi_operand_object     *object;


	FUNCTION_TRACE ("Ut_allocate_object_desc_dbg");


	object = acpi_ut_acquire_from_cache (ACPI_MEM_LIST_OPERAND);
	if (!object) {
		_REPORT_ERROR (module_name, line_number, component_id,
				  ("Could not allocate an object descriptor\n"));

		return_PTR (NULL);
	}


	/* Mark the descriptor type */

	object->common.data_type = ACPI_DESC_TYPE_INTERNAL;

	ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, "%p Size %X\n",
			object, sizeof (acpi_operand_object)));

	return_PTR (object);
}
Beispiel #27
0
acpi_status
pr_terminate (void)
{
	acpi_status             status = AE_OK;
	BM_DEVICE_ID		criteria;
	BM_DRIVER		driver;

	FUNCTION_TRACE("pr_terminate");

	memset(&criteria, 0, sizeof(BM_DEVICE_ID));
	memset(&driver, 0, sizeof(BM_DRIVER));

	/*
	 * Terminate power (Cx state) policy.
	 */
	status = pr_power_terminate();
	if (ACPI_FAILURE(status)) {
		return_ACPI_STATUS(status);
	}

	/*
	 * Unegister driver for processor devices.
	 */
	criteria.type = BM_TYPE_PROCESSOR;

	driver.notify = &pr_notify;
	driver.request = &pr_request;

	status = bm_unregister_driver(&criteria, &driver);

	return_ACPI_STATUS(status);
}
Beispiel #28
0
static void test_getset_parameter_node_value (abts_case *tc, void *data)
{
    cwmp_t * c = (cwmp_t*)data;

    parameter_node_t * param;
    char * name = "InternetGatewayDevice.DeviceInfo.SoftwareVersion";
    char * retval;
    char * value ;
    
    pool_t * pool = pool_create(POOL_DEFAULT_SIZE);
    FUNCTION_TRACE();
    param = cwmp_get_parameter_path_node(c->root, name);
    ASSERT_NOTNULL(param);
    
    value = "V1.3.x";

    cwmp_set_parameter_node_value(c, param, name, value, strlen(value));
    
    retval = cwmp_data_get_parameter_value(c, param, name, pool);
    printf("retval ------------------is %s\n", retval);
    ASSERT_STR_EQ(value, retval);
   
    
    value = "V1.4.x";
    cwmp_set_parameter_node_value(c, param, name, value, strlen(value));
    retval = cwmp_data_get_parameter_value(c, param, name, pool);
    ASSERT_STR_EQ(value, retval);
    
    
    pool_destroy(pool);

}
Beispiel #29
0
acpi_name
acpi_ns_find_parent_name (
	acpi_namespace_node     *child_node)
{
	acpi_namespace_node     *parent_node;


	FUNCTION_TRACE ("Ns_find_parent_name");


	if (child_node) {
		/* Valid entry.  Get the parent Node */

		parent_node = acpi_ns_get_parent_object (child_node);
		if (parent_node) {
			ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Parent of %p [%4.4s] is %p [%4.4s]\n",
				child_node, (char*)&child_node->name, parent_node, (char*)&parent_node->name));

			if (parent_node->name) {
				return_VALUE (parent_node->name);
			}
		}

		ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "unable to find parent of %p (%4.4s)\n",
			child_node, (char*)&child_node->name));
	}

	return_VALUE (ACPI_UNKNOWN_NAME);
}
Beispiel #30
0
int cwmp_agent_download_file(download_arg_t * dlarg)
{
    int faultcode = 0;
    char * fromurl = dlarg->url;
    char * tofile = "/tmp/download.img";

    FUNCTION_TRACE();

    if(dlarg->url && TRstrncasecmp("ftp://", dlarg->url, 6) == 0)
    {
	    return 9001;
	  }

    faultcode = http_receive_file(fromurl, tofile);

    if(faultcode != CWMP_OK)
    {
	     faultcode = 9001;
    }
   


    return faultcode;

}