Updated from Linux LTS 3.10.20 to 3.10.21
This commit is contained in:
@@ -963,10 +963,17 @@ acpi_status acpi_ex_opcode_1A_0T_1R(struct acpi_walk_state *walk_state)
|
||||
*/
|
||||
return_desc =
|
||||
*(operand[0]->reference.where);
|
||||
if (return_desc) {
|
||||
acpi_ut_add_reference
|
||||
(return_desc);
|
||||
if (!return_desc) {
|
||||
/*
|
||||
* Element is NULL, do not allow the dereference.
|
||||
* This provides compatibility with other ACPI
|
||||
* implementations.
|
||||
*/
|
||||
return_ACPI_STATUS
|
||||
(AE_AML_UNINITIALIZED_ELEMENT);
|
||||
}
|
||||
|
||||
acpi_ut_add_reference(return_desc);
|
||||
break;
|
||||
|
||||
default:
|
||||
@@ -991,11 +998,40 @@ acpi_status acpi_ex_opcode_1A_0T_1R(struct acpi_walk_state *walk_state)
|
||||
acpi_namespace_node
|
||||
*)
|
||||
return_desc);
|
||||
if (!return_desc) {
|
||||
break;
|
||||
}
|
||||
|
||||
/*
|
||||
* June 2013:
|
||||
* buffer_fields/field_units require additional resolution
|
||||
*/
|
||||
switch (return_desc->common.type) {
|
||||
case ACPI_TYPE_BUFFER_FIELD:
|
||||
case ACPI_TYPE_LOCAL_REGION_FIELD:
|
||||
case ACPI_TYPE_LOCAL_BANK_FIELD:
|
||||
case ACPI_TYPE_LOCAL_INDEX_FIELD:
|
||||
|
||||
status =
|
||||
acpi_ex_read_data_from_field
|
||||
(walk_state, return_desc,
|
||||
&temp_desc);
|
||||
if (ACPI_FAILURE(status)) {
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
return_desc = temp_desc;
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
/* Add another reference to the object */
|
||||
|
||||
acpi_ut_add_reference
|
||||
(return_desc);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* Add another reference to the object! */
|
||||
|
||||
acpi_ut_add_reference(return_desc);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
@@ -57,6 +57,11 @@ acpi_ex_store_object_to_index(union acpi_operand_object *val_desc,
|
||||
union acpi_operand_object *dest_desc,
|
||||
struct acpi_walk_state *walk_state);
|
||||
|
||||
static acpi_status
|
||||
acpi_ex_store_direct_to_node(union acpi_operand_object *source_desc,
|
||||
struct acpi_namespace_node *node,
|
||||
struct acpi_walk_state *walk_state);
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: acpi_ex_store
|
||||
@@ -376,7 +381,11 @@ acpi_ex_store_object_to_index(union acpi_operand_object *source_desc,
|
||||
* When storing into an object the data is converted to the
|
||||
* target object type then stored in the object. This means
|
||||
* that the target object type (for an initialized target) will
|
||||
* not be changed by a store operation.
|
||||
* not be changed by a store operation. A copy_object can change
|
||||
* the target type, however.
|
||||
*
|
||||
* The implicit_conversion flag is set to NO/FALSE only when
|
||||
* storing to an arg_x -- as per the rules of the ACPI spec.
|
||||
*
|
||||
* Assumes parameters are already validated.
|
||||
*
|
||||
@@ -400,7 +409,7 @@ acpi_ex_store_object_to_node(union acpi_operand_object *source_desc,
|
||||
target_type = acpi_ns_get_type(node);
|
||||
target_desc = acpi_ns_get_attached_object(node);
|
||||
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "Storing %p(%s) into node %p(%s)\n",
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "Storing %p (%s) to node %p (%s)\n",
|
||||
source_desc,
|
||||
acpi_ut_get_object_type_name(source_desc), node,
|
||||
acpi_ut_get_type_name(target_type)));
|
||||
@@ -414,46 +423,31 @@ acpi_ex_store_object_to_node(union acpi_operand_object *source_desc,
|
||||
return_ACPI_STATUS(status);
|
||||
}
|
||||
|
||||
/* If no implicit conversion, drop into the default case below */
|
||||
|
||||
if ((!implicit_conversion) ||
|
||||
((walk_state->opcode == AML_COPY_OP) &&
|
||||
(target_type != ACPI_TYPE_LOCAL_REGION_FIELD) &&
|
||||
(target_type != ACPI_TYPE_LOCAL_BANK_FIELD) &&
|
||||
(target_type != ACPI_TYPE_LOCAL_INDEX_FIELD))) {
|
||||
/*
|
||||
* Force execution of default (no implicit conversion). Note:
|
||||
* copy_object does not perform an implicit conversion, as per the ACPI
|
||||
* spec -- except in case of region/bank/index fields -- because these
|
||||
* objects must retain their original type permanently.
|
||||
*/
|
||||
target_type = ACPI_TYPE_ANY;
|
||||
}
|
||||
|
||||
/* Do the actual store operation */
|
||||
|
||||
switch (target_type) {
|
||||
case ACPI_TYPE_BUFFER_FIELD:
|
||||
case ACPI_TYPE_LOCAL_REGION_FIELD:
|
||||
case ACPI_TYPE_LOCAL_BANK_FIELD:
|
||||
case ACPI_TYPE_LOCAL_INDEX_FIELD:
|
||||
|
||||
/* For fields, copy the source data to the target field. */
|
||||
|
||||
status = acpi_ex_write_data_to_field(source_desc, target_desc,
|
||||
&walk_state->result_obj);
|
||||
break;
|
||||
|
||||
case ACPI_TYPE_INTEGER:
|
||||
case ACPI_TYPE_STRING:
|
||||
case ACPI_TYPE_BUFFER:
|
||||
|
||||
/*
|
||||
* These target types are all of type Integer/String/Buffer, and
|
||||
* therefore support implicit conversion before the store.
|
||||
*
|
||||
* Copy and/or convert the source object to a new target object
|
||||
* The simple data types all support implicit source operand
|
||||
* conversion before the store.
|
||||
*/
|
||||
|
||||
if ((walk_state->opcode == AML_COPY_OP) || !implicit_conversion) {
|
||||
/*
|
||||
* However, copy_object and Stores to arg_x do not perform
|
||||
* an implicit conversion, as per the ACPI specification.
|
||||
* A direct store is performed instead.
|
||||
*/
|
||||
status = acpi_ex_store_direct_to_node(source_desc, node,
|
||||
walk_state);
|
||||
break;
|
||||
}
|
||||
|
||||
/* Store with implicit source operand conversion support */
|
||||
|
||||
status =
|
||||
acpi_ex_store_object_to_object(source_desc, target_desc,
|
||||
&new_desc, walk_state);
|
||||
@@ -467,13 +461,12 @@ acpi_ex_store_object_to_node(union acpi_operand_object *source_desc,
|
||||
* the Name's type to that of the value being stored in it.
|
||||
* source_desc reference count is incremented by attach_object.
|
||||
*
|
||||
* Note: This may change the type of the node if an explicit store
|
||||
* has been performed such that the node/object type has been
|
||||
* changed.
|
||||
* Note: This may change the type of the node if an explicit
|
||||
* store has been performed such that the node/object type
|
||||
* has been changed.
|
||||
*/
|
||||
status =
|
||||
acpi_ns_attach_object(node, new_desc,
|
||||
new_desc->common.type);
|
||||
status = acpi_ns_attach_object(node, new_desc,
|
||||
new_desc->common.type);
|
||||
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
|
||||
"Store %s into %s via Convert/Attach\n",
|
||||
@@ -484,38 +477,83 @@ acpi_ex_store_object_to_node(union acpi_operand_object *source_desc,
|
||||
}
|
||||
break;
|
||||
|
||||
case ACPI_TYPE_BUFFER_FIELD:
|
||||
case ACPI_TYPE_LOCAL_REGION_FIELD:
|
||||
case ACPI_TYPE_LOCAL_BANK_FIELD:
|
||||
case ACPI_TYPE_LOCAL_INDEX_FIELD:
|
||||
/*
|
||||
* For all fields, always write the source data to the target
|
||||
* field. Any required implicit source operand conversion is
|
||||
* performed in the function below as necessary. Note, field
|
||||
* objects must retain their original type permanently.
|
||||
*/
|
||||
status = acpi_ex_write_data_to_field(source_desc, target_desc,
|
||||
&walk_state->result_obj);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
|
||||
"Storing [%s] (%p) directly into node [%s] (%p)"
|
||||
" with no implicit conversion\n",
|
||||
acpi_ut_get_object_type_name(source_desc),
|
||||
source_desc,
|
||||
acpi_ut_get_object_type_name(target_desc),
|
||||
node));
|
||||
|
||||
/*
|
||||
* No conversions for all other types. Directly store a copy of
|
||||
* the source object. NOTE: This is a departure from the ACPI
|
||||
* spec, which states "If conversion is impossible, abort the
|
||||
* running control method".
|
||||
* the source object. This is the ACPI spec-defined behavior for
|
||||
* the copy_object operator.
|
||||
*
|
||||
* This code implements "If conversion is impossible, treat the
|
||||
* Store operation as a CopyObject".
|
||||
* NOTE: For the Store operator, this is a departure from the
|
||||
* ACPI spec, which states "If conversion is impossible, abort
|
||||
* the running control method". Instead, this code implements
|
||||
* "If conversion is impossible, treat the Store operation as
|
||||
* a CopyObject".
|
||||
*/
|
||||
status =
|
||||
acpi_ut_copy_iobject_to_iobject(source_desc, &new_desc,
|
||||
walk_state);
|
||||
if (ACPI_FAILURE(status)) {
|
||||
return_ACPI_STATUS(status);
|
||||
}
|
||||
|
||||
status =
|
||||
acpi_ns_attach_object(node, new_desc,
|
||||
new_desc->common.type);
|
||||
acpi_ut_remove_reference(new_desc);
|
||||
status = acpi_ex_store_direct_to_node(source_desc, node,
|
||||
walk_state);
|
||||
break;
|
||||
}
|
||||
|
||||
return_ACPI_STATUS(status);
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: acpi_ex_store_direct_to_node
|
||||
*
|
||||
* PARAMETERS: source_desc - Value to be stored
|
||||
* node - Named object to receive the value
|
||||
* walk_state - Current walk state
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: "Store" an object directly to a node. This involves a copy
|
||||
* and an attach.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static acpi_status
|
||||
acpi_ex_store_direct_to_node(union acpi_operand_object *source_desc,
|
||||
struct acpi_namespace_node *node,
|
||||
struct acpi_walk_state *walk_state)
|
||||
{
|
||||
acpi_status status;
|
||||
union acpi_operand_object *new_desc;
|
||||
|
||||
ACPI_FUNCTION_TRACE(ex_store_direct_to_node);
|
||||
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
|
||||
"Storing [%s] (%p) directly into node [%s] (%p)"
|
||||
" with no implicit conversion\n",
|
||||
acpi_ut_get_object_type_name(source_desc),
|
||||
source_desc, acpi_ut_get_type_name(node->type),
|
||||
node));
|
||||
|
||||
/* Copy the source object to a new object */
|
||||
|
||||
status =
|
||||
acpi_ut_copy_iobject_to_iobject(source_desc, &new_desc, walk_state);
|
||||
if (ACPI_FAILURE(status)) {
|
||||
return_ACPI_STATUS(status);
|
||||
}
|
||||
|
||||
/* Attach the new object to the node */
|
||||
|
||||
status = acpi_ns_attach_object(node, new_desc, new_desc->common.type);
|
||||
acpi_ut_remove_reference(new_desc);
|
||||
return_ACPI_STATUS(status);
|
||||
}
|
||||
|
||||
@@ -636,9 +636,12 @@ static void handle_root_bridge_removal(struct acpi_device *device)
|
||||
ej_event->device = device;
|
||||
ej_event->event = ACPI_NOTIFY_EJECT_REQUEST;
|
||||
|
||||
get_device(&device->dev);
|
||||
status = acpi_os_hotplug_execute(acpi_bus_hot_remove_device, ej_event);
|
||||
if (ACPI_FAILURE(status))
|
||||
if (ACPI_FAILURE(status)) {
|
||||
put_device(&device->dev);
|
||||
kfree(ej_event);
|
||||
}
|
||||
}
|
||||
|
||||
static void _handle_hotplug_event_root(struct work_struct *work)
|
||||
|
||||
@@ -121,17 +121,10 @@ static struct dmi_system_id __cpuinitdata processor_power_dmi_table[] = {
|
||||
*/
|
||||
static void acpi_safe_halt(void)
|
||||
{
|
||||
current_thread_info()->status &= ~TS_POLLING;
|
||||
/*
|
||||
* TS_POLLING-cleared state must be visible before we
|
||||
* test NEED_RESCHED:
|
||||
*/
|
||||
smp_mb();
|
||||
if (!need_resched()) {
|
||||
if (!tif_need_resched()) {
|
||||
safe_halt();
|
||||
local_irq_disable();
|
||||
}
|
||||
current_thread_info()->status |= TS_POLLING;
|
||||
}
|
||||
|
||||
#ifdef ARCH_APICTIMER_STOPS_ON_C3
|
||||
@@ -739,6 +732,11 @@ static int acpi_idle_enter_c1(struct cpuidle_device *dev,
|
||||
if (unlikely(!pr))
|
||||
return -EINVAL;
|
||||
|
||||
if (cx->entry_method == ACPI_CSTATE_FFH) {
|
||||
if (current_set_polling_and_test())
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
lapic_timer_state_broadcast(pr, cx, 1);
|
||||
acpi_idle_do_entry(cx);
|
||||
|
||||
@@ -792,18 +790,9 @@ static int acpi_idle_enter_simple(struct cpuidle_device *dev,
|
||||
if (unlikely(!pr))
|
||||
return -EINVAL;
|
||||
|
||||
if (cx->entry_method != ACPI_CSTATE_FFH) {
|
||||
current_thread_info()->status &= ~TS_POLLING;
|
||||
/*
|
||||
* TS_POLLING-cleared state must be visible before we test
|
||||
* NEED_RESCHED:
|
||||
*/
|
||||
smp_mb();
|
||||
|
||||
if (unlikely(need_resched())) {
|
||||
current_thread_info()->status |= TS_POLLING;
|
||||
if (cx->entry_method == ACPI_CSTATE_FFH) {
|
||||
if (current_set_polling_and_test())
|
||||
return -EINVAL;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -821,9 +810,6 @@ static int acpi_idle_enter_simple(struct cpuidle_device *dev,
|
||||
|
||||
sched_clock_idle_wakeup_event(0);
|
||||
|
||||
if (cx->entry_method != ACPI_CSTATE_FFH)
|
||||
current_thread_info()->status |= TS_POLLING;
|
||||
|
||||
lapic_timer_state_broadcast(pr, cx, 0);
|
||||
return index;
|
||||
}
|
||||
@@ -860,18 +846,9 @@ static int acpi_idle_enter_bm(struct cpuidle_device *dev,
|
||||
}
|
||||
}
|
||||
|
||||
if (cx->entry_method != ACPI_CSTATE_FFH) {
|
||||
current_thread_info()->status &= ~TS_POLLING;
|
||||
/*
|
||||
* TS_POLLING-cleared state must be visible before we test
|
||||
* NEED_RESCHED:
|
||||
*/
|
||||
smp_mb();
|
||||
|
||||
if (unlikely(need_resched())) {
|
||||
current_thread_info()->status |= TS_POLLING;
|
||||
if (cx->entry_method == ACPI_CSTATE_FFH) {
|
||||
if (current_set_polling_and_test())
|
||||
return -EINVAL;
|
||||
}
|
||||
}
|
||||
|
||||
acpi_unlazy_tlb(smp_processor_id());
|
||||
@@ -917,9 +894,6 @@ static int acpi_idle_enter_bm(struct cpuidle_device *dev,
|
||||
|
||||
sched_clock_idle_wakeup_event(0);
|
||||
|
||||
if (cx->entry_method != ACPI_CSTATE_FFH)
|
||||
current_thread_info()->status |= TS_POLLING;
|
||||
|
||||
lapic_timer_state_broadcast(pr, cx, 0);
|
||||
return index;
|
||||
}
|
||||
|
||||
@@ -244,8 +244,6 @@ static void acpi_scan_bus_device_check(acpi_handle handle, u32 ost_source)
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
acpi_evaluate_hotplug_ost(handle, ost_source,
|
||||
ACPI_OST_SC_INSERT_IN_PROGRESS, NULL);
|
||||
error = acpi_bus_scan(handle);
|
||||
if (error) {
|
||||
acpi_handle_warn(handle, "Namespace scan failure\n");
|
||||
|
||||
@@ -846,7 +846,7 @@ acpi_video_init_brightness(struct acpi_video_device *device)
|
||||
for (i = 2; i < br->count; i++)
|
||||
if (level_old == br->levels[i])
|
||||
break;
|
||||
if (i == br->count)
|
||||
if (i == br->count || !level)
|
||||
level = max_level;
|
||||
}
|
||||
|
||||
|
||||
@@ -545,7 +545,7 @@ static struct kobject *brd_probe(dev_t dev, int *part, void *data)
|
||||
|
||||
mutex_lock(&brd_devices_mutex);
|
||||
brd = brd_init_one(MINOR(dev) >> part_shift);
|
||||
kobj = brd ? get_disk(brd->brd_disk) : ERR_PTR(-ENOMEM);
|
||||
kobj = brd ? get_disk(brd->brd_disk) : NULL;
|
||||
mutex_unlock(&brd_devices_mutex);
|
||||
|
||||
*part = 0;
|
||||
|
||||
@@ -1747,7 +1747,7 @@ static struct kobject *loop_probe(dev_t dev, int *part, void *data)
|
||||
if (err < 0)
|
||||
err = loop_add(&lo, MINOR(dev) >> part_shift);
|
||||
if (err < 0)
|
||||
kobj = ERR_PTR(err);
|
||||
kobj = NULL;
|
||||
else
|
||||
kobj = get_disk(lo->lo_disk);
|
||||
mutex_unlock(&loop_index_mutex);
|
||||
|
||||
@@ -724,6 +724,30 @@ static const struct dmi_system_id intel_no_lvds[] = {
|
||||
DMI_EXACT_MATCH(DMI_BOARD_NAME, "D525MW"),
|
||||
},
|
||||
},
|
||||
{
|
||||
.callback = intel_no_lvds_dmi_callback,
|
||||
.ident = "Intel D410PT",
|
||||
.matches = {
|
||||
DMI_MATCH(DMI_BOARD_VENDOR, "Intel"),
|
||||
DMI_MATCH(DMI_BOARD_NAME, "D410PT"),
|
||||
},
|
||||
},
|
||||
{
|
||||
.callback = intel_no_lvds_dmi_callback,
|
||||
.ident = "Intel D425KT",
|
||||
.matches = {
|
||||
DMI_MATCH(DMI_BOARD_VENDOR, "Intel"),
|
||||
DMI_EXACT_MATCH(DMI_BOARD_NAME, "D425KT"),
|
||||
},
|
||||
},
|
||||
{
|
||||
.callback = intel_no_lvds_dmi_callback,
|
||||
.ident = "Intel D510MO",
|
||||
.matches = {
|
||||
DMI_MATCH(DMI_BOARD_VENDOR, "Intel"),
|
||||
DMI_EXACT_MATCH(DMI_BOARD_NAME, "D510MO"),
|
||||
},
|
||||
},
|
||||
|
||||
{ } /* terminating entry */
|
||||
};
|
||||
|
||||
@@ -297,7 +297,7 @@ static const struct lm90_params lm90_params[] = {
|
||||
[max6696] = {
|
||||
.flags = LM90_HAVE_EMERGENCY
|
||||
| LM90_HAVE_EMERGENCY_ALARM | LM90_HAVE_TEMP3,
|
||||
.alert_alarms = 0x187c,
|
||||
.alert_alarms = 0x1c7c,
|
||||
.max_convrate = 6,
|
||||
.reg_local_ext = MAX6657_REG_R_LOCAL_TEMPL,
|
||||
},
|
||||
@@ -1666,19 +1666,22 @@ static void lm90_alert(struct i2c_client *client, unsigned int flag)
|
||||
if ((alarms & 0x7f) == 0 && (alarms2 & 0xfe) == 0) {
|
||||
dev_info(&client->dev, "Everything OK\n");
|
||||
} else {
|
||||
if (alarms & 0x61)
|
||||
if ((alarms & 0x61) || (alarms2 & 0x80))
|
||||
dev_warn(&client->dev,
|
||||
"temp%d out of range, please check!\n", 1);
|
||||
if (alarms & 0x1a)
|
||||
if ((alarms & 0x1a) || (alarms2 & 0x20))
|
||||
dev_warn(&client->dev,
|
||||
"temp%d out of range, please check!\n", 2);
|
||||
if (alarms & 0x04)
|
||||
dev_warn(&client->dev,
|
||||
"temp%d diode open, please check!\n", 2);
|
||||
|
||||
if (alarms2 & 0x18)
|
||||
if (alarms2 & 0x5a)
|
||||
dev_warn(&client->dev,
|
||||
"temp%d out of range, please check!\n", 3);
|
||||
if (alarms2 & 0x04)
|
||||
dev_warn(&client->dev,
|
||||
"temp%d diode open, please check!\n", 3);
|
||||
|
||||
/*
|
||||
* Disable ALERT# output, because these chips don't implement
|
||||
|
||||
@@ -407,7 +407,7 @@ static int intel_idle(struct cpuidle_device *dev,
|
||||
if (!(lapic_timer_reliable_states & (1 << (cstate))))
|
||||
clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_ENTER, &cpu);
|
||||
|
||||
if (!need_resched()) {
|
||||
if (!current_set_polling_and_test()) {
|
||||
|
||||
__monitor((void *)¤t_thread_info()->flags, 0, 0);
|
||||
smp_mb();
|
||||
|
||||
@@ -485,8 +485,11 @@ int mei_nfc_host_init(struct mei_device *dev)
|
||||
if (ndev->cl_info)
|
||||
return 0;
|
||||
|
||||
cl_info = mei_cl_allocate(dev);
|
||||
cl = mei_cl_allocate(dev);
|
||||
ndev->cl_info = mei_cl_allocate(dev);
|
||||
ndev->cl = mei_cl_allocate(dev);
|
||||
|
||||
cl = ndev->cl;
|
||||
cl_info = ndev->cl_info;
|
||||
|
||||
if (!cl || !cl_info) {
|
||||
ret = -ENOMEM;
|
||||
@@ -527,10 +530,9 @@ int mei_nfc_host_init(struct mei_device *dev)
|
||||
|
||||
cl->device_uuid = mei_nfc_guid;
|
||||
|
||||
|
||||
list_add_tail(&cl->device_link, &dev->device_list);
|
||||
|
||||
ndev->cl_info = cl_info;
|
||||
ndev->cl = cl;
|
||||
ndev->req_id = 1;
|
||||
|
||||
INIT_WORK(&ndev->init_work, mei_nfc_init);
|
||||
|
||||
@@ -814,9 +814,6 @@ static int c_can_do_rx_poll(struct net_device *dev, int quota)
|
||||
msg_ctrl_save = priv->read_reg(priv,
|
||||
C_CAN_IFACE(MSGCTRL_REG, 0));
|
||||
|
||||
if (msg_ctrl_save & IF_MCONT_EOB)
|
||||
return num_rx_pkts;
|
||||
|
||||
if (msg_ctrl_save & IF_MCONT_MSGLST) {
|
||||
c_can_handle_lost_msg_obj(dev, 0, msg_obj);
|
||||
num_rx_pkts++;
|
||||
@@ -824,6 +821,9 @@ static int c_can_do_rx_poll(struct net_device *dev, int quota)
|
||||
continue;
|
||||
}
|
||||
|
||||
if (msg_ctrl_save & IF_MCONT_EOB)
|
||||
return num_rx_pkts;
|
||||
|
||||
if (!(msg_ctrl_save & IF_MCONT_NEWDAT))
|
||||
continue;
|
||||
|
||||
|
||||
@@ -1544,9 +1544,9 @@ static int kvaser_usb_init_one(struct usb_interface *intf,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void kvaser_usb_get_endpoints(const struct usb_interface *intf,
|
||||
struct usb_endpoint_descriptor **in,
|
||||
struct usb_endpoint_descriptor **out)
|
||||
static int kvaser_usb_get_endpoints(const struct usb_interface *intf,
|
||||
struct usb_endpoint_descriptor **in,
|
||||
struct usb_endpoint_descriptor **out)
|
||||
{
|
||||
const struct usb_host_interface *iface_desc;
|
||||
struct usb_endpoint_descriptor *endpoint;
|
||||
@@ -1557,12 +1557,18 @@ static void kvaser_usb_get_endpoints(const struct usb_interface *intf,
|
||||
for (i = 0; i < iface_desc->desc.bNumEndpoints; ++i) {
|
||||
endpoint = &iface_desc->endpoint[i].desc;
|
||||
|
||||
if (usb_endpoint_is_bulk_in(endpoint))
|
||||
if (!*in && usb_endpoint_is_bulk_in(endpoint))
|
||||
*in = endpoint;
|
||||
|
||||
if (usb_endpoint_is_bulk_out(endpoint))
|
||||
if (!*out && usb_endpoint_is_bulk_out(endpoint))
|
||||
*out = endpoint;
|
||||
|
||||
/* use first bulk endpoint for in and out */
|
||||
if (*in && *out)
|
||||
return 0;
|
||||
}
|
||||
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
static int kvaser_usb_probe(struct usb_interface *intf,
|
||||
@@ -1576,8 +1582,8 @@ static int kvaser_usb_probe(struct usb_interface *intf,
|
||||
if (!dev)
|
||||
return -ENOMEM;
|
||||
|
||||
kvaser_usb_get_endpoints(intf, &dev->bulk_in, &dev->bulk_out);
|
||||
if (!dev->bulk_in || !dev->bulk_out) {
|
||||
err = kvaser_usb_get_endpoints(intf, &dev->bulk_in, &dev->bulk_out);
|
||||
if (err) {
|
||||
dev_err(&intf->dev, "Cannot get usb endpoint(s)");
|
||||
return err;
|
||||
}
|
||||
|
||||
@@ -3400,10 +3400,13 @@ void rt2800_link_tuner(struct rt2x00_dev *rt2x00dev, struct link_qual *qual,
|
||||
|
||||
vgc = rt2800_get_default_vgc(rt2x00dev);
|
||||
|
||||
if (rt2x00_rt(rt2x00dev, RT5592) && qual->rssi > -65)
|
||||
vgc += 0x20;
|
||||
else if (qual->rssi > -80)
|
||||
vgc += 0x10;
|
||||
if (rt2x00_rt(rt2x00dev, RT5592)) {
|
||||
if (qual->rssi > -65)
|
||||
vgc += 0x20;
|
||||
} else {
|
||||
if (qual->rssi > -80)
|
||||
vgc += 0x10;
|
||||
}
|
||||
|
||||
rt2800_set_vgc(rt2x00dev, qual, vgc);
|
||||
}
|
||||
|
||||
@@ -148,6 +148,8 @@ static bool rt2800usb_txstatus_timeout(struct rt2x00_dev *rt2x00dev)
|
||||
return false;
|
||||
}
|
||||
|
||||
#define TXSTATUS_READ_INTERVAL 1000000
|
||||
|
||||
static bool rt2800usb_tx_sta_fifo_read_completed(struct rt2x00_dev *rt2x00dev,
|
||||
int urb_status, u32 tx_status)
|
||||
{
|
||||
@@ -176,8 +178,9 @@ static bool rt2800usb_tx_sta_fifo_read_completed(struct rt2x00_dev *rt2x00dev,
|
||||
queue_work(rt2x00dev->workqueue, &rt2x00dev->txdone_work);
|
||||
|
||||
if (rt2800usb_txstatus_pending(rt2x00dev)) {
|
||||
/* Read register after 250 us */
|
||||
hrtimer_start(&rt2x00dev->txstatus_timer, ktime_set(0, 250000),
|
||||
/* Read register after 1 ms */
|
||||
hrtimer_start(&rt2x00dev->txstatus_timer,
|
||||
ktime_set(0, TXSTATUS_READ_INTERVAL),
|
||||
HRTIMER_MODE_REL);
|
||||
return false;
|
||||
}
|
||||
@@ -202,8 +205,9 @@ static void rt2800usb_async_read_tx_status(struct rt2x00_dev *rt2x00dev)
|
||||
if (test_and_set_bit(TX_STATUS_READING, &rt2x00dev->flags))
|
||||
return;
|
||||
|
||||
/* Read TX_STA_FIFO register after 500 us */
|
||||
hrtimer_start(&rt2x00dev->txstatus_timer, ktime_set(0, 500000),
|
||||
/* Read TX_STA_FIFO register after 2 ms */
|
||||
hrtimer_start(&rt2x00dev->txstatus_timer,
|
||||
ktime_set(0, 2*TXSTATUS_READ_INTERVAL),
|
||||
HRTIMER_MODE_REL);
|
||||
}
|
||||
|
||||
|
||||
@@ -181,6 +181,7 @@ static void rt2x00lib_autowakeup(struct work_struct *work)
|
||||
static void rt2x00lib_bc_buffer_iter(void *data, u8 *mac,
|
||||
struct ieee80211_vif *vif)
|
||||
{
|
||||
struct ieee80211_tx_control control = {};
|
||||
struct rt2x00_dev *rt2x00dev = data;
|
||||
struct sk_buff *skb;
|
||||
|
||||
@@ -195,7 +196,7 @@ static void rt2x00lib_bc_buffer_iter(void *data, u8 *mac,
|
||||
*/
|
||||
skb = ieee80211_get_buffered_bc(rt2x00dev->hw, vif);
|
||||
while (skb) {
|
||||
rt2x00mac_tx(rt2x00dev->hw, NULL, skb);
|
||||
rt2x00mac_tx(rt2x00dev->hw, &control, skb);
|
||||
skb = ieee80211_get_buffered_bc(rt2x00dev->hw, vif);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -146,7 +146,7 @@ void rt2x00queue_remove_l2pad(struct sk_buff *skb, unsigned int header_length);
|
||||
* @local: frame is not from mac80211
|
||||
*/
|
||||
int rt2x00queue_write_tx_frame(struct data_queue *queue, struct sk_buff *skb,
|
||||
bool local);
|
||||
struct ieee80211_sta *sta, bool local);
|
||||
|
||||
/**
|
||||
* rt2x00queue_update_beacon - Send new beacon from mac80211
|
||||
|
||||
@@ -90,7 +90,7 @@ static int rt2x00mac_tx_rts_cts(struct rt2x00_dev *rt2x00dev,
|
||||
frag_skb->data, data_length, tx_info,
|
||||
(struct ieee80211_rts *)(skb->data));
|
||||
|
||||
retval = rt2x00queue_write_tx_frame(queue, skb, true);
|
||||
retval = rt2x00queue_write_tx_frame(queue, skb, NULL, true);
|
||||
if (retval) {
|
||||
dev_kfree_skb_any(skb);
|
||||
rt2x00_warn(rt2x00dev, "Failed to send RTS/CTS frame\n");
|
||||
@@ -151,7 +151,7 @@ void rt2x00mac_tx(struct ieee80211_hw *hw,
|
||||
goto exit_fail;
|
||||
}
|
||||
|
||||
if (unlikely(rt2x00queue_write_tx_frame(queue, skb, false)))
|
||||
if (unlikely(rt2x00queue_write_tx_frame(queue, skb, control->sta, false)))
|
||||
goto exit_fail;
|
||||
|
||||
/*
|
||||
@@ -754,6 +754,9 @@ void rt2x00mac_flush(struct ieee80211_hw *hw, u32 queues, bool drop)
|
||||
struct rt2x00_dev *rt2x00dev = hw->priv;
|
||||
struct data_queue *queue;
|
||||
|
||||
if (!test_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags))
|
||||
return;
|
||||
|
||||
tx_queue_for_each(rt2x00dev, queue)
|
||||
rt2x00queue_flush_queue(queue, drop);
|
||||
}
|
||||
|
||||
@@ -635,7 +635,7 @@ static void rt2x00queue_bar_check(struct queue_entry *entry)
|
||||
}
|
||||
|
||||
int rt2x00queue_write_tx_frame(struct data_queue *queue, struct sk_buff *skb,
|
||||
bool local)
|
||||
struct ieee80211_sta *sta, bool local)
|
||||
{
|
||||
struct ieee80211_tx_info *tx_info;
|
||||
struct queue_entry *entry;
|
||||
@@ -649,7 +649,7 @@ int rt2x00queue_write_tx_frame(struct data_queue *queue, struct sk_buff *skb,
|
||||
* after that we are free to use the skb->cb array
|
||||
* for our information.
|
||||
*/
|
||||
rt2x00queue_create_tx_descriptor(queue->rt2x00dev, skb, &txdesc, NULL);
|
||||
rt2x00queue_create_tx_descriptor(queue->rt2x00dev, skb, &txdesc, sta);
|
||||
|
||||
/*
|
||||
* All information is retrieved from the skb->cb array,
|
||||
|
||||
@@ -484,28 +484,29 @@ static inline bool pcie_cap_has_lnkctl(const struct pci_dev *dev)
|
||||
{
|
||||
int type = pci_pcie_type(dev);
|
||||
|
||||
return pcie_cap_version(dev) > 1 ||
|
||||
return type == PCI_EXP_TYPE_ENDPOINT ||
|
||||
type == PCI_EXP_TYPE_LEG_END ||
|
||||
type == PCI_EXP_TYPE_ROOT_PORT ||
|
||||
type == PCI_EXP_TYPE_ENDPOINT ||
|
||||
type == PCI_EXP_TYPE_LEG_END;
|
||||
type == PCI_EXP_TYPE_UPSTREAM ||
|
||||
type == PCI_EXP_TYPE_DOWNSTREAM ||
|
||||
type == PCI_EXP_TYPE_PCI_BRIDGE ||
|
||||
type == PCI_EXP_TYPE_PCIE_BRIDGE;
|
||||
}
|
||||
|
||||
static inline bool pcie_cap_has_sltctl(const struct pci_dev *dev)
|
||||
{
|
||||
int type = pci_pcie_type(dev);
|
||||
|
||||
return pcie_cap_version(dev) > 1 ||
|
||||
type == PCI_EXP_TYPE_ROOT_PORT ||
|
||||
(type == PCI_EXP_TYPE_DOWNSTREAM &&
|
||||
pcie_caps_reg(dev) & PCI_EXP_FLAGS_SLOT);
|
||||
return (type == PCI_EXP_TYPE_ROOT_PORT ||
|
||||
type == PCI_EXP_TYPE_DOWNSTREAM) &&
|
||||
pcie_caps_reg(dev) & PCI_EXP_FLAGS_SLOT;
|
||||
}
|
||||
|
||||
static inline bool pcie_cap_has_rtctl(const struct pci_dev *dev)
|
||||
{
|
||||
int type = pci_pcie_type(dev);
|
||||
|
||||
return pcie_cap_version(dev) > 1 ||
|
||||
type == PCI_EXP_TYPE_ROOT_PORT ||
|
||||
return type == PCI_EXP_TYPE_ROOT_PORT ||
|
||||
type == PCI_EXP_TYPE_RC_EC;
|
||||
}
|
||||
|
||||
|
||||
@@ -510,7 +510,8 @@ static int aac_send_raw_srb(struct aac_dev* dev, void __user * arg)
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (fibsize > (dev->max_fib_size - sizeof(struct aac_fibhdr))) {
|
||||
if ((fibsize < (sizeof(struct user_aac_srb) - sizeof(struct user_sgentry))) ||
|
||||
(fibsize > (dev->max_fib_size - sizeof(struct aac_fibhdr)))) {
|
||||
rcode = -EINVAL;
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
@@ -1593,7 +1593,11 @@ static int mos7840_tiocmget(struct tty_struct *tty)
|
||||
return -ENODEV;
|
||||
|
||||
status = mos7840_get_uart_reg(port, MODEM_STATUS_REGISTER, &msr);
|
||||
if (status != 1)
|
||||
return -EIO;
|
||||
status = mos7840_get_uart_reg(port, MODEM_CONTROL_REGISTER, &mcr);
|
||||
if (status != 1)
|
||||
return -EIO;
|
||||
result = ((mcr & MCR_DTR) ? TIOCM_DTR : 0)
|
||||
| ((mcr & MCR_RTS) ? TIOCM_RTS : 0)
|
||||
| ((mcr & MCR_LOOPBACK) ? TIOCM_LOOP : 0)
|
||||
|
||||
Reference in New Issue
Block a user