Merge commit 'v2.6.37-rc8' into perf/core

Merge reason: pick up latest -rc.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
This commit is contained in:
Ingo Molnar 2011-01-04 08:08:51 +01:00
commit cc22219699
176 changed files with 1532 additions and 783 deletions

View File

@ -516,6 +516,7 @@ int main(int argc, char *argv[])
default: default:
fprintf(stderr, "Unknown nla_type %d\n", fprintf(stderr, "Unknown nla_type %d\n",
na->nla_type); na->nla_type);
case TASKSTATS_TYPE_NULL:
break; break;
} }
na = (struct nlattr *) (GENLMSG_DATA(&msg) + len); na = (struct nlattr *) (GENLMSG_DATA(&msg) + len);

View File

@ -1044,9 +1044,9 @@ Details:
/** /**
* queuecommand - queue scsi command, invoke 'done' on completion * queuecommand - queue scsi command, invoke scp->scsi_done on completion
* @shost: pointer to the scsi host object
* @scp: pointer to scsi command object * @scp: pointer to scsi command object
* @done: function pointer to be invoked on completion
* *
* Returns 0 on success. * Returns 0 on success.
* *
@ -1074,42 +1074,45 @@ Details:
* *
* Other types of errors that are detected immediately may be * Other types of errors that are detected immediately may be
* flagged by setting scp->result to an appropriate value, * flagged by setting scp->result to an appropriate value,
* invoking the 'done' callback, and then returning 0 from this * invoking the scp->scsi_done callback, and then returning 0
* function. If the command is not performed immediately (and the * from this function. If the command is not performed
* LLD is starting (or will start) the given command) then this * immediately (and the LLD is starting (or will start) the given
* function should place 0 in scp->result and return 0. * command) then this function should place 0 in scp->result and
* return 0.
* *
* Command ownership. If the driver returns zero, it owns the * Command ownership. If the driver returns zero, it owns the
* command and must take responsibility for ensuring the 'done' * command and must take responsibility for ensuring the
* callback is executed. Note: the driver may call done before * scp->scsi_done callback is executed. Note: the driver may
* returning zero, but after it has called done, it may not * call scp->scsi_done before returning zero, but after it has
* return any value other than zero. If the driver makes a * called scp->scsi_done, it may not return any value other than
* non-zero return, it must not execute the command's done * zero. If the driver makes a non-zero return, it must not
* callback at any time. * execute the command's scsi_done callback at any time.
* *
* Locks: struct Scsi_Host::host_lock held on entry (with "irqsave") * Locks: up to and including 2.6.36, struct Scsi_Host::host_lock
* and is expected to be held on return. * held on entry (with "irqsave") and is expected to be
* held on return. From 2.6.37 onwards, queuecommand is
* called without any locks held.
* *
* Calling context: in interrupt (soft irq) or process context * Calling context: in interrupt (soft irq) or process context
* *
* Notes: This function should be relatively fast. Normally it will * Notes: This function should be relatively fast. Normally it
* not wait for IO to complete. Hence the 'done' callback is invoked * will not wait for IO to complete. Hence the scp->scsi_done
* (often directly from an interrupt service routine) some time after * callback is invoked (often directly from an interrupt service
* this function has returned. In some cases (e.g. pseudo adapter * routine) some time after this function has returned. In some
* drivers that manufacture the response to a SCSI INQUIRY) * cases (e.g. pseudo adapter drivers that manufacture the
* the 'done' callback may be invoked before this function returns. * response to a SCSI INQUIRY) the scp->scsi_done callback may be
* If the 'done' callback is not invoked within a certain period * invoked before this function returns. If the scp->scsi_done
* the SCSI mid level will commence error processing. * callback is not invoked within a certain period the SCSI mid
* If a status of CHECK CONDITION is placed in "result" when the * level will commence error processing. If a status of CHECK
* 'done' callback is invoked, then the LLD driver should * CONDITION is placed in "result" when the scp->scsi_done
* perform autosense and fill in the struct scsi_cmnd::sense_buffer * callback is invoked, then the LLD driver should perform
* autosense and fill in the struct scsi_cmnd::sense_buffer
* array. The scsi_cmnd::sense_buffer array is zeroed prior to * array. The scsi_cmnd::sense_buffer array is zeroed prior to
* the mid level queuing a command to an LLD. * the mid level queuing a command to an LLD.
* *
* Defined in: LLD * Defined in: LLD
**/ **/
int queuecommand(struct scsi_cmnd * scp, int queuecommand(struct Scsi_Host *shost, struct scsi_cmnd * scp)
void (*done)(struct scsi_cmnd *))
/** /**

View File

@ -373,9 +373,18 @@ EVENT_PROCESS:
print " $regex_lru_isolate/o\n"; print " $regex_lru_isolate/o\n";
next; next;
} }
my $isolate_mode = $1;
my $nr_scanned = $4; my $nr_scanned = $4;
my $nr_contig_dirty = $7; my $nr_contig_dirty = $7;
# To closer match vmstat scanning statistics, only count isolate_both
# and isolate_inactive as scanning. isolate_active is rotation
# isolate_inactive == 0
# isolate_active == 1
# isolate_both == 2
if ($isolate_mode != 1) {
$perprocesspid{$process_pid}->{HIGH_NR_SCANNED} += $nr_scanned; $perprocesspid{$process_pid}->{HIGH_NR_SCANNED} += $nr_scanned;
}
$perprocesspid{$process_pid}->{HIGH_NR_CONTIG_DIRTY} += $nr_contig_dirty; $perprocesspid{$process_pid}->{HIGH_NR_CONTIG_DIRTY} += $nr_contig_dirty;
} elsif ($tracepoint eq "mm_vmscan_lru_shrink_inactive") { } elsif ($tracepoint eq "mm_vmscan_lru_shrink_inactive") {
$details = $5; $details = $5;

View File

@ -405,7 +405,7 @@ S: Supported
F: drivers/usb/gadget/amd5536udc.* F: drivers/usb/gadget/amd5536udc.*
AMD GEODE PROCESSOR/CHIPSET SUPPORT AMD GEODE PROCESSOR/CHIPSET SUPPORT
P: Jordan Crouse P: Andres Salomon <dilinger@queued.net>
L: linux-geode@lists.infradead.org (moderated for non-subscribers) L: linux-geode@lists.infradead.org (moderated for non-subscribers)
W: http://www.amd.com/us-en/ConnectivitySolutions/TechnicalResources/0,,50_2334_2452_11363,00.html W: http://www.amd.com/us-en/ConnectivitySolutions/TechnicalResources/0,,50_2334_2452_11363,00.html
S: Supported S: Supported
@ -4590,7 +4590,7 @@ F: drivers/pcmcia/
F: include/pcmcia/ F: include/pcmcia/
PCNET32 NETWORK DRIVER PCNET32 NETWORK DRIVER
M: Don Fry <pcnet32@verizon.net> M: Don Fry <pcnet32@frontier.com>
L: netdev@vger.kernel.org L: netdev@vger.kernel.org
S: Maintained S: Maintained
F: drivers/net/pcnet32.c F: drivers/net/pcnet32.c

View File

@ -1,7 +1,7 @@
VERSION = 2 VERSION = 2
PATCHLEVEL = 6 PATCHLEVEL = 6
SUBLEVEL = 37 SUBLEVEL = 37
EXTRAVERSION = -rc7 EXTRAVERSION = -rc8
NAME = Flesh-Eating Bats with Fangs NAME = Flesh-Eating Bats with Fangs
# *DOCUMENTATION* # *DOCUMENTATION*

View File

@ -352,3 +352,4 @@ struct pci_bus * __init it8152_pci_scan_bus(int nr, struct pci_sys_data *sys)
return pci_scan_bus(nr, &it8152_ops, sys); return pci_scan_bus(nr, &it8152_ops, sys);
} }
EXPORT_SYMBOL(dma_set_coherent_mask);

View File

@ -74,6 +74,8 @@
#define AT91_MCI_TRTYP_BLOCK (0 << 19) #define AT91_MCI_TRTYP_BLOCK (0 << 19)
#define AT91_MCI_TRTYP_MULTIPLE (1 << 19) #define AT91_MCI_TRTYP_MULTIPLE (1 << 19)
#define AT91_MCI_TRTYP_STREAM (2 << 19) #define AT91_MCI_TRTYP_STREAM (2 << 19)
#define AT91_MCI_TRTYP_SDIO_BYTE (4 << 19)
#define AT91_MCI_TRTYP_SDIO_BLOCK (5 << 19)
#define AT91_MCI_BLKR 0x18 /* Block Register */ #define AT91_MCI_BLKR 0x18 /* Block Register */
#define AT91_MCI_BLKR_BCNT(n) ((0xffff & (n)) << 0) /* Block count */ #define AT91_MCI_BLKR_BCNT(n) ((0xffff & (n)) << 0) /* Block count */

View File

@ -513,4 +513,4 @@ int dma_set_coherent_mask(struct device *dev, u64 mask)
EXPORT_SYMBOL(ixp4xx_pci_read); EXPORT_SYMBOL(ixp4xx_pci_read);
EXPORT_SYMBOL(ixp4xx_pci_write); EXPORT_SYMBOL(ixp4xx_pci_write);
EXPORT_SYMBOL(dma_set_coherent_mask);

View File

@ -63,6 +63,7 @@
#include <linux/of_gpio.h> #include <linux/of_gpio.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/fs.h>
#include <linux/watchdog.h> #include <linux/watchdog.h>
#include <linux/miscdevice.h> #include <linux/miscdevice.h>
#include <linux/uaccess.h> #include <linux/uaccess.h>

View File

@ -140,7 +140,7 @@ void __init init_se7206_IRQ(void)
make_se7206_irq(IRQ1_IRQ); /* ATA */ make_se7206_irq(IRQ1_IRQ); /* ATA */
make_se7206_irq(IRQ3_IRQ); /* SLOT / PCM */ make_se7206_irq(IRQ3_IRQ); /* SLOT / PCM */
__raw_writew(__raw_readw(INTC_ICR1) | 0x000b, INTC_ICR); /* ICR1 */ __raw_writew(__raw_readw(INTC_ICR1) | 0x000b, INTC_ICR1); /* ICR1 */
/* FPGA System register setup*/ /* FPGA System register setup*/
__raw_writew(0x0000,INTSTS0); /* Clear INTSTS0 */ __raw_writew(0x0000,INTSTS0); /* Clear INTSTS0 */

View File

@ -34,7 +34,7 @@ static const int pfc_divisors[]={1,2,3,4,6,8,12};
static void master_clk_init(struct clk *clk) static void master_clk_init(struct clk *clk)
{ {
return 10000000 * PLL2 * pll1rate[(__raw_readw(FREQCR) >> 8) & 0x0007]; clk->rate = 10000000 * PLL2 * pll1rate[(__raw_readw(FREQCR) >> 8) & 0x0007];
} }
static struct clk_ops sh7201_master_clk_ops = { static struct clk_ops sh7201_master_clk_ops = {

View File

@ -81,8 +81,7 @@ static void shoc_clk_init(struct clk *clk)
for (i = 0; i < ARRAY_SIZE(frqcr3_divisors); i++) { for (i = 0; i < ARRAY_SIZE(frqcr3_divisors); i++) {
int divisor = frqcr3_divisors[i]; int divisor = frqcr3_divisors[i];
if (clk->ops->set_rate(clk, clk->parent->rate / if (clk->ops->set_rate(clk, clk->parent->rate / divisor) == 0)
divisor, 0) == 0)
break; break;
} }

View File

@ -364,7 +364,6 @@ static enum ucode_state generic_load_microcode(int cpu, void *data, size_t size,
/* For performance reasons, reuse mc area when possible */ /* For performance reasons, reuse mc area when possible */
if (!mc || mc_size > curr_mc_size) { if (!mc || mc_size > curr_mc_size) {
if (mc)
vfree(mc); vfree(mc);
mc = vmalloc(mc_size); mc = vmalloc(mc_size);
if (!mc) if (!mc)
@ -374,12 +373,10 @@ static enum ucode_state generic_load_microcode(int cpu, void *data, size_t size,
if (get_ucode_data(mc, ucode_ptr, mc_size) || if (get_ucode_data(mc, ucode_ptr, mc_size) ||
microcode_sanity_check(mc) < 0) { microcode_sanity_check(mc) < 0) {
vfree(mc);
break; break;
} }
if (get_matching_microcode(&uci->cpu_sig, mc, new_rev)) { if (get_matching_microcode(&uci->cpu_sig, mc, new_rev)) {
if (new_mc)
vfree(new_mc); vfree(new_mc);
new_rev = mc_header.rev; new_rev = mc_header.rev;
new_mc = mc; new_mc = mc;
@ -390,11 +387,9 @@ static enum ucode_state generic_load_microcode(int cpu, void *data, size_t size,
leftover -= mc_size; leftover -= mc_size;
} }
if (mc)
vfree(mc); vfree(mc);
if (leftover) { if (leftover) {
if (new_mc)
vfree(new_mc); vfree(new_mc);
state = UCODE_ERROR; state = UCODE_ERROR;
goto out; goto out;
@ -405,7 +400,6 @@ static enum ucode_state generic_load_microcode(int cpu, void *data, size_t size,
goto out; goto out;
} }
if (uci->mc)
vfree(uci->mc); vfree(uci->mc);
uci->mc = (struct microcode_intel *)new_mc; uci->mc = (struct microcode_intel *)new_mc;

View File

@ -501,7 +501,18 @@ static inline unsigned long long get_total_mem(void)
return total << PAGE_SHIFT; return total << PAGE_SHIFT;
} }
#define DEFAULT_BZIMAGE_ADDR_MAX 0x37FFFFFF /*
* Keep the crash kernel below this limit. On 32 bits earlier kernels
* would limit the kernel to the low 512 MiB due to mapping restrictions.
* On 64 bits, kexec-tools currently limits us to 896 MiB; increase this
* limit once kexec-tools are fixed.
*/
#ifdef CONFIG_X86_32
# define CRASH_KERNEL_ADDR_MAX (512 << 20)
#else
# define CRASH_KERNEL_ADDR_MAX (896 << 20)
#endif
static void __init reserve_crashkernel(void) static void __init reserve_crashkernel(void)
{ {
unsigned long long total_mem; unsigned long long total_mem;
@ -520,10 +531,10 @@ static void __init reserve_crashkernel(void)
const unsigned long long alignment = 16<<20; /* 16M */ const unsigned long long alignment = 16<<20; /* 16M */
/* /*
* kexec want bzImage is below DEFAULT_BZIMAGE_ADDR_MAX * kexec want bzImage is below CRASH_KERNEL_ADDR_MAX
*/ */
crash_base = memblock_find_in_range(alignment, crash_base = memblock_find_in_range(alignment,
DEFAULT_BZIMAGE_ADDR_MAX, crash_size, alignment); CRASH_KERNEL_ADDR_MAX, crash_size, alignment);
if (crash_base == MEMBLOCK_ERROR) { if (crash_base == MEMBLOCK_ERROR) {
pr_info("crashkernel reservation failed - No suitable area found.\n"); pr_info("crashkernel reservation failed - No suitable area found.\n");

View File

@ -408,6 +408,9 @@ acpi_ev_match_gpe_method(acpi_handle obj_handle,
return_ACPI_STATUS(AE_OK); return_ACPI_STATUS(AE_OK);
} }
/* Disable the GPE in case it's been enabled already. */
(void)acpi_hw_low_set_gpe(gpe_event_info, ACPI_GPE_DISABLE);
/* /*
* Add the GPE information from above to the gpe_event_info block for * Add the GPE information from above to the gpe_event_info block for
* use during dispatch of this GPE. * use during dispatch of this GPE.

View File

@ -130,8 +130,6 @@ struct acpi_battery {
unsigned long flags; unsigned long flags;
}; };
static int acpi_battery_update(struct acpi_battery *battery);
#define to_acpi_battery(x) container_of(x, struct acpi_battery, bat); #define to_acpi_battery(x) container_of(x, struct acpi_battery, bat);
inline int acpi_battery_present(struct acpi_battery *battery) inline int acpi_battery_present(struct acpi_battery *battery)
@ -186,9 +184,6 @@ static int acpi_battery_get_property(struct power_supply *psy,
int ret = 0; int ret = 0;
struct acpi_battery *battery = to_acpi_battery(psy); struct acpi_battery *battery = to_acpi_battery(psy);
if (acpi_battery_update(battery))
return -ENODEV;
if (acpi_battery_present(battery)) { if (acpi_battery_present(battery)) {
/* run battery update only if it is present */ /* run battery update only if it is present */
acpi_battery_get_state(battery); acpi_battery_get_state(battery);

View File

@ -705,54 +705,85 @@ static int acpi_bus_get_perf_flags(struct acpi_device *device)
} }
static acpi_status static acpi_status
acpi_bus_extract_wakeup_device_power_package(struct acpi_device *device, acpi_bus_extract_wakeup_device_power_package(acpi_handle handle,
union acpi_object *package) struct acpi_device_wakeup *wakeup)
{ {
int i = 0; struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
union acpi_object *package = NULL;
union acpi_object *element = NULL; union acpi_object *element = NULL;
acpi_status status;
int i = 0;
if (!device || !package || (package->package.count < 2)) if (!wakeup)
return AE_BAD_PARAMETER; return AE_BAD_PARAMETER;
/* _PRW */
status = acpi_evaluate_object(handle, "_PRW", NULL, &buffer);
if (ACPI_FAILURE(status)) {
ACPI_EXCEPTION((AE_INFO, status, "Evaluating _PRW"));
return status;
}
package = (union acpi_object *)buffer.pointer;
if (!package || (package->package.count < 2)) {
status = AE_BAD_DATA;
goto out;
}
element = &(package->package.elements[0]); element = &(package->package.elements[0]);
if (!element) if (!element) {
return AE_BAD_PARAMETER; status = AE_BAD_DATA;
goto out;
}
if (element->type == ACPI_TYPE_PACKAGE) { if (element->type == ACPI_TYPE_PACKAGE) {
if ((element->package.count < 2) || if ((element->package.count < 2) ||
(element->package.elements[0].type != (element->package.elements[0].type !=
ACPI_TYPE_LOCAL_REFERENCE) ACPI_TYPE_LOCAL_REFERENCE)
|| (element->package.elements[1].type != ACPI_TYPE_INTEGER)) || (element->package.elements[1].type != ACPI_TYPE_INTEGER)) {
return AE_BAD_DATA; status = AE_BAD_DATA;
device->wakeup.gpe_device = goto out;
}
wakeup->gpe_device =
element->package.elements[0].reference.handle; element->package.elements[0].reference.handle;
device->wakeup.gpe_number = wakeup->gpe_number =
(u32) element->package.elements[1].integer.value; (u32) element->package.elements[1].integer.value;
} else if (element->type == ACPI_TYPE_INTEGER) { } else if (element->type == ACPI_TYPE_INTEGER) {
device->wakeup.gpe_number = element->integer.value; wakeup->gpe_device = NULL;
} else wakeup->gpe_number = element->integer.value;
return AE_BAD_DATA; } else {
status = AE_BAD_DATA;
goto out;
}
element = &(package->package.elements[1]); element = &(package->package.elements[1]);
if (element->type != ACPI_TYPE_INTEGER) { if (element->type != ACPI_TYPE_INTEGER) {
return AE_BAD_DATA; status = AE_BAD_DATA;
goto out;
} }
device->wakeup.sleep_state = element->integer.value; wakeup->sleep_state = element->integer.value;
if ((package->package.count - 2) > ACPI_MAX_HANDLES) { if ((package->package.count - 2) > ACPI_MAX_HANDLES) {
return AE_NO_MEMORY; status = AE_NO_MEMORY;
goto out;
} }
device->wakeup.resources.count = package->package.count - 2; wakeup->resources.count = package->package.count - 2;
for (i = 0; i < device->wakeup.resources.count; i++) { for (i = 0; i < wakeup->resources.count; i++) {
element = &(package->package.elements[i + 2]); element = &(package->package.elements[i + 2]);
if (element->type != ACPI_TYPE_LOCAL_REFERENCE) if (element->type != ACPI_TYPE_LOCAL_REFERENCE) {
return AE_BAD_DATA; status = AE_BAD_DATA;
goto out;
device->wakeup.resources.handles[i] = element->reference.handle;
} }
acpi_gpe_can_wake(device->wakeup.gpe_device, device->wakeup.gpe_number); wakeup->resources.handles[i] = element->reference.handle;
}
return AE_OK; acpi_gpe_can_wake(wakeup->gpe_device, wakeup->gpe_number);
out:
kfree(buffer.pointer);
return status;
} }
static void acpi_bus_set_run_wake_flags(struct acpi_device *device) static void acpi_bus_set_run_wake_flags(struct acpi_device *device)
@ -787,26 +818,15 @@ static void acpi_bus_set_run_wake_flags(struct acpi_device *device)
static int acpi_bus_get_wakeup_device_flags(struct acpi_device *device) static int acpi_bus_get_wakeup_device_flags(struct acpi_device *device)
{ {
acpi_status status = 0; acpi_status status = 0;
struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
union acpi_object *package = NULL;
int psw_error; int psw_error;
/* _PRW */ status = acpi_bus_extract_wakeup_device_power_package(device->handle,
status = acpi_evaluate_object(device->handle, "_PRW", NULL, &buffer); &device->wakeup);
if (ACPI_FAILURE(status)) {
ACPI_EXCEPTION((AE_INFO, status, "Evaluating _PRW"));
goto end;
}
package = (union acpi_object *)buffer.pointer;
status = acpi_bus_extract_wakeup_device_power_package(device, package);
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
ACPI_EXCEPTION((AE_INFO, status, "Extracting _PRW package")); ACPI_EXCEPTION((AE_INFO, status, "Extracting _PRW package"));
goto end; goto end;
} }
kfree(buffer.pointer);
device->wakeup.flags.valid = 1; device->wakeup.flags.valid = 1;
device->wakeup.prepare_count = 0; device->wakeup.prepare_count = 0;
acpi_bus_set_run_wake_flags(device); acpi_bus_set_run_wake_flags(device);
@ -1351,6 +1371,7 @@ static acpi_status acpi_bus_check_add(acpi_handle handle, u32 lvl,
struct acpi_bus_ops *ops = context; struct acpi_bus_ops *ops = context;
int type; int type;
unsigned long long sta; unsigned long long sta;
struct acpi_device_wakeup wakeup;
struct acpi_device *device; struct acpi_device *device;
acpi_status status; acpi_status status;
int result; int result;
@ -1360,8 +1381,10 @@ static acpi_status acpi_bus_check_add(acpi_handle handle, u32 lvl,
return AE_OK; return AE_OK;
if (!(sta & ACPI_STA_DEVICE_PRESENT) && if (!(sta & ACPI_STA_DEVICE_PRESENT) &&
!(sta & ACPI_STA_DEVICE_FUNCTIONING)) !(sta & ACPI_STA_DEVICE_FUNCTIONING)) {
acpi_bus_extract_wakeup_device_power_package(handle, &wakeup);
return AE_CTRL_DEPTH; return AE_CTRL_DEPTH;
}
/* /*
* We may already have an acpi_device from a previous enumeration. If * We may already have an acpi_device from a previous enumeration. If

View File

@ -128,16 +128,6 @@ config PDC_ADMA
If unsure, say N. If unsure, say N.
config PATA_MPC52xx
tristate "Freescale MPC52xx SoC internal IDE"
depends on PPC_MPC52xx && PPC_BESTCOMM
select PPC_BESTCOMM_ATA
help
This option enables support for integrated IDE controller
of the Freescale MPC52xx SoC.
If unsure, say N.
config PATA_OCTEON_CF config PATA_OCTEON_CF
tristate "OCTEON Boot Bus Compact Flash support" tristate "OCTEON Boot Bus Compact Flash support"
depends on CPU_CAVIUM_OCTEON depends on CPU_CAVIUM_OCTEON
@ -366,7 +356,7 @@ config PATA_CS5535
config PATA_CS5536 config PATA_CS5536
tristate "CS5536 PATA support" tristate "CS5536 PATA support"
depends on PCI && X86 && !X86_64 depends on PCI
help help
This option enables support for the AMD CS5536 This option enables support for the AMD CS5536
companion chip used with the Geode LX processor family. companion chip used with the Geode LX processor family.
@ -491,6 +481,16 @@ config PATA_MARVELL
If unsure, say N. If unsure, say N.
config PATA_MPC52xx
tristate "Freescale MPC52xx SoC internal IDE"
depends on PPC_MPC52xx && PPC_BESTCOMM
select PPC_BESTCOMM_ATA
help
This option enables support for integrated IDE controller
of the Freescale MPC52xx SoC.
If unsure, say N.
config PATA_NETCELL config PATA_NETCELL
tristate "NETCELL Revolution RAID support" tristate "NETCELL Revolution RAID support"
depends on PCI depends on PCI

View File

@ -11,7 +11,6 @@ obj-$(CONFIG_SATA_DWC) += sata_dwc_460ex.o
# SFF w/ custom DMA # SFF w/ custom DMA
obj-$(CONFIG_PDC_ADMA) += pdc_adma.o obj-$(CONFIG_PDC_ADMA) += pdc_adma.o
obj-$(CONFIG_PATA_MPC52xx) += pata_mpc52xx.o
obj-$(CONFIG_PATA_OCTEON_CF) += pata_octeon_cf.o obj-$(CONFIG_PATA_OCTEON_CF) += pata_octeon_cf.o
obj-$(CONFIG_SATA_QSTOR) += sata_qstor.o obj-$(CONFIG_SATA_QSTOR) += sata_qstor.o
obj-$(CONFIG_SATA_SX4) += sata_sx4.o obj-$(CONFIG_SATA_SX4) += sata_sx4.o
@ -52,6 +51,7 @@ obj-$(CONFIG_PATA_IT821X) += pata_it821x.o
obj-$(CONFIG_PATA_JMICRON) += pata_jmicron.o obj-$(CONFIG_PATA_JMICRON) += pata_jmicron.o
obj-$(CONFIG_PATA_MACIO) += pata_macio.o obj-$(CONFIG_PATA_MACIO) += pata_macio.o
obj-$(CONFIG_PATA_MARVELL) += pata_marvell.o obj-$(CONFIG_PATA_MARVELL) += pata_marvell.o
obj-$(CONFIG_PATA_MPC52xx) += pata_mpc52xx.o
obj-$(CONFIG_PATA_NETCELL) += pata_netcell.o obj-$(CONFIG_PATA_NETCELL) += pata_netcell.o
obj-$(CONFIG_PATA_NINJA32) += pata_ninja32.o obj-$(CONFIG_PATA_NINJA32) += pata_ninja32.o
obj-$(CONFIG_PATA_NS87415) += pata_ns87415.o obj-$(CONFIG_PATA_NS87415) += pata_ns87415.o

View File

@ -4807,9 +4807,6 @@ static void ata_verify_xfer(struct ata_queued_cmd *qc)
{ {
struct ata_device *dev = qc->dev; struct ata_device *dev = qc->dev;
if (ata_tag_internal(qc->tag))
return;
if (ata_is_nodata(qc->tf.protocol)) if (ata_is_nodata(qc->tf.protocol))
return; return;
@ -4858,17 +4855,26 @@ void ata_qc_complete(struct ata_queued_cmd *qc)
if (unlikely(qc->err_mask)) if (unlikely(qc->err_mask))
qc->flags |= ATA_QCFLAG_FAILED; qc->flags |= ATA_QCFLAG_FAILED;
if (unlikely(qc->flags & ATA_QCFLAG_FAILED)) { /*
/* always fill result TF for failed qc */ * Finish internal commands without any further processing
* and always with the result TF filled.
*/
if (unlikely(ata_tag_internal(qc->tag))) {
fill_result_tf(qc); fill_result_tf(qc);
if (!ata_tag_internal(qc->tag))
ata_qc_schedule_eh(qc);
else
__ata_qc_complete(qc); __ata_qc_complete(qc);
return; return;
} }
/*
* Non-internal qc has failed. Fill the result TF and
* summon EH.
*/
if (unlikely(qc->flags & ATA_QCFLAG_FAILED)) {
fill_result_tf(qc);
ata_qc_schedule_eh(qc);
return;
}
WARN_ON_ONCE(ap->pflags & ATA_PFLAG_FROZEN); WARN_ON_ONCE(ap->pflags & ATA_PFLAG_FROZEN);
/* read result TF if requested */ /* read result TF if requested */

View File

@ -3275,6 +3275,7 @@ static int ata_eh_set_lpm(struct ata_link *link, enum ata_lpm_policy policy,
struct ata_port *ap = ata_is_host_link(link) ? link->ap : NULL; struct ata_port *ap = ata_is_host_link(link) ? link->ap : NULL;
struct ata_eh_context *ehc = &link->eh_context; struct ata_eh_context *ehc = &link->eh_context;
struct ata_device *dev, *link_dev = NULL, *lpm_dev = NULL; struct ata_device *dev, *link_dev = NULL, *lpm_dev = NULL;
enum ata_lpm_policy old_policy = link->lpm_policy;
unsigned int hints = ATA_LPM_EMPTY | ATA_LPM_HIPM; unsigned int hints = ATA_LPM_EMPTY | ATA_LPM_HIPM;
unsigned int err_mask; unsigned int err_mask;
int rc; int rc;
@ -3338,6 +3339,14 @@ static int ata_eh_set_lpm(struct ata_link *link, enum ata_lpm_policy policy,
goto fail; goto fail;
} }
/*
* Low level driver acked the transition. Issue DIPM command
* with the new policy set.
*/
link->lpm_policy = policy;
if (ap && ap->slave_link)
ap->slave_link->lpm_policy = policy;
/* host config updated, enable DIPM if transitioning to MIN_POWER */ /* host config updated, enable DIPM if transitioning to MIN_POWER */
ata_for_each_dev(dev, link, ENABLED) { ata_for_each_dev(dev, link, ENABLED) {
if (policy == ATA_LPM_MIN_POWER && ata_id_has_dipm(dev->id)) { if (policy == ATA_LPM_MIN_POWER && ata_id_has_dipm(dev->id)) {
@ -3353,12 +3362,14 @@ static int ata_eh_set_lpm(struct ata_link *link, enum ata_lpm_policy policy,
} }
} }
link->lpm_policy = policy;
if (ap && ap->slave_link)
ap->slave_link->lpm_policy = policy;
return 0; return 0;
fail: fail:
/* restore the old policy */
link->lpm_policy = old_policy;
if (ap && ap->slave_link)
ap->slave_link->lpm_policy = old_policy;
/* if no device or only one more chance is left, disable LPM */ /* if no device or only one more chance is left, disable LPM */
if (!dev || ehc->tries[dev->devno] <= 2) { if (!dev || ehc->tries[dev->devno] <= 2) {
ata_link_printk(link, KERN_WARNING, ata_link_printk(link, KERN_WARNING,

View File

@ -1532,11 +1532,10 @@ static unsigned int __ata_sff_port_intr(struct ata_port *ap,
if (!(qc->dev->flags & ATA_DFLAG_CDB_INTR)) if (!(qc->dev->flags & ATA_DFLAG_CDB_INTR))
return ata_sff_idle_irq(ap); return ata_sff_idle_irq(ap);
break; break;
case HSM_ST: case HSM_ST_IDLE:
case HSM_ST_LAST:
break;
default:
return ata_sff_idle_irq(ap); return ata_sff_idle_irq(ap);
default:
break;
} }
/* check main status, clearing INTRQ if needed */ /* check main status, clearing INTRQ if needed */

View File

@ -37,10 +37,22 @@
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/libata.h> #include <linux/libata.h>
#include <scsi/scsi_host.h> #include <scsi/scsi_host.h>
#ifdef CONFIG_X86_32
#include <asm/msr.h> #include <asm/msr.h>
static int use_msr;
module_param_named(msr, use_msr, int, 0644);
MODULE_PARM_DESC(msr, "Force using MSR to configure IDE function (Default: 0)");
#else
#undef rdmsr /* avoid accidental MSR usage on, e.g. x86-64 */
#undef wrmsr
#define rdmsr(x, y, z) do { } while (0)
#define wrmsr(x, y, z) do { } while (0)
#define use_msr 0
#endif
#define DRV_NAME "pata_cs5536" #define DRV_NAME "pata_cs5536"
#define DRV_VERSION "0.0.7" #define DRV_VERSION "0.0.8"
enum { enum {
CFG = 0, CFG = 0,
@ -75,8 +87,6 @@ enum {
IDE_ETC_NODMA = 0x03, IDE_ETC_NODMA = 0x03,
}; };
static int use_msr;
static const u32 msr_reg[4] = { static const u32 msr_reg[4] = {
MSR_IDE_CFG, MSR_IDE_DTC, MSR_IDE_CAST, MSR_IDE_ETC, MSR_IDE_CFG, MSR_IDE_DTC, MSR_IDE_CAST, MSR_IDE_ETC,
}; };
@ -88,7 +98,7 @@ static const u8 pci_reg[4] = {
static inline int cs5536_read(struct pci_dev *pdev, int reg, u32 *val) static inline int cs5536_read(struct pci_dev *pdev, int reg, u32 *val)
{ {
if (unlikely(use_msr)) { if (unlikely(use_msr)) {
u32 dummy; u32 dummy __maybe_unused;
rdmsr(msr_reg[reg], *val, dummy); rdmsr(msr_reg[reg], *val, dummy);
return 0; return 0;
@ -294,8 +304,6 @@ MODULE_DESCRIPTION("low-level driver for the CS5536 IDE controller");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
MODULE_DEVICE_TABLE(pci, cs5536); MODULE_DEVICE_TABLE(pci, cs5536);
MODULE_VERSION(DRV_VERSION); MODULE_VERSION(DRV_VERSION);
module_param_named(msr, use_msr, int, 0644);
MODULE_PARM_DESC(msr, "Force using MSR to configure IDE function (Default: 0)");
module_init(cs5536_init); module_init(cs5536_init);
module_exit(cs5536_exit); module_exit(cs5536_exit);

View File

@ -311,11 +311,13 @@ static void hci_uart_tty_close(struct tty_struct *tty)
if (test_and_clear_bit(HCI_UART_PROTO_SET, &hu->flags)) { if (test_and_clear_bit(HCI_UART_PROTO_SET, &hu->flags)) {
hu->proto->close(hu); hu->proto->close(hu);
if (hdev) {
hci_unregister_dev(hdev); hci_unregister_dev(hdev);
hci_free_dev(hdev); hci_free_dev(hdev);
} }
} }
} }
}
/* hci_uart_tty_wakeup() /* hci_uart_tty_wakeup()
* *

View File

@ -1192,12 +1192,19 @@ static void i9xx_chipset_flush(void)
writel(1, intel_private.i9xx_flush_page); writel(1, intel_private.i9xx_flush_page);
} }
static void i965_write_entry(dma_addr_t addr, unsigned int entry, static void i965_write_entry(dma_addr_t addr,
unsigned int entry,
unsigned int flags) unsigned int flags)
{ {
u32 pte_flags;
pte_flags = I810_PTE_VALID;
if (flags == AGP_USER_CACHED_MEMORY)
pte_flags |= I830_PTE_SYSTEM_CACHED;
/* Shift high bits down */ /* Shift high bits down */
addr |= (addr >> 28) & 0xf0; addr |= (addr >> 28) & 0xf0;
writel(addr | I810_PTE_VALID, intel_private.gtt + entry); writel(addr | pte_flags, intel_private.gtt + entry);
} }
static bool gen6_check_flags(unsigned int flags) static bool gen6_check_flags(unsigned int flags)

View File

@ -29,7 +29,6 @@
#include <linux/ramoops.h> #include <linux/ramoops.h>
#define RAMOOPS_KERNMSG_HDR "====" #define RAMOOPS_KERNMSG_HDR "===="
#define RAMOOPS_HEADER_SIZE (5 + sizeof(struct timeval))
#define RECORD_SIZE 4096 #define RECORD_SIZE 4096
@ -65,8 +64,8 @@ static void ramoops_do_dump(struct kmsg_dumper *dumper,
struct ramoops_context, dump); struct ramoops_context, dump);
unsigned long s1_start, s2_start; unsigned long s1_start, s2_start;
unsigned long l1_cpy, l2_cpy; unsigned long l1_cpy, l2_cpy;
int res; int res, hdr_size;
char *buf; char *buf, *buf_orig;
struct timeval timestamp; struct timeval timestamp;
/* Only dump oopses if dump_oops is set */ /* Only dump oopses if dump_oops is set */
@ -74,6 +73,8 @@ static void ramoops_do_dump(struct kmsg_dumper *dumper,
return; return;
buf = (char *)(cxt->virt_addr + (cxt->count * RECORD_SIZE)); buf = (char *)(cxt->virt_addr + (cxt->count * RECORD_SIZE));
buf_orig = buf;
memset(buf, '\0', RECORD_SIZE); memset(buf, '\0', RECORD_SIZE);
res = sprintf(buf, "%s", RAMOOPS_KERNMSG_HDR); res = sprintf(buf, "%s", RAMOOPS_KERNMSG_HDR);
buf += res; buf += res;
@ -81,8 +82,9 @@ static void ramoops_do_dump(struct kmsg_dumper *dumper,
res = sprintf(buf, "%lu.%lu\n", (long)timestamp.tv_sec, (long)timestamp.tv_usec); res = sprintf(buf, "%lu.%lu\n", (long)timestamp.tv_sec, (long)timestamp.tv_usec);
buf += res; buf += res;
l2_cpy = min(l2, (unsigned long)(RECORD_SIZE - RAMOOPS_HEADER_SIZE)); hdr_size = buf - buf_orig;
l1_cpy = min(l1, (unsigned long)(RECORD_SIZE - RAMOOPS_HEADER_SIZE) - l2_cpy); l2_cpy = min(l2, (unsigned long)(RECORD_SIZE - hdr_size));
l1_cpy = min(l1, (unsigned long)(RECORD_SIZE - hdr_size) - l2_cpy);
s2_start = l2 - l2_cpy; s2_start = l2 - l2_cpy;
s1_start = l1 - l1_cpy; s1_start = l1 - l1_cpy;

View File

@ -56,15 +56,26 @@ static struct cs5535_gpio_chip {
* registers, see include/linux/cs5535.h. * registers, see include/linux/cs5535.h.
*/ */
static void errata_outl(u32 val, unsigned long addr) static void errata_outl(struct cs5535_gpio_chip *chip, u32 val,
unsigned int reg)
{ {
unsigned long addr = chip->base + 0x80 + reg;
/* /*
* According to the CS5536 errata (#36), after suspend * According to the CS5536 errata (#36), after suspend
* a write to the high bank GPIO register will clear all * a write to the high bank GPIO register will clear all
* non-selected bits; the recommended workaround is a * non-selected bits; the recommended workaround is a
* read-modify-write operation. * read-modify-write operation.
*
* Don't apply this errata to the edge status GPIOs, as writing
* to their lower bits will clear them.
*/ */
val |= inl(addr); if (reg != GPIO_POSITIVE_EDGE_STS && reg != GPIO_NEGATIVE_EDGE_STS) {
if (val & 0xffff)
val |= (inl(addr) & 0xffff); /* ignore the high bits */
else
val |= (inl(addr) ^ (val >> 16));
}
outl(val, addr); outl(val, addr);
} }
@ -76,7 +87,7 @@ static void __cs5535_gpio_set(struct cs5535_gpio_chip *chip, unsigned offset,
outl(1 << offset, chip->base + reg); outl(1 << offset, chip->base + reg);
else else
/* high bank register */ /* high bank register */
errata_outl(1 << (offset - 16), chip->base + 0x80 + reg); errata_outl(chip, 1 << (offset - 16), reg);
} }
void cs5535_gpio_set(unsigned offset, unsigned int reg) void cs5535_gpio_set(unsigned offset, unsigned int reg)
@ -98,7 +109,7 @@ static void __cs5535_gpio_clear(struct cs5535_gpio_chip *chip, unsigned offset,
outl(1 << (offset + 16), chip->base + reg); outl(1 << (offset + 16), chip->base + reg);
else else
/* high bank register */ /* high bank register */
errata_outl(1 << offset, chip->base + 0x80 + reg); errata_outl(chip, 1 << offset, reg);
} }
void cs5535_gpio_clear(unsigned offset, unsigned int reg) void cs5535_gpio_clear(unsigned offset, unsigned int reg)

View File

@ -1281,6 +1281,9 @@ int gpio_request_one(unsigned gpio, unsigned long flags, const char *label)
err = gpio_direction_output(gpio, err = gpio_direction_output(gpio,
(flags & GPIOF_INIT_HIGH) ? 1 : 0); (flags & GPIOF_INIT_HIGH) ? 1 : 0);
if (err)
gpio_free(gpio);
return err; return err;
} }
EXPORT_SYMBOL_GPL(gpio_request_one); EXPORT_SYMBOL_GPL(gpio_request_one);

View File

@ -135,7 +135,7 @@ static int __devinit rdc321x_gpio_probe(struct platform_device *pdev)
struct rdc321x_gpio *rdc321x_gpio_dev; struct rdc321x_gpio *rdc321x_gpio_dev;
struct rdc321x_gpio_pdata *pdata; struct rdc321x_gpio_pdata *pdata;
pdata = pdev->dev.platform_data; pdata = platform_get_drvdata(pdev);
if (!pdata) { if (!pdata) {
dev_err(&pdev->dev, "no platform data supplied\n"); dev_err(&pdev->dev, "no platform data supplied\n");
return -ENODEV; return -ENODEV;

View File

@ -241,7 +241,7 @@ void drm_helper_disable_unused_functions(struct drm_device *dev)
} }
list_for_each_entry(encoder, &dev->mode_config.encoder_list, head) { list_for_each_entry(encoder, &dev->mode_config.encoder_list, head) {
if (encoder->crtc && !drm_helper_encoder_in_use(encoder)) { if (!drm_helper_encoder_in_use(encoder)) {
drm_encoder_disable(encoder); drm_encoder_disable(encoder);
/* disconnector encoder from any connector */ /* disconnector encoder from any connector */
encoder->crtc = NULL; encoder->crtc = NULL;
@ -874,7 +874,10 @@ static void output_poll_execute(struct work_struct *work)
continue; continue;
connector->status = connector->funcs->detect(connector, false); connector->status = connector->funcs->detect(connector, false);
DRM_DEBUG_KMS("connector status updated to %d\n", connector->status); DRM_DEBUG_KMS("[CONNECTOR:%d:%s] status updated from %d to %d\n",
connector->base.id,
drm_get_connector_name(connector),
old_status, connector->status);
if (old_status != connector->status) if (old_status != connector->status)
changed = true; changed = true;
} }

View File

@ -270,7 +270,7 @@ parse_general_features(struct drm_i915_private *dev_priv,
general->ssc_freq ? 66 : 48; general->ssc_freq ? 66 : 48;
else if (IS_GEN5(dev) || IS_GEN6(dev)) else if (IS_GEN5(dev) || IS_GEN6(dev))
dev_priv->lvds_ssc_freq = dev_priv->lvds_ssc_freq =
general->ssc_freq ? 100 : 120; general->ssc_freq ? 120 : 100;
else else
dev_priv->lvds_ssc_freq = dev_priv->lvds_ssc_freq =
general->ssc_freq ? 100 : 96; general->ssc_freq ? 100 : 96;

View File

@ -479,6 +479,7 @@ intel_dp_i2c_aux_ch(struct i2c_adapter *adapter, int mode,
uint16_t address = algo_data->address; uint16_t address = algo_data->address;
uint8_t msg[5]; uint8_t msg[5];
uint8_t reply[2]; uint8_t reply[2];
unsigned retry;
int msg_bytes; int msg_bytes;
int reply_bytes; int reply_bytes;
int ret; int ret;
@ -513,7 +514,7 @@ intel_dp_i2c_aux_ch(struct i2c_adapter *adapter, int mode,
break; break;
} }
for (;;) { for (retry = 0; retry < 5; retry++) {
ret = intel_dp_aux_ch(intel_dp, ret = intel_dp_aux_ch(intel_dp,
msg, msg_bytes, msg, msg_bytes,
reply, reply_bytes); reply, reply_bytes);
@ -521,6 +522,25 @@ intel_dp_i2c_aux_ch(struct i2c_adapter *adapter, int mode,
DRM_DEBUG_KMS("aux_ch failed %d\n", ret); DRM_DEBUG_KMS("aux_ch failed %d\n", ret);
return ret; return ret;
} }
switch (reply[0] & AUX_NATIVE_REPLY_MASK) {
case AUX_NATIVE_REPLY_ACK:
/* I2C-over-AUX Reply field is only valid
* when paired with AUX ACK.
*/
break;
case AUX_NATIVE_REPLY_NACK:
DRM_DEBUG_KMS("aux_ch native nack\n");
return -EREMOTEIO;
case AUX_NATIVE_REPLY_DEFER:
udelay(100);
continue;
default:
DRM_ERROR("aux_ch invalid native reply 0x%02x\n",
reply[0]);
return -EREMOTEIO;
}
switch (reply[0] & AUX_I2C_REPLY_MASK) { switch (reply[0] & AUX_I2C_REPLY_MASK) {
case AUX_I2C_REPLY_ACK: case AUX_I2C_REPLY_ACK:
if (mode == MODE_I2C_READ) { if (mode == MODE_I2C_READ) {
@ -528,17 +548,20 @@ intel_dp_i2c_aux_ch(struct i2c_adapter *adapter, int mode,
} }
return reply_bytes - 1; return reply_bytes - 1;
case AUX_I2C_REPLY_NACK: case AUX_I2C_REPLY_NACK:
DRM_DEBUG_KMS("aux_ch nack\n"); DRM_DEBUG_KMS("aux_i2c nack\n");
return -EREMOTEIO; return -EREMOTEIO;
case AUX_I2C_REPLY_DEFER: case AUX_I2C_REPLY_DEFER:
DRM_DEBUG_KMS("aux_ch defer\n"); DRM_DEBUG_KMS("aux_i2c defer\n");
udelay(100); udelay(100);
break; break;
default: default:
DRM_ERROR("aux_ch invalid reply 0x%02x\n", reply[0]); DRM_ERROR("aux_i2c invalid reply 0x%02x\n", reply[0]);
return -EREMOTEIO; return -EREMOTEIO;
} }
} }
DRM_ERROR("too many retries, giving up\n");
return -EREMOTEIO;
} }
static int static int

View File

@ -696,20 +696,17 @@ int intel_wait_ring_buffer(struct drm_device *dev,
drm_i915_private_t *dev_priv = dev->dev_private; drm_i915_private_t *dev_priv = dev->dev_private;
u32 head; u32 head;
head = intel_read_status_page(ring, 4);
if (head) {
ring->head = head & HEAD_ADDR;
ring->space = ring->head - (ring->tail + 8);
if (ring->space < 0)
ring->space += ring->size;
if (ring->space >= n)
return 0;
}
trace_i915_ring_wait_begin (dev); trace_i915_ring_wait_begin (dev);
end = jiffies + 3 * HZ; end = jiffies + 3 * HZ;
do { do {
ring->head = I915_READ_HEAD(ring) & HEAD_ADDR; /* If the reported head position has wrapped or hasn't advanced,
* fallback to the slow and accurate path.
*/
head = intel_read_status_page(ring, 4);
if (head < ring->actual_head)
head = I915_READ_HEAD(ring);
ring->actual_head = head;
ring->head = head & HEAD_ADDR;
ring->space = ring->head - (ring->tail + 8); ring->space = ring->head - (ring->tail + 8);
if (ring->space < 0) if (ring->space < 0)
ring->space += ring->size; ring->space += ring->size;

View File

@ -30,8 +30,9 @@ struct intel_ring_buffer {
struct drm_device *dev; struct drm_device *dev;
struct drm_gem_object *gem_object; struct drm_gem_object *gem_object;
unsigned int head; u32 actual_head;
unsigned int tail; u32 head;
u32 tail;
int space; int space;
struct intel_hw_status_page status_page; struct intel_hw_status_page status_page;

View File

@ -1908,9 +1908,12 @@ intel_sdvo_select_i2c_bus(struct drm_i915_private *dev_priv,
speed = mapping->i2c_speed; speed = mapping->i2c_speed;
} }
if (pin < GMBUS_NUM_PORTS) {
sdvo->i2c = &dev_priv->gmbus[pin].adapter; sdvo->i2c = &dev_priv->gmbus[pin].adapter;
intel_gmbus_set_speed(sdvo->i2c, speed); intel_gmbus_set_speed(sdvo->i2c, speed);
intel_gmbus_force_bit(sdvo->i2c, true); intel_gmbus_force_bit(sdvo->i2c, true);
} else
sdvo->i2c = &dev_priv->gmbus[GMBUS_PORT_DPB].adapter;
} }
static bool static bool

View File

@ -253,6 +253,7 @@ void atombios_crtc_dpms(struct drm_crtc *crtc, int mode)
case DRM_MODE_DPMS_SUSPEND: case DRM_MODE_DPMS_SUSPEND:
case DRM_MODE_DPMS_OFF: case DRM_MODE_DPMS_OFF:
drm_vblank_pre_modeset(dev, radeon_crtc->crtc_id); drm_vblank_pre_modeset(dev, radeon_crtc->crtc_id);
if (radeon_crtc->enabled)
atombios_blank_crtc(crtc, ATOM_ENABLE); atombios_blank_crtc(crtc, ATOM_ENABLE);
if (ASIC_IS_DCE3(rdev)) if (ASIC_IS_DCE3(rdev))
atombios_enable_crtc_memreq(crtc, ATOM_DISABLE); atombios_enable_crtc_memreq(crtc, ATOM_DISABLE);
@ -530,7 +531,7 @@ static u32 atombios_adjust_pll(struct drm_crtc *crtc,
dp_clock = dig_connector->dp_clock; dp_clock = dig_connector->dp_clock;
} }
} }
#if 0 /* doesn't work properly on some laptops */
/* use recommended ref_div for ss */ /* use recommended ref_div for ss */
if (radeon_encoder->devices & (ATOM_DEVICE_LCD_SUPPORT)) { if (radeon_encoder->devices & (ATOM_DEVICE_LCD_SUPPORT)) {
if (ss_enabled) { if (ss_enabled) {
@ -540,7 +541,7 @@ static u32 atombios_adjust_pll(struct drm_crtc *crtc,
} }
} }
} }
#endif
if (ASIC_IS_AVIVO(rdev)) { if (ASIC_IS_AVIVO(rdev)) {
/* DVO wants 2x pixel clock if the DVO chip is in 12 bit mode */ /* DVO wants 2x pixel clock if the DVO chip is in 12 bit mode */
if (radeon_encoder->encoder_id == ENCODER_OBJECT_ID_INTERNAL_KLDSCP_DVO1) if (radeon_encoder->encoder_id == ENCODER_OBJECT_ID_INTERNAL_KLDSCP_DVO1)

View File

@ -748,6 +748,8 @@ void evergreen_pcie_gart_tlb_flush(struct radeon_device *rdev)
unsigned i; unsigned i;
u32 tmp; u32 tmp;
WREG32(HDP_MEM_COHERENCY_FLUSH_CNTL, 0x1);
WREG32(VM_CONTEXT0_REQUEST_RESPONSE, REQUEST_TYPE(1)); WREG32(VM_CONTEXT0_REQUEST_RESPONSE, REQUEST_TYPE(1));
for (i = 0; i < rdev->usec_timeout; i++) { for (i = 0; i < rdev->usec_timeout; i++) {
/* read MC_STATUS */ /* read MC_STATUS */
@ -1922,7 +1924,6 @@ bool evergreen_gpu_is_lockup(struct radeon_device *rdev)
static int evergreen_gpu_soft_reset(struct radeon_device *rdev) static int evergreen_gpu_soft_reset(struct radeon_device *rdev)
{ {
struct evergreen_mc_save save; struct evergreen_mc_save save;
u32 srbm_reset = 0;
u32 grbm_reset = 0; u32 grbm_reset = 0;
dev_info(rdev->dev, "GPU softreset \n"); dev_info(rdev->dev, "GPU softreset \n");
@ -1961,16 +1962,6 @@ static int evergreen_gpu_soft_reset(struct radeon_device *rdev)
udelay(50); udelay(50);
WREG32(GRBM_SOFT_RESET, 0); WREG32(GRBM_SOFT_RESET, 0);
(void)RREG32(GRBM_SOFT_RESET); (void)RREG32(GRBM_SOFT_RESET);
/* reset all the system blocks */
srbm_reset = SRBM_SOFT_RESET_ALL_MASK;
dev_info(rdev->dev, " SRBM_SOFT_RESET=0x%08X\n", srbm_reset);
WREG32(SRBM_SOFT_RESET, srbm_reset);
(void)RREG32(SRBM_SOFT_RESET);
udelay(50);
WREG32(SRBM_SOFT_RESET, 0);
(void)RREG32(SRBM_SOFT_RESET);
/* Wait a little for things to settle down */ /* Wait a little for things to settle down */
udelay(50); udelay(50);
dev_info(rdev->dev, " GRBM_STATUS=0x%08X\n", dev_info(rdev->dev, " GRBM_STATUS=0x%08X\n",
@ -1981,10 +1972,6 @@ static int evergreen_gpu_soft_reset(struct radeon_device *rdev)
RREG32(GRBM_STATUS_SE1)); RREG32(GRBM_STATUS_SE1));
dev_info(rdev->dev, " SRBM_STATUS=0x%08X\n", dev_info(rdev->dev, " SRBM_STATUS=0x%08X\n",
RREG32(SRBM_STATUS)); RREG32(SRBM_STATUS));
/* After reset we need to reinit the asic as GPU often endup in an
* incoherent state.
*/
atom_asic_init(rdev->mode_info.atom_context);
evergreen_mc_resume(rdev, &save); evergreen_mc_resume(rdev, &save);
return 0; return 0;
} }
@ -2596,6 +2583,11 @@ int evergreen_resume(struct radeon_device *rdev)
{ {
int r; int r;
/* reset the asic, the gfx blocks are often in a bad state
* after the driver is unloaded or after a resume
*/
if (radeon_asic_reset(rdev))
dev_warn(rdev->dev, "GPU reset failed !\n");
/* Do not reset GPU before posting, on rv770 hw unlike on r500 hw, /* Do not reset GPU before posting, on rv770 hw unlike on r500 hw,
* posting will perform necessary task to bring back GPU into good * posting will perform necessary task to bring back GPU into good
* shape. * shape.
@ -2712,6 +2704,11 @@ int evergreen_init(struct radeon_device *rdev)
r = radeon_atombios_init(rdev); r = radeon_atombios_init(rdev);
if (r) if (r)
return r; return r;
/* reset the asic, the gfx blocks are often in a bad state
* after the driver is unloaded or after a resume
*/
if (radeon_asic_reset(rdev))
dev_warn(rdev->dev, "GPU reset failed !\n");
/* Post card if necessary */ /* Post card if necessary */
if (!evergreen_card_posted(rdev)) { if (!evergreen_card_posted(rdev)) {
if (!rdev->bios) { if (!rdev->bios) {

View File

@ -174,6 +174,7 @@
#define HDP_NONSURFACE_BASE 0x2C04 #define HDP_NONSURFACE_BASE 0x2C04
#define HDP_NONSURFACE_INFO 0x2C08 #define HDP_NONSURFACE_INFO 0x2C08
#define HDP_NONSURFACE_SIZE 0x2C0C #define HDP_NONSURFACE_SIZE 0x2C0C
#define HDP_MEM_COHERENCY_FLUSH_CNTL 0x5480
#define HDP_REG_COHERENCY_FLUSH_CNTL 0x54A0 #define HDP_REG_COHERENCY_FLUSH_CNTL 0x54A0
#define HDP_TILING_CONFIG 0x2F3C #define HDP_TILING_CONFIG 0x2F3C

View File

@ -1342,13 +1342,19 @@ bool r600_gpu_is_lockup(struct radeon_device *rdev)
u32 srbm_status; u32 srbm_status;
u32 grbm_status; u32 grbm_status;
u32 grbm_status2; u32 grbm_status2;
struct r100_gpu_lockup *lockup;
int r; int r;
if (rdev->family >= CHIP_RV770)
lockup = &rdev->config.rv770.lockup;
else
lockup = &rdev->config.r600.lockup;
srbm_status = RREG32(R_000E50_SRBM_STATUS); srbm_status = RREG32(R_000E50_SRBM_STATUS);
grbm_status = RREG32(R_008010_GRBM_STATUS); grbm_status = RREG32(R_008010_GRBM_STATUS);
grbm_status2 = RREG32(R_008014_GRBM_STATUS2); grbm_status2 = RREG32(R_008014_GRBM_STATUS2);
if (!G_008010_GUI_ACTIVE(grbm_status)) { if (!G_008010_GUI_ACTIVE(grbm_status)) {
r100_gpu_lockup_update(&rdev->config.r300.lockup, &rdev->cp); r100_gpu_lockup_update(lockup, &rdev->cp);
return false; return false;
} }
/* force CP activities */ /* force CP activities */
@ -1360,7 +1366,7 @@ bool r600_gpu_is_lockup(struct radeon_device *rdev)
radeon_ring_unlock_commit(rdev); radeon_ring_unlock_commit(rdev);
} }
rdev->cp.rptr = RREG32(R600_CP_RB_RPTR); rdev->cp.rptr = RREG32(R600_CP_RB_RPTR);
return r100_gpu_cp_is_lockup(rdev, &rdev->config.r300.lockup, &rdev->cp); return r100_gpu_cp_is_lockup(rdev, lockup, &rdev->cp);
} }
int r600_asic_reset(struct radeon_device *rdev) int r600_asic_reset(struct radeon_device *rdev)

View File

@ -315,11 +315,10 @@ static inline int r600_cs_track_validate_cb(struct radeon_cs_parser *p, int i)
if (array_mode == V_0280A0_ARRAY_LINEAR_GENERAL) { if (array_mode == V_0280A0_ARRAY_LINEAR_GENERAL) {
/* the initial DDX does bad things with the CB size occasionally */ /* the initial DDX does bad things with the CB size occasionally */
/* it rounds up height too far for slice tile max but the BO is smaller */ /* it rounds up height too far for slice tile max but the BO is smaller */
tmp = (height - 7) * 8 * bpe; /* r600c,g also seem to flush at bad times in some apps resulting in
if ((tmp + track->cb_color_bo_offset[i]) > radeon_bo_size(track->cb_color_bo[i])) { * bogus values here. So for linear just allow anything to avoid breaking
dev_warn(p->dev, "%s offset[%d] %d %d %lu too big\n", __func__, i, track->cb_color_bo_offset[i], tmp, radeon_bo_size(track->cb_color_bo[i])); * broken userspace.
return -EINVAL; */
}
} else { } else {
dev_warn(p->dev, "%s offset[%d] %d %d %lu too big\n", __func__, i, track->cb_color_bo_offset[i], tmp, radeon_bo_size(track->cb_color_bo[i])); dev_warn(p->dev, "%s offset[%d] %d %d %lu too big\n", __func__, i, track->cb_color_bo_offset[i], tmp, radeon_bo_size(track->cb_color_bo[i]));
return -EINVAL; return -EINVAL;

View File

@ -910,11 +910,6 @@ int radeon_resume_kms(struct drm_device *dev)
radeon_pm_resume(rdev); radeon_pm_resume(rdev);
radeon_restore_bios_scratch_regs(rdev); radeon_restore_bios_scratch_regs(rdev);
/* turn on display hw */
list_for_each_entry(connector, &dev->mode_config.connector_list, head) {
drm_helper_connector_dpms(connector, DRM_MODE_DPMS_ON);
}
radeon_fbdev_set_suspend(rdev, 0); radeon_fbdev_set_suspend(rdev, 0);
release_console_sem(); release_console_sem();
@ -922,6 +917,10 @@ int radeon_resume_kms(struct drm_device *dev)
radeon_hpd_init(rdev); radeon_hpd_init(rdev);
/* blat the mode back in */ /* blat the mode back in */
drm_helper_resume_force_mode(dev); drm_helper_resume_force_mode(dev);
/* turn on display hw */
list_for_each_entry(connector, &dev->mode_config.connector_list, head) {
drm_helper_connector_dpms(connector, DRM_MODE_DPMS_ON);
}
return 0; return 0;
} }

View File

@ -232,9 +232,28 @@ static struct drm_driver driver_old = {
static struct drm_driver kms_driver; static struct drm_driver kms_driver;
static void radeon_kick_out_firmware_fb(struct pci_dev *pdev)
{
struct apertures_struct *ap;
bool primary = false;
ap = alloc_apertures(1);
ap->ranges[0].base = pci_resource_start(pdev, 0);
ap->ranges[0].size = pci_resource_len(pdev, 0);
#ifdef CONFIG_X86
primary = pdev->resource[PCI_ROM_RESOURCE].flags & IORESOURCE_ROM_SHADOW;
#endif
remove_conflicting_framebuffers(ap, "radeondrmfb", primary);
kfree(ap);
}
static int __devinit static int __devinit
radeon_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) radeon_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
{ {
/* Get rid of things like offb */
radeon_kick_out_firmware_fb(pdev);
return drm_get_pci_dev(pdev, ent, &kms_driver); return drm_get_pci_dev(pdev, ent, &kms_driver);
} }

View File

@ -245,7 +245,7 @@ static int radeonfb_create(struct radeon_fbdev *rfbdev,
goto out_unref; goto out_unref;
} }
info->apertures->ranges[0].base = rdev->ddev->mode_config.fb_base; info->apertures->ranges[0].base = rdev->ddev->mode_config.fb_base;
info->apertures->ranges[0].size = rdev->mc.real_vram_size; info->apertures->ranges[0].size = rdev->mc.aper_size;
info->fix.mmio_start = 0; info->fix.mmio_start = 0;
info->fix.mmio_len = 0; info->fix.mmio_len = 0;

View File

@ -267,7 +267,7 @@ void led_blink_set(struct led_classdev *led_cdev,
unsigned long *delay_off) unsigned long *delay_off)
{ {
if (led_cdev->blink_set && if (led_cdev->blink_set &&
led_cdev->blink_set(led_cdev, delay_on, delay_off)) !led_cdev->blink_set(led_cdev, delay_on, delay_off))
return; return;
/* blink with 1 Hz as default if nothing specified */ /* blink with 1 Hz as default if nothing specified */

View File

@ -26,7 +26,7 @@ static struct ir_scancode rc6_mce[] = {
{ 0x800f040a, KEY_DELETE }, { 0x800f040a, KEY_DELETE },
{ 0x800f040b, KEY_ENTER }, { 0x800f040b, KEY_ENTER },
{ 0x800f040c, KEY_POWER }, { 0x800f040c, KEY_POWER }, /* PC Power */
{ 0x800f040d, KEY_PROG1 }, /* Windows MCE button */ { 0x800f040d, KEY_PROG1 }, /* Windows MCE button */
{ 0x800f040e, KEY_MUTE }, { 0x800f040e, KEY_MUTE },
{ 0x800f040f, KEY_INFO }, { 0x800f040f, KEY_INFO },
@ -79,6 +79,7 @@ static struct ir_scancode rc6_mce[] = {
{ 0x800f045d, KEY_YELLOW }, { 0x800f045d, KEY_YELLOW },
{ 0x800f045e, KEY_BLUE }, { 0x800f045e, KEY_BLUE },
{ 0x800f0465, KEY_POWER2 }, /* TV Power */
{ 0x800f046e, KEY_PLAYPAUSE }, { 0x800f046e, KEY_PLAYPAUSE },
{ 0x800f046f, KEY_MEDIA }, /* Start media application (NEW) */ { 0x800f046f, KEY_MEDIA }, /* Start media application (NEW) */

View File

@ -522,10 +522,8 @@ unsigned int lirc_dev_fop_poll(struct file *file, poll_table *wait)
dev_dbg(ir->d.dev, LOGHEAD "poll called\n", ir->d.name, ir->d.minor); dev_dbg(ir->d.dev, LOGHEAD "poll called\n", ir->d.name, ir->d.minor);
if (!ir->attached) { if (!ir->attached)
mutex_unlock(&ir->irctl_lock);
return POLLERR; return POLLERR;
}
poll_wait(file, &ir->buf->wait_poll, wait); poll_wait(file, &ir->buf->wait_poll, wait);
@ -649,18 +647,18 @@ ssize_t lirc_dev_fop_read(struct file *file,
if (!buf) if (!buf)
return -ENOMEM; return -ENOMEM;
if (mutex_lock_interruptible(&ir->irctl_lock)) if (mutex_lock_interruptible(&ir->irctl_lock)) {
return -ERESTARTSYS; ret = -ERESTARTSYS;
goto out_unlocked;
}
if (!ir->attached) { if (!ir->attached) {
mutex_unlock(&ir->irctl_lock); ret = -ENODEV;
return -ENODEV; goto out_locked;
} }
if (length % ir->chunk_size) { if (length % ir->chunk_size) {
dev_dbg(ir->d.dev, LOGHEAD "read result = -EINVAL\n", ret = -EINVAL;
ir->d.name, ir->d.minor); goto out_locked;
mutex_unlock(&ir->irctl_lock);
return -EINVAL;
} }
/* /*
@ -711,18 +709,23 @@ ssize_t lirc_dev_fop_read(struct file *file,
lirc_buffer_read(ir->buf, buf); lirc_buffer_read(ir->buf, buf);
ret = copy_to_user((void *)buffer+written, buf, ret = copy_to_user((void *)buffer+written, buf,
ir->buf->chunk_size); ir->buf->chunk_size);
if (!ret)
written += ir->buf->chunk_size; written += ir->buf->chunk_size;
else
ret = -EFAULT;
} }
} }
remove_wait_queue(&ir->buf->wait_poll, &wait); remove_wait_queue(&ir->buf->wait_poll, &wait);
set_current_state(TASK_RUNNING); set_current_state(TASK_RUNNING);
out_locked:
mutex_unlock(&ir->irctl_lock); mutex_unlock(&ir->irctl_lock);
out_unlocked: out_unlocked:
kfree(buf); kfree(buf);
dev_dbg(ir->d.dev, LOGHEAD "read result = %s (%d)\n", dev_dbg(ir->d.dev, LOGHEAD "read result = %s (%d)\n",
ir->d.name, ir->d.minor, ret ? "-EFAULT" : "OK", ret); ir->d.name, ir->d.minor, ret ? "<fail>" : "<ok>", ret);
return ret ? ret : written; return ret ? ret : written;
} }

View File

@ -35,10 +35,10 @@
#include <linux/device.h> #include <linux/device.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/usb.h>
#include <linux/input.h> #include <linux/input.h>
#include <linux/usb.h>
#include <linux/usb/input.h>
#include <media/ir-core.h> #include <media/ir-core.h>
#include <media/ir-common.h>
#define DRIVER_VERSION "1.91" #define DRIVER_VERSION "1.91"
#define DRIVER_AUTHOR "Jarod Wilson <jarod@wilsonet.com>" #define DRIVER_AUTHOR "Jarod Wilson <jarod@wilsonet.com>"
@ -49,6 +49,7 @@
#define USB_BUFLEN 32 /* USB reception buffer length */ #define USB_BUFLEN 32 /* USB reception buffer length */
#define USB_CTRL_MSG_SZ 2 /* Size of usb ctrl msg on gen1 hw */ #define USB_CTRL_MSG_SZ 2 /* Size of usb ctrl msg on gen1 hw */
#define MCE_G1_INIT_MSGS 40 /* Init messages on gen1 hw to throw out */ #define MCE_G1_INIT_MSGS 40 /* Init messages on gen1 hw to throw out */
#define MS_TO_NS(msec) ((msec) * 1000)
/* MCE constants */ /* MCE constants */
#define MCE_CMDBUF_SIZE 384 /* MCE Command buffer length */ #define MCE_CMDBUF_SIZE 384 /* MCE Command buffer length */
@ -74,6 +75,7 @@
#define MCE_PACKET_LENGTH_MASK 0x1f /* Packet length mask */ #define MCE_PACKET_LENGTH_MASK 0x1f /* Packet length mask */
/* Sub-commands, which follow MCE_COMMAND_HEADER or MCE_HW_CMD_HEADER */ /* Sub-commands, which follow MCE_COMMAND_HEADER or MCE_HW_CMD_HEADER */
#define MCE_CMD_SIG_END 0x01 /* End of signal */
#define MCE_CMD_PING 0x03 /* Ping device */ #define MCE_CMD_PING 0x03 /* Ping device */
#define MCE_CMD_UNKNOWN 0x04 /* Unknown */ #define MCE_CMD_UNKNOWN 0x04 /* Unknown */
#define MCE_CMD_UNKNOWN2 0x05 /* Unknown */ #define MCE_CMD_UNKNOWN2 0x05 /* Unknown */
@ -91,6 +93,7 @@
#define MCE_CMD_G_TXMASK 0x13 /* Set TX port bitmask */ #define MCE_CMD_G_TXMASK 0x13 /* Set TX port bitmask */
#define MCE_CMD_S_RXSENSOR 0x14 /* Set RX sensor (std/learning) */ #define MCE_CMD_S_RXSENSOR 0x14 /* Set RX sensor (std/learning) */
#define MCE_CMD_G_RXSENSOR 0x15 /* Get RX sensor (std/learning) */ #define MCE_CMD_G_RXSENSOR 0x15 /* Get RX sensor (std/learning) */
#define MCE_RSP_PULSE_COUNT 0x15 /* RX pulse count (only if learning) */
#define MCE_CMD_TX_PORTS 0x16 /* Get number of TX ports */ #define MCE_CMD_TX_PORTS 0x16 /* Get number of TX ports */
#define MCE_CMD_G_WAKESRC 0x17 /* Get wake source */ #define MCE_CMD_G_WAKESRC 0x17 /* Get wake source */
#define MCE_CMD_UNKNOWN7 0x18 /* Unknown */ #define MCE_CMD_UNKNOWN7 0x18 /* Unknown */
@ -146,14 +149,16 @@ enum mceusb_model_type {
MCE_GEN3, MCE_GEN3,
MCE_GEN2_TX_INV, MCE_GEN2_TX_INV,
POLARIS_EVK, POLARIS_EVK,
CX_HYBRID_TV,
}; };
struct mceusb_model { struct mceusb_model {
u32 mce_gen1:1; u32 mce_gen1:1;
u32 mce_gen2:1; u32 mce_gen2:1;
u32 mce_gen3:1; u32 mce_gen3:1;
u32 tx_mask_inverted:1; u32 tx_mask_normal:1;
u32 is_polaris:1; u32 is_polaris:1;
u32 no_tx:1;
const char *rc_map; /* Allow specify a per-board map */ const char *rc_map; /* Allow specify a per-board map */
const char *name; /* per-board name */ const char *name; /* per-board name */
@ -162,18 +167,18 @@ struct mceusb_model {
static const struct mceusb_model mceusb_model[] = { static const struct mceusb_model mceusb_model[] = {
[MCE_GEN1] = { [MCE_GEN1] = {
.mce_gen1 = 1, .mce_gen1 = 1,
.tx_mask_inverted = 1, .tx_mask_normal = 1,
}, },
[MCE_GEN2] = { [MCE_GEN2] = {
.mce_gen2 = 1, .mce_gen2 = 1,
}, },
[MCE_GEN2_TX_INV] = { [MCE_GEN2_TX_INV] = {
.mce_gen2 = 1, .mce_gen2 = 1,
.tx_mask_inverted = 1, .tx_mask_normal = 1,
}, },
[MCE_GEN3] = { [MCE_GEN3] = {
.mce_gen3 = 1, .mce_gen3 = 1,
.tx_mask_inverted = 1, .tx_mask_normal = 1,
}, },
[POLARIS_EVK] = { [POLARIS_EVK] = {
.is_polaris = 1, .is_polaris = 1,
@ -183,7 +188,12 @@ static const struct mceusb_model mceusb_model[] = {
* to allow testing it * to allow testing it
*/ */
.rc_map = RC_MAP_RC5_HAUPPAUGE_NEW, .rc_map = RC_MAP_RC5_HAUPPAUGE_NEW,
.name = "cx231xx MCE IR", .name = "Conexant Hybrid TV (cx231xx) MCE IR",
},
[CX_HYBRID_TV] = {
.is_polaris = 1,
.no_tx = 1, /* tx isn't wired up at all */
.name = "Conexant Hybrid TV (cx231xx) MCE IR",
}, },
}; };
@ -273,6 +283,8 @@ static struct usb_device_id mceusb_dev_table[] = {
{ USB_DEVICE(VENDOR_FORMOSA, 0xe03c) }, { USB_DEVICE(VENDOR_FORMOSA, 0xe03c) },
/* Formosa Industrial Computing */ /* Formosa Industrial Computing */
{ USB_DEVICE(VENDOR_FORMOSA, 0xe03e) }, { USB_DEVICE(VENDOR_FORMOSA, 0xe03e) },
/* Fintek eHome Infrared Transceiver (HP branded) */
{ USB_DEVICE(VENDOR_FINTEK, 0x5168) },
/* Fintek eHome Infrared Transceiver */ /* Fintek eHome Infrared Transceiver */
{ USB_DEVICE(VENDOR_FINTEK, 0x0602) }, { USB_DEVICE(VENDOR_FINTEK, 0x0602) },
/* Fintek eHome Infrared Transceiver (in the AOpen MP45) */ /* Fintek eHome Infrared Transceiver (in the AOpen MP45) */
@ -292,9 +304,12 @@ static struct usb_device_id mceusb_dev_table[] = {
{ USB_DEVICE(VENDOR_NORTHSTAR, 0xe004) }, { USB_DEVICE(VENDOR_NORTHSTAR, 0xe004) },
/* TiVo PC IR Receiver */ /* TiVo PC IR Receiver */
{ USB_DEVICE(VENDOR_TIVO, 0x2000) }, { USB_DEVICE(VENDOR_TIVO, 0x2000) },
/* Conexant SDK */ /* Conexant Hybrid TV "Shelby" Polaris SDK */
{ USB_DEVICE(VENDOR_CONEXANT, 0x58a1), { USB_DEVICE(VENDOR_CONEXANT, 0x58a1),
.driver_info = POLARIS_EVK }, .driver_info = POLARIS_EVK },
/* Conexant Hybrid TV RDU253S Polaris */
{ USB_DEVICE(VENDOR_CONEXANT, 0x58a5),
.driver_info = CX_HYBRID_TV },
/* Terminating entry */ /* Terminating entry */
{ } { }
}; };
@ -303,7 +318,10 @@ static struct usb_device_id mceusb_dev_table[] = {
struct mceusb_dev { struct mceusb_dev {
/* ir-core bits */ /* ir-core bits */
struct ir_dev_props *props; struct ir_dev_props *props;
struct ir_raw_event rawir;
/* optional features we can enable */
bool carrier_report_enabled;
bool learning_enabled;
/* core device bits */ /* core device bits */
struct device *dev; struct device *dev;
@ -318,6 +336,8 @@ struct mceusb_dev {
/* buffers and dma */ /* buffers and dma */
unsigned char *buf_in; unsigned char *buf_in;
unsigned int len_in; unsigned int len_in;
dma_addr_t dma_in;
dma_addr_t dma_out;
enum { enum {
CMD_HEADER = 0, CMD_HEADER = 0,
@ -325,15 +345,14 @@ struct mceusb_dev {
CMD_DATA, CMD_DATA,
PARSE_IRDATA, PARSE_IRDATA,
} parser_state; } parser_state;
u8 cmd, rem; /* Remaining IR data bytes in packet */
dma_addr_t dma_in; u8 cmd, rem; /* Remaining IR data bytes in packet */
dma_addr_t dma_out;
struct { struct {
u32 connected:1; u32 connected:1;
u32 tx_mask_inverted:1; u32 tx_mask_normal:1;
u32 microsoft_gen1:1; u32 microsoft_gen1:1;
u32 no_tx:1;
} flags; } flags;
/* transmit support */ /* transmit support */
@ -408,9 +427,10 @@ static int mceusb_cmdsize(u8 cmd, u8 subcmd)
case MCE_CMD_UNKNOWN: case MCE_CMD_UNKNOWN:
case MCE_CMD_S_CARRIER: case MCE_CMD_S_CARRIER:
case MCE_CMD_S_TIMEOUT: case MCE_CMD_S_TIMEOUT:
case MCE_CMD_G_RXSENSOR: case MCE_RSP_PULSE_COUNT:
datasize = 2; datasize = 2;
break; break;
case MCE_CMD_SIG_END:
case MCE_CMD_S_TXMASK: case MCE_CMD_S_TXMASK:
case MCE_CMD_S_RXSENSOR: case MCE_CMD_S_RXSENSOR:
datasize = 1; datasize = 1;
@ -433,7 +453,7 @@ static void mceusb_dev_printdata(struct mceusb_dev *ir, char *buf,
return; return;
/* skip meaningless 0xb1 0x60 header bytes on orig receiver */ /* skip meaningless 0xb1 0x60 header bytes on orig receiver */
if (ir->flags.microsoft_gen1 && !out) if (ir->flags.microsoft_gen1 && !out && !offset)
skip = 2; skip = 2;
if (len <= skip) if (len <= skip)
@ -491,6 +511,9 @@ static void mceusb_dev_printdata(struct mceusb_dev *ir, char *buf,
break; break;
case MCE_COMMAND_HEADER: case MCE_COMMAND_HEADER:
switch (subcmd) { switch (subcmd) {
case MCE_CMD_SIG_END:
dev_info(dev, "End of signal\n");
break;
case MCE_CMD_PING: case MCE_CMD_PING:
dev_info(dev, "Ping\n"); dev_info(dev, "Ping\n");
break; break;
@ -525,10 +548,11 @@ static void mceusb_dev_printdata(struct mceusb_dev *ir, char *buf,
inout, data1 == 0x02 ? "short" : "long"); inout, data1 == 0x02 ? "short" : "long");
break; break;
case MCE_CMD_G_RXSENSOR: case MCE_CMD_G_RXSENSOR:
if (len == 2) /* aka MCE_RSP_PULSE_COUNT */
if (out)
dev_info(dev, "Get receive sensor\n"); dev_info(dev, "Get receive sensor\n");
else else if (ir->learning_enabled)
dev_info(dev, "Received pulse count is %d\n", dev_info(dev, "RX pulse count: %d\n",
((data1 << 8) | data2)); ((data1 << 8) | data2));
break; break;
case MCE_RSP_CMD_INVALID: case MCE_RSP_CMD_INVALID:
@ -724,16 +748,16 @@ out:
return ret ? ret : n; return ret ? ret : n;
} }
/* Sets active IR outputs -- mce devices typically (all?) have two */ /* Sets active IR outputs -- mce devices typically have two */
static int mceusb_set_tx_mask(void *priv, u32 mask) static int mceusb_set_tx_mask(void *priv, u32 mask)
{ {
struct mceusb_dev *ir = priv; struct mceusb_dev *ir = priv;
if (ir->flags.tx_mask_inverted) if (ir->flags.tx_mask_normal)
ir->tx_mask = mask;
else
ir->tx_mask = (mask != MCE_DEFAULT_TX_MASK ? ir->tx_mask = (mask != MCE_DEFAULT_TX_MASK ?
mask ^ MCE_DEFAULT_TX_MASK : mask) << 1; mask ^ MCE_DEFAULT_TX_MASK : mask) << 1;
else
ir->tx_mask = mask;
return 0; return 0;
} }
@ -752,7 +776,7 @@ static int mceusb_set_tx_carrier(void *priv, u32 carrier)
if (carrier == 0) { if (carrier == 0) {
ir->carrier = carrier; ir->carrier = carrier;
cmdbuf[2] = 0x01; cmdbuf[2] = MCE_CMD_SIG_END;
cmdbuf[3] = MCE_IRDATA_TRAILER; cmdbuf[3] = MCE_IRDATA_TRAILER;
dev_dbg(ir->dev, "%s: disabling carrier " dev_dbg(ir->dev, "%s: disabling carrier "
"modulation\n", __func__); "modulation\n", __func__);
@ -782,6 +806,34 @@ static int mceusb_set_tx_carrier(void *priv, u32 carrier)
return carrier; return carrier;
} }
/*
* We don't do anything but print debug spew for many of the command bits
* we receive from the hardware, but some of them are useful information
* we want to store so that we can use them.
*/
static void mceusb_handle_command(struct mceusb_dev *ir, int index)
{
u8 hi = ir->buf_in[index + 1] & 0xff;
u8 lo = ir->buf_in[index + 2] & 0xff;
switch (ir->buf_in[index]) {
/* 2-byte return value commands */
case MCE_CMD_S_TIMEOUT:
ir->props->timeout = MS_TO_NS((hi << 8 | lo) / 2);
break;
/* 1-byte return value commands */
case MCE_CMD_S_TXMASK:
ir->tx_mask = hi;
break;
case MCE_CMD_S_RXSENSOR:
ir->learning_enabled = (hi == 0x02);
break;
default:
break;
}
}
static void mceusb_process_ir_data(struct mceusb_dev *ir, int buf_len) static void mceusb_process_ir_data(struct mceusb_dev *ir, int buf_len)
{ {
DEFINE_IR_RAW_EVENT(rawir); DEFINE_IR_RAW_EVENT(rawir);
@ -791,39 +843,30 @@ static void mceusb_process_ir_data(struct mceusb_dev *ir, int buf_len)
if (ir->flags.microsoft_gen1) if (ir->flags.microsoft_gen1)
i = 2; i = 2;
/* if there's no data, just return now */
if (buf_len <= i)
return;
for (; i < buf_len; i++) { for (; i < buf_len; i++) {
switch (ir->parser_state) { switch (ir->parser_state) {
case SUBCMD: case SUBCMD:
ir->rem = mceusb_cmdsize(ir->cmd, ir->buf_in[i]); ir->rem = mceusb_cmdsize(ir->cmd, ir->buf_in[i]);
mceusb_dev_printdata(ir, ir->buf_in, i - 1, mceusb_dev_printdata(ir, ir->buf_in, i - 1,
ir->rem + 2, false); ir->rem + 2, false);
mceusb_handle_command(ir, i);
ir->parser_state = CMD_DATA; ir->parser_state = CMD_DATA;
break; break;
case PARSE_IRDATA: case PARSE_IRDATA:
ir->rem--; ir->rem--;
rawir.pulse = ((ir->buf_in[i] & MCE_PULSE_BIT) != 0); rawir.pulse = ((ir->buf_in[i] & MCE_PULSE_BIT) != 0);
rawir.duration = (ir->buf_in[i] & MCE_PULSE_MASK) rawir.duration = (ir->buf_in[i] & MCE_PULSE_MASK)
* MCE_TIME_UNIT * 1000; * MS_TO_NS(MCE_TIME_UNIT);
if ((ir->buf_in[i] & MCE_PULSE_MASK) == 0x7f) {
if (ir->rawir.pulse == rawir.pulse) {
ir->rawir.duration += rawir.duration;
} else {
ir->rawir.duration = rawir.duration;
ir->rawir.pulse = rawir.pulse;
}
if (ir->rem)
break;
}
rawir.duration += ir->rawir.duration;
ir->rawir.duration = 0;
ir->rawir.pulse = rawir.pulse;
dev_dbg(ir->dev, "Storing %s with duration %d\n", dev_dbg(ir->dev, "Storing %s with duration %d\n",
rawir.pulse ? "pulse" : "space", rawir.pulse ? "pulse" : "space",
rawir.duration); rawir.duration);
ir_raw_event_store(ir->idev, &rawir); ir_raw_event_store_with_filter(ir->idev, &rawir);
break; break;
case CMD_DATA: case CMD_DATA:
ir->rem--; ir->rem--;
@ -839,19 +882,12 @@ static void mceusb_process_ir_data(struct mceusb_dev *ir, int buf_len)
continue; continue;
} }
ir->rem = (ir->cmd & MCE_PACKET_LENGTH_MASK); ir->rem = (ir->cmd & MCE_PACKET_LENGTH_MASK);
mceusb_dev_printdata(ir, ir->buf_in, i, ir->rem + 1, false); mceusb_dev_printdata(ir, ir->buf_in,
if (ir->rem) { i, ir->rem + 1, false);
if (ir->rem)
ir->parser_state = PARSE_IRDATA; ir->parser_state = PARSE_IRDATA;
break; break;
} }
/*
* a package with len=0 (e. g. 0x80) means end of
* data. We could use it to do the call to
* ir_raw_event_handle(). For now, we don't need to
* use it.
*/
break;
}
if (ir->parser_state != CMD_HEADER && !ir->rem) if (ir->parser_state != CMD_HEADER && !ir->rem)
ir->parser_state = CMD_HEADER; ir->parser_state = CMD_HEADER;
@ -984,9 +1020,11 @@ static void mceusb_get_parameters(struct mceusb_dev *ir)
mce_async_out(ir, GET_CARRIER_FREQ, sizeof(GET_CARRIER_FREQ)); mce_async_out(ir, GET_CARRIER_FREQ, sizeof(GET_CARRIER_FREQ));
mce_sync_in(ir, NULL, maxp); mce_sync_in(ir, NULL, maxp);
if (!ir->flags.no_tx) {
/* get the transmitter bitmask */ /* get the transmitter bitmask */
mce_async_out(ir, GET_TX_BITMASK, sizeof(GET_TX_BITMASK)); mce_async_out(ir, GET_TX_BITMASK, sizeof(GET_TX_BITMASK));
mce_sync_in(ir, NULL, maxp); mce_sync_in(ir, NULL, maxp);
}
/* get receiver timeout value */ /* get receiver timeout value */
mce_async_out(ir, GET_RX_TIMEOUT, sizeof(GET_RX_TIMEOUT)); mce_async_out(ir, GET_RX_TIMEOUT, sizeof(GET_RX_TIMEOUT));
@ -1035,12 +1073,18 @@ static struct input_dev *mceusb_init_input_dev(struct mceusb_dev *ir)
props->priv = ir; props->priv = ir;
props->driver_type = RC_DRIVER_IR_RAW; props->driver_type = RC_DRIVER_IR_RAW;
props->allowed_protos = IR_TYPE_ALL; props->allowed_protos = IR_TYPE_ALL;
props->timeout = MS_TO_NS(1000);
if (!ir->flags.no_tx) {
props->s_tx_mask = mceusb_set_tx_mask; props->s_tx_mask = mceusb_set_tx_mask;
props->s_tx_carrier = mceusb_set_tx_carrier; props->s_tx_carrier = mceusb_set_tx_carrier;
props->tx_ir = mceusb_tx_ir; props->tx_ir = mceusb_tx_ir;
}
ir->props = props; ir->props = props;
usb_to_input_id(ir->usbdev, &idev->id);
idev->dev.parent = ir->dev;
if (mceusb_model[ir->model].rc_map) if (mceusb_model[ir->model].rc_map)
rc_map = mceusb_model[ir->model].rc_map; rc_map = mceusb_model[ir->model].rc_map;
@ -1074,16 +1118,16 @@ static int __devinit mceusb_dev_probe(struct usb_interface *intf,
enum mceusb_model_type model = id->driver_info; enum mceusb_model_type model = id->driver_info;
bool is_gen3; bool is_gen3;
bool is_microsoft_gen1; bool is_microsoft_gen1;
bool tx_mask_inverted; bool tx_mask_normal;
bool is_polaris; bool is_polaris;
dev_dbg(&intf->dev, ": %s called\n", __func__); dev_dbg(&intf->dev, "%s called\n", __func__);
idesc = intf->cur_altsetting; idesc = intf->cur_altsetting;
is_gen3 = mceusb_model[model].mce_gen3; is_gen3 = mceusb_model[model].mce_gen3;
is_microsoft_gen1 = mceusb_model[model].mce_gen1; is_microsoft_gen1 = mceusb_model[model].mce_gen1;
tx_mask_inverted = mceusb_model[model].tx_mask_inverted; tx_mask_normal = mceusb_model[model].tx_mask_normal;
is_polaris = mceusb_model[model].is_polaris; is_polaris = mceusb_model[model].is_polaris;
if (is_polaris) { if (is_polaris) {
@ -1107,7 +1151,7 @@ static int __devinit mceusb_dev_probe(struct usb_interface *intf,
ep_in = ep; ep_in = ep;
ep_in->bmAttributes = USB_ENDPOINT_XFER_INT; ep_in->bmAttributes = USB_ENDPOINT_XFER_INT;
ep_in->bInterval = 1; ep_in->bInterval = 1;
dev_dbg(&intf->dev, ": acceptable inbound endpoint " dev_dbg(&intf->dev, "acceptable inbound endpoint "
"found\n"); "found\n");
} }
@ -1122,12 +1166,12 @@ static int __devinit mceusb_dev_probe(struct usb_interface *intf,
ep_out = ep; ep_out = ep;
ep_out->bmAttributes = USB_ENDPOINT_XFER_INT; ep_out->bmAttributes = USB_ENDPOINT_XFER_INT;
ep_out->bInterval = 1; ep_out->bInterval = 1;
dev_dbg(&intf->dev, ": acceptable outbound endpoint " dev_dbg(&intf->dev, "acceptable outbound endpoint "
"found\n"); "found\n");
} }
} }
if (ep_in == NULL) { if (ep_in == NULL) {
dev_dbg(&intf->dev, ": inbound and/or endpoint not found\n"); dev_dbg(&intf->dev, "inbound and/or endpoint not found\n");
return -ENODEV; return -ENODEV;
} }
@ -1150,11 +1194,10 @@ static int __devinit mceusb_dev_probe(struct usb_interface *intf,
ir->dev = &intf->dev; ir->dev = &intf->dev;
ir->len_in = maxp; ir->len_in = maxp;
ir->flags.microsoft_gen1 = is_microsoft_gen1; ir->flags.microsoft_gen1 = is_microsoft_gen1;
ir->flags.tx_mask_inverted = tx_mask_inverted; ir->flags.tx_mask_normal = tx_mask_normal;
ir->flags.no_tx = mceusb_model[model].no_tx;
ir->model = model; ir->model = model;
init_ir_raw_event(&ir->rawir);
/* Saving usb interface data for use by the transmitter routine */ /* Saving usb interface data for use by the transmitter routine */
ir->usb_ep_in = ep_in; ir->usb_ep_in = ep_in;
ir->usb_ep_out = ep_out; ir->usb_ep_out = ep_out;
@ -1191,6 +1234,7 @@ static int __devinit mceusb_dev_probe(struct usb_interface *intf,
mceusb_get_parameters(ir); mceusb_get_parameters(ir);
if (!ir->flags.no_tx)
mceusb_set_tx_mask(ir, MCE_DEFAULT_TX_MASK); mceusb_set_tx_mask(ir, MCE_DEFAULT_TX_MASK);
usb_set_intfdata(intf, ir); usb_set_intfdata(intf, ir);

View File

@ -603,6 +603,8 @@ static void nvt_process_rx_ir_data(struct nvt_dev *nvt)
count = nvt->pkts; count = nvt->pkts;
nvt_dbg_verbose("Processing buffer of len %d", count); nvt_dbg_verbose("Processing buffer of len %d", count);
init_ir_raw_event(&rawir);
for (i = 0; i < count; i++) { for (i = 0; i < count; i++) {
nvt->pkts--; nvt->pkts--;
sample = nvt->buf[i]; sample = nvt->buf[i];
@ -643,10 +645,14 @@ static void nvt_process_rx_ir_data(struct nvt_dev *nvt)
* indicates end of IR signal, but new data incoming. In both * indicates end of IR signal, but new data incoming. In both
* cases, it means we're ready to call ir_raw_event_handle * cases, it means we're ready to call ir_raw_event_handle
*/ */
if (sample == BUF_PULSE_BIT || ((sample != BUF_LEN_MASK) && if ((sample == BUF_PULSE_BIT) && nvt->pkts) {
(sample & BUF_REPEAT_MASK) == BUF_REPEAT_BYTE)) nvt_dbg("Calling ir_raw_event_handle (signal end)\n");
ir_raw_event_handle(nvt->rdev); ir_raw_event_handle(nvt->rdev);
} }
}
nvt_dbg("Calling ir_raw_event_handle (buffer empty)\n");
ir_raw_event_handle(nvt->rdev);
if (nvt->pkts) { if (nvt->pkts) {
nvt_dbg("Odd, pkts should be 0 now... (its %u)", nvt->pkts); nvt_dbg("Odd, pkts should be 0 now... (its %u)", nvt->pkts);

View File

@ -34,8 +34,9 @@
#include <linux/device.h> #include <linux/device.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/usb.h>
#include <linux/input.h> #include <linux/input.h>
#include <linux/usb.h>
#include <linux/usb/input.h>
#include <media/ir-core.h> #include <media/ir-core.h>
#define DRIVER_VERSION "1.61" #define DRIVER_VERSION "1.61"
@ -140,7 +141,9 @@ static struct usb_driver streamzap_driver = {
static void sz_push(struct streamzap_ir *sz, struct ir_raw_event rawir) static void sz_push(struct streamzap_ir *sz, struct ir_raw_event rawir)
{ {
ir_raw_event_store(sz->idev, &rawir); dev_dbg(sz->dev, "Storing %s with duration %u us\n",
(rawir.pulse ? "pulse" : "space"), rawir.duration);
ir_raw_event_store_with_filter(sz->idev, &rawir);
} }
static void sz_push_full_pulse(struct streamzap_ir *sz, static void sz_push_full_pulse(struct streamzap_ir *sz,
@ -167,7 +170,6 @@ static void sz_push_full_pulse(struct streamzap_ir *sz,
rawir.duration *= 1000; rawir.duration *= 1000;
rawir.duration &= IR_MAX_DURATION; rawir.duration &= IR_MAX_DURATION;
} }
dev_dbg(sz->dev, "ls %u\n", rawir.duration);
sz_push(sz, rawir); sz_push(sz, rawir);
sz->idle = false; sz->idle = false;
@ -180,7 +182,6 @@ static void sz_push_full_pulse(struct streamzap_ir *sz,
sz->sum += rawir.duration; sz->sum += rawir.duration;
rawir.duration *= 1000; rawir.duration *= 1000;
rawir.duration &= IR_MAX_DURATION; rawir.duration &= IR_MAX_DURATION;
dev_dbg(sz->dev, "p %u\n", rawir.duration);
sz_push(sz, rawir); sz_push(sz, rawir);
} }
@ -200,7 +201,6 @@ static void sz_push_full_space(struct streamzap_ir *sz,
rawir.duration += SZ_RESOLUTION / 2; rawir.duration += SZ_RESOLUTION / 2;
sz->sum += rawir.duration; sz->sum += rawir.duration;
rawir.duration *= 1000; rawir.duration *= 1000;
dev_dbg(sz->dev, "s %u\n", rawir.duration);
sz_push(sz, rawir); sz_push(sz, rawir);
} }
@ -221,8 +221,6 @@ static void streamzap_callback(struct urb *urb)
struct streamzap_ir *sz; struct streamzap_ir *sz;
unsigned int i; unsigned int i;
int len; int len;
static int timeout = (((SZ_TIMEOUT * SZ_RESOLUTION * 1000) &
IR_MAX_DURATION) | 0x03000000);
if (!urb) if (!urb)
return; return;
@ -246,7 +244,7 @@ static void streamzap_callback(struct urb *urb)
dev_dbg(sz->dev, "%s: received urb, len %d\n", __func__, len); dev_dbg(sz->dev, "%s: received urb, len %d\n", __func__, len);
for (i = 0; i < len; i++) { for (i = 0; i < len; i++) {
dev_dbg(sz->dev, "sz idx %d: %x\n", dev_dbg(sz->dev, "sz->buf_in[%d]: %x\n",
i, (unsigned char)sz->buf_in[i]); i, (unsigned char)sz->buf_in[i]);
switch (sz->decoder_state) { switch (sz->decoder_state) {
case PulseSpace: case PulseSpace:
@ -273,7 +271,7 @@ static void streamzap_callback(struct urb *urb)
DEFINE_IR_RAW_EVENT(rawir); DEFINE_IR_RAW_EVENT(rawir);
rawir.pulse = false; rawir.pulse = false;
rawir.duration = timeout; rawir.duration = sz->props->timeout;
sz->idle = true; sz->idle = true;
if (sz->timeout_enabled) if (sz->timeout_enabled)
sz_push(sz, rawir); sz_push(sz, rawir);
@ -335,6 +333,9 @@ static struct input_dev *streamzap_init_input_dev(struct streamzap_ir *sz)
sz->props = props; sz->props = props;
usb_to_input_id(sz->usbdev, &idev->id);
idev->dev.parent = sz->dev;
ret = ir_input_register(idev, RC_MAP_STREAMZAP, props, DRIVER_NAME); ret = ir_input_register(idev, RC_MAP_STREAMZAP, props, DRIVER_NAME);
if (ret < 0) { if (ret < 0) {
dev_err(dev, "remote input device register failed\n"); dev_err(dev, "remote input device register failed\n");
@ -444,6 +445,8 @@ static int __devinit streamzap_probe(struct usb_interface *intf,
sz->decoder_state = PulseSpace; sz->decoder_state = PulseSpace;
/* FIXME: don't yet have a way to set this */ /* FIXME: don't yet have a way to set this */
sz->timeout_enabled = true; sz->timeout_enabled = true;
sz->props->timeout = (((SZ_TIMEOUT * SZ_RESOLUTION * 1000) &
IR_MAX_DURATION) | 0x03000000);
#if 0 #if 0
/* not yet supported, depends on patches from maxim */ /* not yet supported, depends on patches from maxim */
/* see also: LIRC_GET_REC_RESOLUTION and LIRC_SET_REC_TIMEOUT */ /* see also: LIRC_GET_REC_RESOLUTION and LIRC_SET_REC_TIMEOUT */

View File

@ -807,8 +807,6 @@ static int mx2_camera_set_bus_param(struct soc_camera_device *icd,
if (common_flags & SOCAM_PCLK_SAMPLE_RISING) if (common_flags & SOCAM_PCLK_SAMPLE_RISING)
csicr1 |= CSICR1_REDGE; csicr1 |= CSICR1_REDGE;
if (common_flags & SOCAM_PCLK_SAMPLE_FALLING)
csicr1 |= CSICR1_INV_PCLK;
if (common_flags & SOCAM_VSYNC_ACTIVE_HIGH) if (common_flags & SOCAM_VSYNC_ACTIVE_HIGH)
csicr1 |= CSICR1_SOF_POL; csicr1 |= CSICR1_SOF_POL;
if (common_flags & SOCAM_HSYNC_ACTIVE_HIGH) if (common_flags & SOCAM_HSYNC_ACTIVE_HIGH)

View File

@ -522,6 +522,7 @@ static int fimc_cap_streamon(struct file *file, void *priv,
INIT_LIST_HEAD(&fimc->vid_cap.active_buf_q); INIT_LIST_HEAD(&fimc->vid_cap.active_buf_q);
fimc->vid_cap.active_buf_cnt = 0; fimc->vid_cap.active_buf_cnt = 0;
fimc->vid_cap.frame_count = 0; fimc->vid_cap.frame_count = 0;
fimc->vid_cap.buf_index = fimc_hw_get_frame_index(fimc);
set_bit(ST_CAPT_PEND, &fimc->state); set_bit(ST_CAPT_PEND, &fimc->state);
ret = videobuf_streamon(&fimc->vid_cap.vbq); ret = videobuf_streamon(&fimc->vid_cap.vbq);
@ -652,6 +653,50 @@ static int fimc_cap_s_ctrl(struct file *file, void *priv,
return ret; return ret;
} }
static int fimc_cap_cropcap(struct file *file, void *fh,
struct v4l2_cropcap *cr)
{
struct fimc_frame *f;
struct fimc_ctx *ctx = fh;
struct fimc_dev *fimc = ctx->fimc_dev;
if (cr->type != V4L2_BUF_TYPE_VIDEO_CAPTURE)
return -EINVAL;
if (mutex_lock_interruptible(&fimc->lock))
return -ERESTARTSYS;
f = &ctx->s_frame;
cr->bounds.left = 0;
cr->bounds.top = 0;
cr->bounds.width = f->o_width;
cr->bounds.height = f->o_height;
cr->defrect = cr->bounds;
mutex_unlock(&fimc->lock);
return 0;
}
static int fimc_cap_g_crop(struct file *file, void *fh, struct v4l2_crop *cr)
{
struct fimc_frame *f;
struct fimc_ctx *ctx = file->private_data;
struct fimc_dev *fimc = ctx->fimc_dev;
if (mutex_lock_interruptible(&fimc->lock))
return -ERESTARTSYS;
f = &ctx->s_frame;
cr->c.left = f->offs_h;
cr->c.top = f->offs_v;
cr->c.width = f->width;
cr->c.height = f->height;
mutex_unlock(&fimc->lock);
return 0;
}
static int fimc_cap_s_crop(struct file *file, void *fh, static int fimc_cap_s_crop(struct file *file, void *fh,
struct v4l2_crop *cr) struct v4l2_crop *cr)
{ {
@ -716,9 +761,9 @@ static const struct v4l2_ioctl_ops fimc_capture_ioctl_ops = {
.vidioc_g_ctrl = fimc_vidioc_g_ctrl, .vidioc_g_ctrl = fimc_vidioc_g_ctrl,
.vidioc_s_ctrl = fimc_cap_s_ctrl, .vidioc_s_ctrl = fimc_cap_s_ctrl,
.vidioc_g_crop = fimc_vidioc_g_crop, .vidioc_g_crop = fimc_cap_g_crop,
.vidioc_s_crop = fimc_cap_s_crop, .vidioc_s_crop = fimc_cap_s_crop,
.vidioc_cropcap = fimc_vidioc_cropcap, .vidioc_cropcap = fimc_cap_cropcap,
.vidioc_enum_input = fimc_cap_enum_input, .vidioc_enum_input = fimc_cap_enum_input,
.vidioc_s_input = fimc_cap_s_input, .vidioc_s_input = fimc_cap_s_input,
@ -785,7 +830,7 @@ int fimc_register_capture_device(struct fimc_dev *fimc)
videobuf_queue_dma_contig_init(&vid_cap->vbq, &fimc_qops, videobuf_queue_dma_contig_init(&vid_cap->vbq, &fimc_qops,
vid_cap->v4l2_dev.dev, &fimc->irqlock, vid_cap->v4l2_dev.dev, &fimc->irqlock,
V4L2_BUF_TYPE_VIDEO_CAPTURE, V4L2_FIELD_NONE, V4L2_BUF_TYPE_VIDEO_CAPTURE, V4L2_FIELD_NONE,
sizeof(struct fimc_vid_buffer), (void *)ctx); sizeof(struct fimc_vid_buffer), (void *)ctx, NULL);
ret = video_register_device(vfd, VFL_TYPE_GRABBER, -1); ret = video_register_device(vfd, VFL_TYPE_GRABBER, -1);
if (ret) { if (ret) {

View File

@ -50,8 +50,8 @@ static struct fimc_fmt fimc_formats[] = {
.planes_cnt = 1, .planes_cnt = 1,
.flags = FMT_FLAGS_M2M, .flags = FMT_FLAGS_M2M,
}, { }, {
.name = "XRGB-8-8-8-8, 24 bpp", .name = "XRGB-8-8-8-8, 32 bpp",
.fourcc = V4L2_PIX_FMT_RGB24, .fourcc = V4L2_PIX_FMT_RGB32,
.depth = 32, .depth = 32,
.color = S5P_FIMC_RGB888, .color = S5P_FIMC_RGB888,
.buff_cnt = 1, .buff_cnt = 1,
@ -983,6 +983,7 @@ int fimc_vidioc_queryctrl(struct file *file, void *priv,
{ {
struct fimc_ctx *ctx = priv; struct fimc_ctx *ctx = priv;
struct v4l2_queryctrl *c; struct v4l2_queryctrl *c;
int ret = -EINVAL;
c = get_ctrl(qc->id); c = get_ctrl(qc->id);
if (c) { if (c) {
@ -990,10 +991,14 @@ int fimc_vidioc_queryctrl(struct file *file, void *priv,
return 0; return 0;
} }
if (ctx->state & FIMC_CTX_CAP) if (ctx->state & FIMC_CTX_CAP) {
return v4l2_subdev_call(ctx->fimc_dev->vid_cap.sd, if (mutex_lock_interruptible(&ctx->fimc_dev->lock))
return -ERESTARTSYS;
ret = v4l2_subdev_call(ctx->fimc_dev->vid_cap.sd,
core, queryctrl, qc); core, queryctrl, qc);
return -EINVAL; mutex_unlock(&ctx->fimc_dev->lock);
}
return ret;
} }
int fimc_vidioc_g_ctrl(struct file *file, void *priv, int fimc_vidioc_g_ctrl(struct file *file, void *priv,
@ -1115,7 +1120,7 @@ static int fimc_m2m_s_ctrl(struct file *file, void *priv,
return 0; return 0;
} }
int fimc_vidioc_cropcap(struct file *file, void *fh, static int fimc_m2m_cropcap(struct file *file, void *fh,
struct v4l2_cropcap *cr) struct v4l2_cropcap *cr)
{ {
struct fimc_frame *frame; struct fimc_frame *frame;
@ -1139,7 +1144,7 @@ int fimc_vidioc_cropcap(struct file *file, void *fh,
return 0; return 0;
} }
int fimc_vidioc_g_crop(struct file *file, void *fh, struct v4l2_crop *cr) static int fimc_m2m_g_crop(struct file *file, void *fh, struct v4l2_crop *cr)
{ {
struct fimc_frame *frame; struct fimc_frame *frame;
struct fimc_ctx *ctx = file->private_data; struct fimc_ctx *ctx = file->private_data;
@ -1167,22 +1172,22 @@ int fimc_try_crop(struct fimc_ctx *ctx, struct v4l2_crop *cr)
struct fimc_frame *f; struct fimc_frame *f;
u32 min_size, halign; u32 min_size, halign;
f = (cr->type == V4L2_BUF_TYPE_VIDEO_OUTPUT) ?
&ctx->s_frame : &ctx->d_frame;
if (cr->c.top < 0 || cr->c.left < 0) { if (cr->c.top < 0 || cr->c.left < 0) {
v4l2_err(&fimc->m2m.v4l2_dev, v4l2_err(&fimc->m2m.v4l2_dev,
"doesn't support negative values for top & left\n"); "doesn't support negative values for top & left\n");
return -EINVAL; return -EINVAL;
} }
f = ctx_get_frame(ctx, cr->type); if (cr->type == V4L2_BUF_TYPE_VIDEO_CAPTURE)
if (IS_ERR(f)) f = (ctx->state & FIMC_CTX_CAP) ? &ctx->s_frame : &ctx->d_frame;
return PTR_ERR(f); else if (cr->type == V4L2_BUF_TYPE_VIDEO_OUTPUT &&
ctx->state & FIMC_CTX_M2M)
f = &ctx->s_frame;
else
return -EINVAL;
min_size = (cr->type == V4L2_BUF_TYPE_VIDEO_OUTPUT) min_size = (f == &ctx->s_frame) ?
? fimc->variant->min_inp_pixsize fimc->variant->min_inp_pixsize : fimc->variant->min_out_pixsize;
: fimc->variant->min_out_pixsize;
if (ctx->state & FIMC_CTX_M2M) { if (ctx->state & FIMC_CTX_M2M) {
if (fimc->id == 1 && fimc->variant->pix_hoff) if (fimc->id == 1 && fimc->variant->pix_hoff)
@ -1233,6 +1238,9 @@ static int fimc_m2m_s_crop(struct file *file, void *fh, struct v4l2_crop *cr)
f = (cr->type == V4L2_BUF_TYPE_VIDEO_OUTPUT) ? f = (cr->type == V4L2_BUF_TYPE_VIDEO_OUTPUT) ?
&ctx->s_frame : &ctx->d_frame; &ctx->s_frame : &ctx->d_frame;
if (mutex_lock_interruptible(&fimc->lock))
return -ERESTARTSYS;
spin_lock_irqsave(&ctx->slock, flags); spin_lock_irqsave(&ctx->slock, flags);
if (~ctx->state & (FIMC_SRC_FMT | FIMC_DST_FMT)) { if (~ctx->state & (FIMC_SRC_FMT | FIMC_DST_FMT)) {
/* Check to see if scaling ratio is within supported range */ /* Check to see if scaling ratio is within supported range */
@ -1241,9 +1249,9 @@ static int fimc_m2m_s_crop(struct file *file, void *fh, struct v4l2_crop *cr)
else else
ret = fimc_check_scaler_ratio(&cr->c, &ctx->s_frame); ret = fimc_check_scaler_ratio(&cr->c, &ctx->s_frame);
if (ret) { if (ret) {
spin_unlock_irqrestore(&ctx->slock, flags);
v4l2_err(&fimc->m2m.v4l2_dev, "Out of scaler range"); v4l2_err(&fimc->m2m.v4l2_dev, "Out of scaler range");
return -EINVAL; ret = -EINVAL;
goto scr_unlock;
} }
} }
ctx->state |= FIMC_PARAMS; ctx->state |= FIMC_PARAMS;
@ -1253,7 +1261,9 @@ static int fimc_m2m_s_crop(struct file *file, void *fh, struct v4l2_crop *cr)
f->width = cr->c.width; f->width = cr->c.width;
f->height = cr->c.height; f->height = cr->c.height;
scr_unlock:
spin_unlock_irqrestore(&ctx->slock, flags); spin_unlock_irqrestore(&ctx->slock, flags);
mutex_unlock(&fimc->lock);
return 0; return 0;
} }
@ -1285,9 +1295,9 @@ static const struct v4l2_ioctl_ops fimc_m2m_ioctl_ops = {
.vidioc_g_ctrl = fimc_vidioc_g_ctrl, .vidioc_g_ctrl = fimc_vidioc_g_ctrl,
.vidioc_s_ctrl = fimc_m2m_s_ctrl, .vidioc_s_ctrl = fimc_m2m_s_ctrl,
.vidioc_g_crop = fimc_vidioc_g_crop, .vidioc_g_crop = fimc_m2m_g_crop,
.vidioc_s_crop = fimc_m2m_s_crop, .vidioc_s_crop = fimc_m2m_s_crop,
.vidioc_cropcap = fimc_vidioc_cropcap .vidioc_cropcap = fimc_m2m_cropcap
}; };
@ -1396,7 +1406,7 @@ static const struct v4l2_file_operations fimc_m2m_fops = {
.open = fimc_m2m_open, .open = fimc_m2m_open,
.release = fimc_m2m_release, .release = fimc_m2m_release,
.poll = fimc_m2m_poll, .poll = fimc_m2m_poll,
.ioctl = video_ioctl2, .unlocked_ioctl = video_ioctl2,
.mmap = fimc_m2m_mmap, .mmap = fimc_m2m_mmap,
}; };
@ -1736,6 +1746,7 @@ static struct samsung_fimc_variant fimc0_variant_s5pv310 = {
.pix_hoff = 1, .pix_hoff = 1,
.has_inp_rot = 1, .has_inp_rot = 1,
.has_out_rot = 1, .has_out_rot = 1,
.has_cistatus2 = 1,
.min_inp_pixsize = 16, .min_inp_pixsize = 16,
.min_out_pixsize = 16, .min_out_pixsize = 16,
.hor_offs_align = 1, .hor_offs_align = 1,
@ -1745,6 +1756,7 @@ static struct samsung_fimc_variant fimc0_variant_s5pv310 = {
static struct samsung_fimc_variant fimc2_variant_s5pv310 = { static struct samsung_fimc_variant fimc2_variant_s5pv310 = {
.pix_hoff = 1, .pix_hoff = 1,
.has_cistatus2 = 1,
.min_inp_pixsize = 16, .min_inp_pixsize = 16,
.min_out_pixsize = 16, .min_out_pixsize = 16,
.hor_offs_align = 1, .hor_offs_align = 1,

View File

@ -13,13 +13,15 @@
/*#define DEBUG*/ /*#define DEBUG*/
#include <linux/sched.h>
#include <linux/types.h> #include <linux/types.h>
#include <linux/videodev2.h>
#include <media/videobuf-core.h> #include <media/videobuf-core.h>
#include <media/v4l2-device.h> #include <media/v4l2-device.h>
#include <media/v4l2-mem2mem.h> #include <media/v4l2-mem2mem.h>
#include <media/v4l2-mediabus.h> #include <media/v4l2-mediabus.h>
#include <media/s3c_fimc.h> #include <media/s3c_fimc.h>
#include <linux/videodev2.h>
#include "regs-fimc.h" #include "regs-fimc.h"
#define err(fmt, args...) \ #define err(fmt, args...) \
@ -369,6 +371,7 @@ struct fimc_pix_limit {
* @pix_hoff: indicate whether horizontal offset is in pixels or in bytes * @pix_hoff: indicate whether horizontal offset is in pixels or in bytes
* @has_inp_rot: set if has input rotator * @has_inp_rot: set if has input rotator
* @has_out_rot: set if has output rotator * @has_out_rot: set if has output rotator
* @has_cistatus2: 1 if CISTATUS2 register is present in this IP revision
* @pix_limit: pixel size constraints for the scaler * @pix_limit: pixel size constraints for the scaler
* @min_inp_pixsize: minimum input pixel size * @min_inp_pixsize: minimum input pixel size
* @min_out_pixsize: minimum output pixel size * @min_out_pixsize: minimum output pixel size
@ -379,6 +382,7 @@ struct samsung_fimc_variant {
unsigned int pix_hoff:1; unsigned int pix_hoff:1;
unsigned int has_inp_rot:1; unsigned int has_inp_rot:1;
unsigned int has_out_rot:1; unsigned int has_out_rot:1;
unsigned int has_cistatus2:1;
struct fimc_pix_limit *pix_limit; struct fimc_pix_limit *pix_limit;
u16 min_inp_pixsize; u16 min_inp_pixsize;
u16 min_out_pixsize; u16 min_out_pixsize;
@ -554,12 +558,20 @@ static inline struct fimc_frame *ctx_get_frame(struct fimc_ctx *ctx,
return frame; return frame;
} }
/* Return an index to the buffer actually being written. */
static inline u32 fimc_hw_get_frame_index(struct fimc_dev *dev) static inline u32 fimc_hw_get_frame_index(struct fimc_dev *dev)
{ {
u32 reg = readl(dev->regs + S5P_CISTATUS); u32 reg;
if (dev->variant->has_cistatus2) {
reg = readl(dev->regs + S5P_CISTATUS2) & 0x3F;
return reg > 0 ? --reg : reg;
} else {
reg = readl(dev->regs + S5P_CISTATUS);
return (reg & S5P_CISTATUS_FRAMECNT_MASK) >> return (reg & S5P_CISTATUS_FRAMECNT_MASK) >>
S5P_CISTATUS_FRAMECNT_SHIFT; S5P_CISTATUS_FRAMECNT_SHIFT;
} }
}
/* -----------------------------------------------------*/ /* -----------------------------------------------------*/
/* fimc-reg.c */ /* fimc-reg.c */
@ -594,10 +606,6 @@ int fimc_vidioc_g_fmt(struct file *file, void *priv,
struct v4l2_format *f); struct v4l2_format *f);
int fimc_vidioc_try_fmt(struct file *file, void *priv, int fimc_vidioc_try_fmt(struct file *file, void *priv,
struct v4l2_format *f); struct v4l2_format *f);
int fimc_vidioc_g_crop(struct file *file, void *fh,
struct v4l2_crop *cr);
int fimc_vidioc_cropcap(struct file *file, void *fh,
struct v4l2_cropcap *cr);
int fimc_vidioc_queryctrl(struct file *file, void *priv, int fimc_vidioc_queryctrl(struct file *file, void *priv,
struct v4l2_queryctrl *qc); struct v4l2_queryctrl *qc);
int fimc_vidioc_g_ctrl(struct file *file, void *priv, int fimc_vidioc_g_ctrl(struct file *file, void *priv,

View File

@ -165,6 +165,9 @@
#define S5P_CISTATUS_VVALID_A (1 << 15) #define S5P_CISTATUS_VVALID_A (1 << 15)
#define S5P_CISTATUS_VVALID_B (1 << 14) #define S5P_CISTATUS_VVALID_B (1 << 14)
/* Indexes to the last and the currently processed buffer. */
#define S5P_CISTATUS2 0x68
/* Image capture control */ /* Image capture control */
#define S5P_CIIMGCPT 0xc0 #define S5P_CIIMGCPT 0xc0
#define S5P_CIIMGCPT_IMGCPTEN (1 << 31) #define S5P_CIIMGCPT_IMGCPTEN (1 << 31)

View File

@ -1980,7 +1980,7 @@ static int __devinit sh_mobile_ceu_probe(struct platform_device *pdev)
* we complete the completion. * we complete the completion.
*/ */
if (!csi2->driver || !csi2->driver->owner) { if (!csi2->driver) {
complete(&wait.completion); complete(&wait.completion);
/* Either too late, or probing failed */ /* Either too late, or probing failed */
bus_unregister_notifier(&platform_bus_type, &wait.notifier); bus_unregister_notifier(&platform_bus_type, &wait.notifier);

View File

@ -405,13 +405,13 @@ static int soc_camera_open(struct file *file)
ret = soc_camera_set_fmt(icd, &f); ret = soc_camera_set_fmt(icd, &f);
if (ret < 0) if (ret < 0)
goto esfmt; goto esfmt;
ici->ops->init_videobuf(&icd->vb_vidq, icd);
} }
file->private_data = icd; file->private_data = icd;
dev_dbg(&icd->dev, "camera device open\n"); dev_dbg(&icd->dev, "camera device open\n");
ici->ops->init_videobuf(&icd->vb_vidq, icd);
mutex_unlock(&icd->video_lock); mutex_unlock(&icd->video_lock);
return 0; return 0;

View File

@ -303,7 +303,7 @@ static irqreturn_t ab8500_irq(int irq, void *dev)
continue; continue;
do { do {
int bit = __ffs(status); int bit = __ffs(value);
int line = i * 8 + bit; int line = i * 8 + bit;
handle_nested_irq(ab8500->irq_base + line); handle_nested_irq(ab8500->irq_base + line);

View File

@ -1455,7 +1455,11 @@ int wm831x_device_init(struct wm831x *wm831x, unsigned long id, int irq)
dev_err(wm831x->dev, "Failed to read parent ID: %d\n", ret); dev_err(wm831x->dev, "Failed to read parent ID: %d\n", ret);
goto err; goto err;
} }
if (ret != 0x6204) { switch (ret) {
case 0x6204:
case 0x6246:
break;
default:
dev_err(wm831x->dev, "Device is not a WM831x: ID %x\n", ret); dev_err(wm831x->dev, "Device is not a WM831x: ID %x\n", ret);
ret = -EINVAL; ret = -EINVAL;
goto err; goto err;
@ -1620,7 +1624,7 @@ int wm831x_device_init(struct wm831x *wm831x, unsigned long id, int irq)
case WM8325: case WM8325:
ret = mfd_add_devices(wm831x->dev, -1, ret = mfd_add_devices(wm831x->dev, -1,
wm8320_devs, ARRAY_SIZE(wm8320_devs), wm8320_devs, ARRAY_SIZE(wm8320_devs),
NULL, 0); NULL, wm831x->irq_base);
break; break;
default: default:

View File

@ -1773,6 +1773,7 @@ int mmc_pm_notify(struct notifier_block *notify_block,
case PM_POST_SUSPEND: case PM_POST_SUSPEND:
case PM_POST_HIBERNATION: case PM_POST_HIBERNATION:
case PM_POST_RESTORE:
spin_lock_irqsave(&host->lock, flags); spin_lock_irqsave(&host->lock, flags);
host->rescan_disable = 0; host->rescan_disable = 0;

View File

@ -69,6 +69,7 @@
#include <linux/highmem.h> #include <linux/highmem.h>
#include <linux/mmc/host.h> #include <linux/mmc/host.h>
#include <linux/mmc/sdio.h>
#include <asm/io.h> #include <asm/io.h>
#include <asm/irq.h> #include <asm/irq.h>
@ -493,11 +494,15 @@ static void at91_mci_send_command(struct at91mci_host *host, struct mmc_command
else if (data->flags & MMC_DATA_WRITE) else if (data->flags & MMC_DATA_WRITE)
cmdr |= AT91_MCI_TRCMD_START; cmdr |= AT91_MCI_TRCMD_START;
if (cmd->opcode == SD_IO_RW_EXTENDED) {
cmdr |= AT91_MCI_TRTYP_SDIO_BLOCK;
} else {
if (data->flags & MMC_DATA_STREAM) if (data->flags & MMC_DATA_STREAM)
cmdr |= AT91_MCI_TRTYP_STREAM; cmdr |= AT91_MCI_TRTYP_STREAM;
if (data->blocks > 1) if (data->blocks > 1)
cmdr |= AT91_MCI_TRTYP_MULTIPLE; cmdr |= AT91_MCI_TRTYP_MULTIPLE;
} }
}
else { else {
block_length = 0; block_length = 0;
blocks = 0; blocks = 0;

View File

@ -26,6 +26,7 @@
#include <linux/stat.h> #include <linux/stat.h>
#include <linux/mmc/host.h> #include <linux/mmc/host.h>
#include <linux/mmc/sdio.h>
#include <mach/atmel-mci.h> #include <mach/atmel-mci.h>
#include <linux/atmel-mci.h> #include <linux/atmel-mci.h>
@ -532,12 +533,17 @@ static u32 atmci_prepare_command(struct mmc_host *mmc,
data = cmd->data; data = cmd->data;
if (data) { if (data) {
cmdr |= MCI_CMDR_START_XFER; cmdr |= MCI_CMDR_START_XFER;
if (cmd->opcode == SD_IO_RW_EXTENDED) {
cmdr |= MCI_CMDR_SDIO_BLOCK;
} else {
if (data->flags & MMC_DATA_STREAM) if (data->flags & MMC_DATA_STREAM)
cmdr |= MCI_CMDR_STREAM; cmdr |= MCI_CMDR_STREAM;
else if (data->blocks > 1) else if (data->blocks > 1)
cmdr |= MCI_CMDR_MULTI_BLOCK; cmdr |= MCI_CMDR_MULTI_BLOCK;
else else
cmdr |= MCI_CMDR_BLOCK; cmdr |= MCI_CMDR_BLOCK;
}
if (data->flags & MMC_DATA_READ) if (data->flags & MMC_DATA_READ)
cmdr |= MCI_CMDR_TRDIR_READ; cmdr |= MCI_CMDR_TRDIR_READ;

View File

@ -702,6 +702,7 @@ static int __devinit atl1c_sw_init(struct atl1c_adapter *adapter)
adapter->wol = 0; adapter->wol = 0;
device_set_wakeup_enable(&pdev->dev, false);
adapter->link_speed = SPEED_0; adapter->link_speed = SPEED_0;
adapter->link_duplex = FULL_DUPLEX; adapter->link_duplex = FULL_DUPLEX;
adapter->num_rx_queues = AT_DEF_RECEIVE_QUEUE; adapter->num_rx_queues = AT_DEF_RECEIVE_QUEUE;
@ -2444,8 +2445,9 @@ static int atl1c_close(struct net_device *netdev)
return 0; return 0;
} }
static int atl1c_suspend(struct pci_dev *pdev, pm_message_t state) static int atl1c_suspend(struct device *dev)
{ {
struct pci_dev *pdev = to_pci_dev(dev);
struct net_device *netdev = pci_get_drvdata(pdev); struct net_device *netdev = pci_get_drvdata(pdev);
struct atl1c_adapter *adapter = netdev_priv(netdev); struct atl1c_adapter *adapter = netdev_priv(netdev);
struct atl1c_hw *hw = &adapter->hw; struct atl1c_hw *hw = &adapter->hw;
@ -2454,7 +2456,6 @@ static int atl1c_suspend(struct pci_dev *pdev, pm_message_t state)
u32 wol_ctrl_data = 0; u32 wol_ctrl_data = 0;
u16 mii_intr_status_data = 0; u16 mii_intr_status_data = 0;
u32 wufc = adapter->wol; u32 wufc = adapter->wol;
int retval = 0;
atl1c_disable_l0s_l1(hw); atl1c_disable_l0s_l1(hw);
if (netif_running(netdev)) { if (netif_running(netdev)) {
@ -2462,9 +2463,6 @@ static int atl1c_suspend(struct pci_dev *pdev, pm_message_t state)
atl1c_down(adapter); atl1c_down(adapter);
} }
netif_device_detach(netdev); netif_device_detach(netdev);
retval = pci_save_state(pdev);
if (retval)
return retval;
if (wufc) if (wufc)
if (atl1c_phy_power_saving(hw) != 0) if (atl1c_phy_power_saving(hw) != 0)
@ -2525,12 +2523,8 @@ static int atl1c_suspend(struct pci_dev *pdev, pm_message_t state)
AT_WRITE_REG(hw, REG_WOL_CTRL, wol_ctrl_data); AT_WRITE_REG(hw, REG_WOL_CTRL, wol_ctrl_data);
AT_WRITE_REG(hw, REG_MAC_CTRL, mac_ctrl_data); AT_WRITE_REG(hw, REG_MAC_CTRL, mac_ctrl_data);
/* pcie patch */
device_set_wakeup_enable(&pdev->dev, 1);
AT_WRITE_REG(hw, REG_GPHY_CTRL, GPHY_CTRL_DEFAULT | AT_WRITE_REG(hw, REG_GPHY_CTRL, GPHY_CTRL_DEFAULT |
GPHY_CTRL_EXT_RESET); GPHY_CTRL_EXT_RESET);
pci_prepare_to_sleep(pdev);
} else { } else {
AT_WRITE_REG(hw, REG_GPHY_CTRL, GPHY_CTRL_POWER_SAVING); AT_WRITE_REG(hw, REG_GPHY_CTRL, GPHY_CTRL_POWER_SAVING);
master_ctrl_data |= MASTER_CTRL_CLK_SEL_DIS; master_ctrl_data |= MASTER_CTRL_CLK_SEL_DIS;
@ -2540,25 +2534,17 @@ static int atl1c_suspend(struct pci_dev *pdev, pm_message_t state)
AT_WRITE_REG(hw, REG_MAC_CTRL, mac_ctrl_data); AT_WRITE_REG(hw, REG_MAC_CTRL, mac_ctrl_data);
AT_WRITE_REG(hw, REG_WOL_CTRL, 0); AT_WRITE_REG(hw, REG_WOL_CTRL, 0);
hw->phy_configured = false; /* re-init PHY when resume */ hw->phy_configured = false; /* re-init PHY when resume */
pci_enable_wake(pdev, pci_choose_state(pdev, state), 0);
} }
pci_disable_device(pdev);
pci_set_power_state(pdev, pci_choose_state(pdev, state));
return 0; return 0;
} }
static int atl1c_resume(struct pci_dev *pdev) static int atl1c_resume(struct device *dev)
{ {
struct pci_dev *pdev = to_pci_dev(dev);
struct net_device *netdev = pci_get_drvdata(pdev); struct net_device *netdev = pci_get_drvdata(pdev);
struct atl1c_adapter *adapter = netdev_priv(netdev); struct atl1c_adapter *adapter = netdev_priv(netdev);
pci_set_power_state(pdev, PCI_D0);
pci_restore_state(pdev);
pci_enable_wake(pdev, PCI_D3hot, 0);
pci_enable_wake(pdev, PCI_D3cold, 0);
AT_WRITE_REG(&adapter->hw, REG_WOL_CTRL, 0); AT_WRITE_REG(&adapter->hw, REG_WOL_CTRL, 0);
atl1c_reset_pcie(&adapter->hw, ATL1C_PCIE_L0S_L1_DISABLE | atl1c_reset_pcie(&adapter->hw, ATL1C_PCIE_L0S_L1_DISABLE |
ATL1C_PCIE_PHY_RESET); ATL1C_PCIE_PHY_RESET);
@ -2582,7 +2568,12 @@ static int atl1c_resume(struct pci_dev *pdev)
static void atl1c_shutdown(struct pci_dev *pdev) static void atl1c_shutdown(struct pci_dev *pdev)
{ {
atl1c_suspend(pdev, PMSG_SUSPEND); struct net_device *netdev = pci_get_drvdata(pdev);
struct atl1c_adapter *adapter = netdev_priv(netdev);
atl1c_suspend(&pdev->dev);
pci_wake_from_d3(pdev, adapter->wol);
pci_set_power_state(pdev, PCI_D3hot);
} }
static const struct net_device_ops atl1c_netdev_ops = { static const struct net_device_ops atl1c_netdev_ops = {
@ -2886,16 +2877,16 @@ static struct pci_error_handlers atl1c_err_handler = {
.resume = atl1c_io_resume, .resume = atl1c_io_resume,
}; };
static SIMPLE_DEV_PM_OPS(atl1c_pm_ops, atl1c_suspend, atl1c_resume);
static struct pci_driver atl1c_driver = { static struct pci_driver atl1c_driver = {
.name = atl1c_driver_name, .name = atl1c_driver_name,
.id_table = atl1c_pci_tbl, .id_table = atl1c_pci_tbl,
.probe = atl1c_probe, .probe = atl1c_probe,
.remove = __devexit_p(atl1c_remove), .remove = __devexit_p(atl1c_remove),
/* Power Managment Hooks */
.suspend = atl1c_suspend,
.resume = atl1c_resume,
.shutdown = atl1c_shutdown, .shutdown = atl1c_shutdown,
.err_handler = &atl1c_err_handler .err_handler = &atl1c_err_handler,
.driver.pm = &atl1c_pm_ops,
}; };
/* /*

View File

@ -234,7 +234,7 @@ struct be_adapter {
u8 __iomem *db; /* Door Bell */ u8 __iomem *db; /* Door Bell */
u8 __iomem *pcicfg; /* PCI config space */ u8 __iomem *pcicfg; /* PCI config space */
spinlock_t mbox_lock; /* For serializing mbox cmds to BE card */ struct mutex mbox_lock; /* For serializing mbox cmds to BE card */
struct be_dma_mem mbox_mem; struct be_dma_mem mbox_mem;
/* Mbox mem is adjusted to align to 16 bytes. The allocated addr /* Mbox mem is adjusted to align to 16 bytes. The allocated addr
* is stored for freeing purpose */ * is stored for freeing purpose */

View File

@ -462,7 +462,8 @@ int be_cmd_fw_init(struct be_adapter *adapter)
u8 *wrb; u8 *wrb;
int status; int status;
spin_lock(&adapter->mbox_lock); if (mutex_lock_interruptible(&adapter->mbox_lock))
return -1;
wrb = (u8 *)wrb_from_mbox(adapter); wrb = (u8 *)wrb_from_mbox(adapter);
*wrb++ = 0xFF; *wrb++ = 0xFF;
@ -476,7 +477,7 @@ int be_cmd_fw_init(struct be_adapter *adapter)
status = be_mbox_notify_wait(adapter); status = be_mbox_notify_wait(adapter);
spin_unlock(&adapter->mbox_lock); mutex_unlock(&adapter->mbox_lock);
return status; return status;
} }
@ -491,7 +492,8 @@ int be_cmd_fw_clean(struct be_adapter *adapter)
if (adapter->eeh_err) if (adapter->eeh_err)
return -EIO; return -EIO;
spin_lock(&adapter->mbox_lock); if (mutex_lock_interruptible(&adapter->mbox_lock))
return -1;
wrb = (u8 *)wrb_from_mbox(adapter); wrb = (u8 *)wrb_from_mbox(adapter);
*wrb++ = 0xFF; *wrb++ = 0xFF;
@ -505,7 +507,7 @@ int be_cmd_fw_clean(struct be_adapter *adapter)
status = be_mbox_notify_wait(adapter); status = be_mbox_notify_wait(adapter);
spin_unlock(&adapter->mbox_lock); mutex_unlock(&adapter->mbox_lock);
return status; return status;
} }
int be_cmd_eq_create(struct be_adapter *adapter, int be_cmd_eq_create(struct be_adapter *adapter,
@ -516,7 +518,8 @@ int be_cmd_eq_create(struct be_adapter *adapter,
struct be_dma_mem *q_mem = &eq->dma_mem; struct be_dma_mem *q_mem = &eq->dma_mem;
int status; int status;
spin_lock(&adapter->mbox_lock); if (mutex_lock_interruptible(&adapter->mbox_lock))
return -1;
wrb = wrb_from_mbox(adapter); wrb = wrb_from_mbox(adapter);
req = embedded_payload(wrb); req = embedded_payload(wrb);
@ -546,7 +549,7 @@ int be_cmd_eq_create(struct be_adapter *adapter,
eq->created = true; eq->created = true;
} }
spin_unlock(&adapter->mbox_lock); mutex_unlock(&adapter->mbox_lock);
return status; return status;
} }
@ -558,7 +561,8 @@ int be_cmd_mac_addr_query(struct be_adapter *adapter, u8 *mac_addr,
struct be_cmd_req_mac_query *req; struct be_cmd_req_mac_query *req;
int status; int status;
spin_lock(&adapter->mbox_lock); if (mutex_lock_interruptible(&adapter->mbox_lock))
return -1;
wrb = wrb_from_mbox(adapter); wrb = wrb_from_mbox(adapter);
req = embedded_payload(wrb); req = embedded_payload(wrb);
@ -583,7 +587,7 @@ int be_cmd_mac_addr_query(struct be_adapter *adapter, u8 *mac_addr,
memcpy(mac_addr, resp->mac.addr, ETH_ALEN); memcpy(mac_addr, resp->mac.addr, ETH_ALEN);
} }
spin_unlock(&adapter->mbox_lock); mutex_unlock(&adapter->mbox_lock);
return status; return status;
} }
@ -667,7 +671,8 @@ int be_cmd_cq_create(struct be_adapter *adapter,
void *ctxt; void *ctxt;
int status; int status;
spin_lock(&adapter->mbox_lock); if (mutex_lock_interruptible(&adapter->mbox_lock))
return -1;
wrb = wrb_from_mbox(adapter); wrb = wrb_from_mbox(adapter);
req = embedded_payload(wrb); req = embedded_payload(wrb);
@ -701,7 +706,7 @@ int be_cmd_cq_create(struct be_adapter *adapter,
cq->created = true; cq->created = true;
} }
spin_unlock(&adapter->mbox_lock); mutex_unlock(&adapter->mbox_lock);
return status; return status;
} }
@ -724,7 +729,8 @@ int be_cmd_mccq_create(struct be_adapter *adapter,
void *ctxt; void *ctxt;
int status; int status;
spin_lock(&adapter->mbox_lock); if (mutex_lock_interruptible(&adapter->mbox_lock))
return -1;
wrb = wrb_from_mbox(adapter); wrb = wrb_from_mbox(adapter);
req = embedded_payload(wrb); req = embedded_payload(wrb);
@ -754,7 +760,7 @@ int be_cmd_mccq_create(struct be_adapter *adapter,
mccq->id = le16_to_cpu(resp->id); mccq->id = le16_to_cpu(resp->id);
mccq->created = true; mccq->created = true;
} }
spin_unlock(&adapter->mbox_lock); mutex_unlock(&adapter->mbox_lock);
return status; return status;
} }
@ -769,7 +775,8 @@ int be_cmd_txq_create(struct be_adapter *adapter,
void *ctxt; void *ctxt;
int status; int status;
spin_lock(&adapter->mbox_lock); if (mutex_lock_interruptible(&adapter->mbox_lock))
return -1;
wrb = wrb_from_mbox(adapter); wrb = wrb_from_mbox(adapter);
req = embedded_payload(wrb); req = embedded_payload(wrb);
@ -801,7 +808,7 @@ int be_cmd_txq_create(struct be_adapter *adapter,
txq->created = true; txq->created = true;
} }
spin_unlock(&adapter->mbox_lock); mutex_unlock(&adapter->mbox_lock);
return status; return status;
} }
@ -816,7 +823,8 @@ int be_cmd_rxq_create(struct be_adapter *adapter,
struct be_dma_mem *q_mem = &rxq->dma_mem; struct be_dma_mem *q_mem = &rxq->dma_mem;
int status; int status;
spin_lock(&adapter->mbox_lock); if (mutex_lock_interruptible(&adapter->mbox_lock))
return -1;
wrb = wrb_from_mbox(adapter); wrb = wrb_from_mbox(adapter);
req = embedded_payload(wrb); req = embedded_payload(wrb);
@ -843,7 +851,7 @@ int be_cmd_rxq_create(struct be_adapter *adapter,
*rss_id = resp->rss_id; *rss_id = resp->rss_id;
} }
spin_unlock(&adapter->mbox_lock); mutex_unlock(&adapter->mbox_lock);
return status; return status;
} }
@ -862,7 +870,8 @@ int be_cmd_q_destroy(struct be_adapter *adapter, struct be_queue_info *q,
if (adapter->eeh_err) if (adapter->eeh_err)
return -EIO; return -EIO;
spin_lock(&adapter->mbox_lock); if (mutex_lock_interruptible(&adapter->mbox_lock))
return -1;
wrb = wrb_from_mbox(adapter); wrb = wrb_from_mbox(adapter);
req = embedded_payload(wrb); req = embedded_payload(wrb);
@ -899,7 +908,7 @@ int be_cmd_q_destroy(struct be_adapter *adapter, struct be_queue_info *q,
status = be_mbox_notify_wait(adapter); status = be_mbox_notify_wait(adapter);
spin_unlock(&adapter->mbox_lock); mutex_unlock(&adapter->mbox_lock);
return status; return status;
} }
@ -915,7 +924,8 @@ int be_cmd_if_create(struct be_adapter *adapter, u32 cap_flags, u32 en_flags,
struct be_cmd_req_if_create *req; struct be_cmd_req_if_create *req;
int status; int status;
spin_lock(&adapter->mbox_lock); if (mutex_lock_interruptible(&adapter->mbox_lock))
return -1;
wrb = wrb_from_mbox(adapter); wrb = wrb_from_mbox(adapter);
req = embedded_payload(wrb); req = embedded_payload(wrb);
@ -941,7 +951,7 @@ int be_cmd_if_create(struct be_adapter *adapter, u32 cap_flags, u32 en_flags,
*pmac_id = le32_to_cpu(resp->pmac_id); *pmac_id = le32_to_cpu(resp->pmac_id);
} }
spin_unlock(&adapter->mbox_lock); mutex_unlock(&adapter->mbox_lock);
return status; return status;
} }
@ -955,7 +965,8 @@ int be_cmd_if_destroy(struct be_adapter *adapter, u32 interface_id)
if (adapter->eeh_err) if (adapter->eeh_err)
return -EIO; return -EIO;
spin_lock(&adapter->mbox_lock); if (mutex_lock_interruptible(&adapter->mbox_lock))
return -1;
wrb = wrb_from_mbox(adapter); wrb = wrb_from_mbox(adapter);
req = embedded_payload(wrb); req = embedded_payload(wrb);
@ -970,7 +981,7 @@ int be_cmd_if_destroy(struct be_adapter *adapter, u32 interface_id)
status = be_mbox_notify_wait(adapter); status = be_mbox_notify_wait(adapter);
spin_unlock(&adapter->mbox_lock); mutex_unlock(&adapter->mbox_lock);
return status; return status;
} }
@ -1060,7 +1071,8 @@ int be_cmd_get_fw_ver(struct be_adapter *adapter, char *fw_ver)
struct be_cmd_req_get_fw_version *req; struct be_cmd_req_get_fw_version *req;
int status; int status;
spin_lock(&adapter->mbox_lock); if (mutex_lock_interruptible(&adapter->mbox_lock))
return -1;
wrb = wrb_from_mbox(adapter); wrb = wrb_from_mbox(adapter);
req = embedded_payload(wrb); req = embedded_payload(wrb);
@ -1077,7 +1089,7 @@ int be_cmd_get_fw_ver(struct be_adapter *adapter, char *fw_ver)
strncpy(fw_ver, resp->firmware_version_string, FW_VER_LEN); strncpy(fw_ver, resp->firmware_version_string, FW_VER_LEN);
} }
spin_unlock(&adapter->mbox_lock); mutex_unlock(&adapter->mbox_lock);
return status; return status;
} }
@ -1322,7 +1334,8 @@ int be_cmd_query_fw_cfg(struct be_adapter *adapter, u32 *port_num,
struct be_cmd_req_query_fw_cfg *req; struct be_cmd_req_query_fw_cfg *req;
int status; int status;
spin_lock(&adapter->mbox_lock); if (mutex_lock_interruptible(&adapter->mbox_lock))
return -1;
wrb = wrb_from_mbox(adapter); wrb = wrb_from_mbox(adapter);
req = embedded_payload(wrb); req = embedded_payload(wrb);
@ -1341,7 +1354,7 @@ int be_cmd_query_fw_cfg(struct be_adapter *adapter, u32 *port_num,
*caps = le32_to_cpu(resp->function_caps); *caps = le32_to_cpu(resp->function_caps);
} }
spin_unlock(&adapter->mbox_lock); mutex_unlock(&adapter->mbox_lock);
return status; return status;
} }
@ -1352,7 +1365,8 @@ int be_cmd_reset_function(struct be_adapter *adapter)
struct be_cmd_req_hdr *req; struct be_cmd_req_hdr *req;
int status; int status;
spin_lock(&adapter->mbox_lock); if (mutex_lock_interruptible(&adapter->mbox_lock))
return -1;
wrb = wrb_from_mbox(adapter); wrb = wrb_from_mbox(adapter);
req = embedded_payload(wrb); req = embedded_payload(wrb);
@ -1365,7 +1379,7 @@ int be_cmd_reset_function(struct be_adapter *adapter)
status = be_mbox_notify_wait(adapter); status = be_mbox_notify_wait(adapter);
spin_unlock(&adapter->mbox_lock); mutex_unlock(&adapter->mbox_lock);
return status; return status;
} }
@ -1376,7 +1390,8 @@ int be_cmd_rss_config(struct be_adapter *adapter, u8 *rsstable, u16 table_size)
u32 myhash[10]; u32 myhash[10];
int status; int status;
spin_lock(&adapter->mbox_lock); if (mutex_lock_interruptible(&adapter->mbox_lock))
return -1;
wrb = wrb_from_mbox(adapter); wrb = wrb_from_mbox(adapter);
req = embedded_payload(wrb); req = embedded_payload(wrb);
@ -1396,7 +1411,7 @@ int be_cmd_rss_config(struct be_adapter *adapter, u8 *rsstable, u16 table_size)
status = be_mbox_notify_wait(adapter); status = be_mbox_notify_wait(adapter);
spin_unlock(&adapter->mbox_lock); mutex_unlock(&adapter->mbox_lock);
return status; return status;
} }

View File

@ -2677,7 +2677,7 @@ static int be_ctrl_init(struct be_adapter *adapter)
} }
memset(mc_cmd_mem->va, 0, mc_cmd_mem->size); memset(mc_cmd_mem->va, 0, mc_cmd_mem->size);
spin_lock_init(&adapter->mbox_lock); mutex_init(&adapter->mbox_lock);
spin_lock_init(&adapter->mcc_lock); spin_lock_init(&adapter->mcc_lock);
spin_lock_init(&adapter->mcc_cq_lock); spin_lock_init(&adapter->mcc_cq_lock);

View File

@ -88,7 +88,12 @@ static void bond_na_send(struct net_device *slave_dev,
} }
if (vlan_id) { if (vlan_id) {
skb = vlan_put_tag(skb, vlan_id); /* The Ethernet header is not present yet, so it is
* too early to insert a VLAN tag. Force use of an
* out-of-line tag here and let dev_hard_start_xmit()
* insert it if the slave hardware can't.
*/
skb = __vlan_hwaccel_put_tag(skb, vlan_id);
if (!skb) { if (!skb) {
pr_err("failed to insert VLAN tag\n"); pr_err("failed to insert VLAN tag\n");
return; return;

View File

@ -418,36 +418,11 @@ struct vlan_entry *bond_next_vlan(struct bonding *bond, struct vlan_entry *curr)
* @bond: bond device that got this skb for tx. * @bond: bond device that got this skb for tx.
* @skb: hw accel VLAN tagged skb to transmit * @skb: hw accel VLAN tagged skb to transmit
* @slave_dev: slave that is supposed to xmit this skbuff * @slave_dev: slave that is supposed to xmit this skbuff
*
* When the bond gets an skb to transmit that is
* already hardware accelerated VLAN tagged, and it
* needs to relay this skb to a slave that is not
* hw accel capable, the skb needs to be "unaccelerated",
* i.e. strip the hwaccel tag and re-insert it as part
* of the payload.
*/ */
int bond_dev_queue_xmit(struct bonding *bond, struct sk_buff *skb, int bond_dev_queue_xmit(struct bonding *bond, struct sk_buff *skb,
struct net_device *slave_dev) struct net_device *slave_dev)
{ {
unsigned short uninitialized_var(vlan_id);
/* Test vlan_list not vlgrp to catch and handle 802.1p tags */
if (!list_empty(&bond->vlan_list) &&
!(slave_dev->features & NETIF_F_HW_VLAN_TX) &&
vlan_get_tag(skb, &vlan_id) == 0) {
skb->dev = slave_dev; skb->dev = slave_dev;
skb = vlan_put_tag(skb, vlan_id);
if (!skb) {
/* vlan_put_tag() frees the skb in case of error,
* so return success here so the calling functions
* won't attempt to free is again.
*/
return 0;
}
} else {
skb->dev = slave_dev;
}
skb->priority = 1; skb->priority = 1;
#ifdef CONFIG_NET_POLL_CONTROLLER #ifdef CONFIG_NET_POLL_CONTROLLER
if (unlikely(bond->dev->priv_flags & IFF_IN_NETPOLL)) { if (unlikely(bond->dev->priv_flags & IFF_IN_NETPOLL)) {
@ -1203,11 +1178,13 @@ void bond_change_active_slave(struct bonding *bond, struct slave *new_active)
bond_do_fail_over_mac(bond, new_active, bond_do_fail_over_mac(bond, new_active,
old_active); old_active);
if (netif_running(bond->dev)) {
bond->send_grat_arp = bond->params.num_grat_arp; bond->send_grat_arp = bond->params.num_grat_arp;
bond_send_gratuitous_arp(bond); bond_send_gratuitous_arp(bond);
bond->send_unsol_na = bond->params.num_unsol_na; bond->send_unsol_na = bond->params.num_unsol_na;
bond_send_unsolicited_na(bond); bond_send_unsolicited_na(bond);
}
write_unlock_bh(&bond->curr_slave_lock); write_unlock_bh(&bond->curr_slave_lock);
read_unlock(&bond->lock); read_unlock(&bond->lock);
@ -1221,8 +1198,9 @@ void bond_change_active_slave(struct bonding *bond, struct slave *new_active)
/* resend IGMP joins since active slave has changed or /* resend IGMP joins since active slave has changed or
* all were sent on curr_active_slave */ * all were sent on curr_active_slave */
if ((USES_PRIMARY(bond->params.mode) && new_active) || if (((USES_PRIMARY(bond->params.mode) && new_active) ||
bond->params.mode == BOND_MODE_ROUNDROBIN) { bond->params.mode == BOND_MODE_ROUNDROBIN) &&
netif_running(bond->dev)) {
bond->igmp_retrans = bond->params.resend_igmp; bond->igmp_retrans = bond->params.resend_igmp;
queue_delayed_work(bond->wq, &bond->mcast_work, 0); queue_delayed_work(bond->wq, &bond->mcast_work, 0);
} }

View File

@ -269,11 +269,11 @@ static inline struct slave *bond_get_slave_by_dev(struct bonding *bond, struct n
bond_for_each_slave(bond, slave, i) { bond_for_each_slave(bond, slave, i) {
if (slave->dev == slave_dev) { if (slave->dev == slave_dev) {
break; return slave;
} }
} }
return slave; return 0;
} }
static inline struct bonding *bond_get_bond_by_slave(struct slave *slave) static inline struct bonding *bond_get_bond_by_slave(struct slave *slave)

View File

@ -935,7 +935,7 @@ static void epic_init_ring(struct net_device *dev)
/* Fill in the Rx buffers. Handle allocation failure gracefully. */ /* Fill in the Rx buffers. Handle allocation failure gracefully. */
for (i = 0; i < RX_RING_SIZE; i++) { for (i = 0; i < RX_RING_SIZE; i++) {
struct sk_buff *skb = dev_alloc_skb(ep->rx_buf_sz); struct sk_buff *skb = dev_alloc_skb(ep->rx_buf_sz + 2);
ep->rx_skbuff[i] = skb; ep->rx_skbuff[i] = skb;
if (skb == NULL) if (skb == NULL)
break; break;
@ -1233,7 +1233,7 @@ static int epic_rx(struct net_device *dev, int budget)
entry = ep->dirty_rx % RX_RING_SIZE; entry = ep->dirty_rx % RX_RING_SIZE;
if (ep->rx_skbuff[entry] == NULL) { if (ep->rx_skbuff[entry] == NULL) {
struct sk_buff *skb; struct sk_buff *skb;
skb = ep->rx_skbuff[entry] = dev_alloc_skb(ep->rx_buf_sz); skb = ep->rx_skbuff[entry] = dev_alloc_skb(ep->rx_buf_sz + 2);
if (skb == NULL) if (skb == NULL)
break; break;
skb_reserve(skb, 2); /* Align IP on 16 byte boundaries */ skb_reserve(skb, 2); /* Align IP on 16 byte boundaries */

View File

@ -1202,7 +1202,7 @@ static void hamachi_init_ring(struct net_device *dev)
} }
/* Fill in the Rx buffers. Handle allocation failure gracefully. */ /* Fill in the Rx buffers. Handle allocation failure gracefully. */
for (i = 0; i < RX_RING_SIZE; i++) { for (i = 0; i < RX_RING_SIZE; i++) {
struct sk_buff *skb = dev_alloc_skb(hmp->rx_buf_sz); struct sk_buff *skb = dev_alloc_skb(hmp->rx_buf_sz + 2);
hmp->rx_skbuff[i] = skb; hmp->rx_skbuff[i] = skb;
if (skb == NULL) if (skb == NULL)
break; break;
@ -1669,7 +1669,7 @@ static int hamachi_rx(struct net_device *dev)
entry = hmp->dirty_rx % RX_RING_SIZE; entry = hmp->dirty_rx % RX_RING_SIZE;
desc = &(hmp->rx_ring[entry]); desc = &(hmp->rx_ring[entry]);
if (hmp->rx_skbuff[entry] == NULL) { if (hmp->rx_skbuff[entry] == NULL) {
struct sk_buff *skb = dev_alloc_skb(hmp->rx_buf_sz); struct sk_buff *skb = dev_alloc_skb(hmp->rx_buf_sz + 2);
hmp->rx_skbuff[entry] = skb; hmp->rx_skbuff[entry] = skb;
if (skb == NULL) if (skb == NULL)

View File

@ -690,6 +690,7 @@ static void block_output(struct net_device *dev, int count,
static struct pcmcia_device_id axnet_ids[] = { static struct pcmcia_device_id axnet_ids[] = {
PCMCIA_PFC_DEVICE_MANF_CARD(0, 0x016c, 0x0081), PCMCIA_PFC_DEVICE_MANF_CARD(0, 0x016c, 0x0081),
PCMCIA_DEVICE_MANF_CARD(0x018a, 0x0301), PCMCIA_DEVICE_MANF_CARD(0x018a, 0x0301),
PCMCIA_DEVICE_MANF_CARD(0x01bf, 0x2328),
PCMCIA_DEVICE_MANF_CARD(0x026f, 0x0301), PCMCIA_DEVICE_MANF_CARD(0x026f, 0x0301),
PCMCIA_DEVICE_MANF_CARD(0x026f, 0x0303), PCMCIA_DEVICE_MANF_CARD(0x026f, 0x0303),
PCMCIA_DEVICE_MANF_CARD(0x026f, 0x0309), PCMCIA_DEVICE_MANF_CARD(0x026f, 0x0309),

View File

@ -1493,7 +1493,6 @@ static struct pcmcia_device_id pcnet_ids[] = {
PCMCIA_DEVICE_MANF_CARD(0x0149, 0x4530), PCMCIA_DEVICE_MANF_CARD(0x0149, 0x4530),
PCMCIA_DEVICE_MANF_CARD(0x0149, 0xc1ab), PCMCIA_DEVICE_MANF_CARD(0x0149, 0xc1ab),
PCMCIA_DEVICE_MANF_CARD(0x0186, 0x0110), PCMCIA_DEVICE_MANF_CARD(0x0186, 0x0110),
PCMCIA_DEVICE_MANF_CARD(0x01bf, 0x2328),
PCMCIA_DEVICE_MANF_CARD(0x01bf, 0x8041), PCMCIA_DEVICE_MANF_CARD(0x01bf, 0x8041),
PCMCIA_DEVICE_MANF_CARD(0x0213, 0x2452), PCMCIA_DEVICE_MANF_CARD(0x0213, 0x2452),
PCMCIA_DEVICE_MANF_CARD(0x026f, 0x0300), PCMCIA_DEVICE_MANF_CARD(0x026f, 0x0300),

View File

@ -1016,7 +1016,7 @@ static void init_ring(struct net_device *dev)
/* Fill in the Rx buffers. Handle allocation failure gracefully. */ /* Fill in the Rx buffers. Handle allocation failure gracefully. */
for (i = 0; i < RX_RING_SIZE; i++) { for (i = 0; i < RX_RING_SIZE; i++) {
struct sk_buff *skb = dev_alloc_skb(np->rx_buf_sz); struct sk_buff *skb = dev_alloc_skb(np->rx_buf_sz + 2);
np->rx_skbuff[i] = skb; np->rx_skbuff[i] = skb;
if (skb == NULL) if (skb == NULL)
break; break;
@ -1407,7 +1407,7 @@ static void refill_rx (struct net_device *dev)
struct sk_buff *skb; struct sk_buff *skb;
entry = np->dirty_rx % RX_RING_SIZE; entry = np->dirty_rx % RX_RING_SIZE;
if (np->rx_skbuff[entry] == NULL) { if (np->rx_skbuff[entry] == NULL) {
skb = dev_alloc_skb(np->rx_buf_sz); skb = dev_alloc_skb(np->rx_buf_sz + 2);
np->rx_skbuff[entry] = skb; np->rx_skbuff[entry] = skb;
if (skb == NULL) if (skb == NULL)
break; /* Better luck next round. */ break; /* Better luck next round. */

View File

@ -324,7 +324,7 @@ static int bdx_fw_load(struct bdx_priv *priv)
ENTER; ENTER;
master = READ_REG(priv, regINIT_SEMAPHORE); master = READ_REG(priv, regINIT_SEMAPHORE);
if (!READ_REG(priv, regINIT_STATUS) && master) { if (!READ_REG(priv, regINIT_STATUS) && master) {
rc = request_firmware(&fw, "tehuti/firmware.bin", &priv->pdev->dev); rc = request_firmware(&fw, "tehuti/bdx.bin", &priv->pdev->dev);
if (rc) if (rc)
goto out; goto out;
bdx_tx_push_desc_safe(priv, (char *)fw->data, fw->size); bdx_tx_push_desc_safe(priv, (char *)fw->data, fw->size);
@ -2510,4 +2510,4 @@ module_exit(bdx_module_exit);
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
MODULE_AUTHOR(DRIVER_AUTHOR); MODULE_AUTHOR(DRIVER_AUTHOR);
MODULE_DESCRIPTION(BDX_DRV_DESC); MODULE_DESCRIPTION(BDX_DRV_DESC);
MODULE_FIRMWARE("tehuti/firmware.bin"); MODULE_FIRMWARE("tehuti/bdx.bin");

View File

@ -1004,7 +1004,6 @@ typhoon_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info)
} }
strcpy(info->driver, KBUILD_MODNAME); strcpy(info->driver, KBUILD_MODNAME);
strcpy(info->version, UTS_RELEASE);
strcpy(info->bus_info, pci_name(pci_dev)); strcpy(info->bus_info, pci_name(pci_dev));
} }

View File

@ -1507,6 +1507,10 @@ static const struct usb_device_id products [] = {
// ASIX AX88178 10/100/1000 // ASIX AX88178 10/100/1000
USB_DEVICE (0x0b95, 0x1780), USB_DEVICE (0x0b95, 0x1780),
.driver_info = (unsigned long) &ax88178_info, .driver_info = (unsigned long) &ax88178_info,
}, {
// Logitec LAN-GTJ/U2A
USB_DEVICE (0x0789, 0x0160),
.driver_info = (unsigned long) &ax88178_info,
}, { }, {
// Linksys USB200M Rev 2 // Linksys USB200M Rev 2
USB_DEVICE (0x13b1, 0x0018), USB_DEVICE (0x13b1, 0x0018),

View File

@ -1,5 +1,5 @@
/* /*
* MOSCHIP MCS7830 based USB 2.0 Ethernet Devices * MOSCHIP MCS7830 based (7730/7830/7832) USB 2.0 Ethernet Devices
* *
* based on usbnet.c, asix.c and the vendor provided mcs7830 driver * based on usbnet.c, asix.c and the vendor provided mcs7830 driver
* *
@ -11,6 +11,9 @@
* *
* Definitions gathered from MOSCHIP, Data Sheet_7830DA.pdf (thanks!). * Definitions gathered from MOSCHIP, Data Sheet_7830DA.pdf (thanks!).
* *
* 2010-12-19: add 7832 USB PID ("functionality same as MCS7830"),
* per active notification by manufacturer
*
* TODO: * TODO:
* - support HIF_REG_CONFIG_SLEEPMODE/HIF_REG_CONFIG_TXENABLE (via autopm?) * - support HIF_REG_CONFIG_SLEEPMODE/HIF_REG_CONFIG_TXENABLE (via autopm?)
* - implement ethtool_ops get_pauseparam/set_pauseparam * - implement ethtool_ops get_pauseparam/set_pauseparam
@ -60,6 +63,7 @@
#define MCS7830_MAX_MCAST 64 #define MCS7830_MAX_MCAST 64
#define MCS7830_VENDOR_ID 0x9710 #define MCS7830_VENDOR_ID 0x9710
#define MCS7832_PRODUCT_ID 0x7832
#define MCS7830_PRODUCT_ID 0x7830 #define MCS7830_PRODUCT_ID 0x7830
#define MCS7730_PRODUCT_ID 0x7730 #define MCS7730_PRODUCT_ID 0x7730
@ -351,7 +355,7 @@ static int mcs7830_set_autoneg(struct usbnet *dev, int ptrUserPhyMode)
if (!ret) if (!ret)
ret = mcs7830_write_phy(dev, MII_BMCR, ret = mcs7830_write_phy(dev, MII_BMCR,
BMCR_ANENABLE | BMCR_ANRESTART ); BMCR_ANENABLE | BMCR_ANRESTART );
return ret < 0 ? : 0; return ret;
} }
@ -626,7 +630,7 @@ static int mcs7830_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
} }
static const struct driver_info moschip_info = { static const struct driver_info moschip_info = {
.description = "MOSCHIP 7830/7730 usb-NET adapter", .description = "MOSCHIP 7830/7832/7730 usb-NET adapter",
.bind = mcs7830_bind, .bind = mcs7830_bind,
.rx_fixup = mcs7830_rx_fixup, .rx_fixup = mcs7830_rx_fixup,
.flags = FLAG_ETHER, .flags = FLAG_ETHER,
@ -644,6 +648,10 @@ static const struct driver_info sitecom_info = {
}; };
static const struct usb_device_id products[] = { static const struct usb_device_id products[] = {
{
USB_DEVICE(MCS7830_VENDOR_ID, MCS7832_PRODUCT_ID),
.driver_info = (unsigned long) &moschip_info,
},
{ {
USB_DEVICE(MCS7830_VENDOR_ID, MCS7830_PRODUCT_ID), USB_DEVICE(MCS7830_VENDOR_ID, MCS7830_PRODUCT_ID),
.driver_info = (unsigned long) &moschip_info, .driver_info = (unsigned long) &moschip_info,

View File

@ -166,7 +166,9 @@ static netdev_tx_t veth_xmit(struct sk_buff *skb, struct net_device *dev)
if (!(rcv->flags & IFF_UP)) if (!(rcv->flags & IFF_UP))
goto tx_drop; goto tx_drop;
if (dev->features & NETIF_F_NO_CSUM) /* don't change ip_summed == CHECKSUM_PARTIAL, as that
will cause bad checksum on forwarded packets */
if (skb->ip_summed == CHECKSUM_NONE)
skb->ip_summed = rcv_priv->ip_summed; skb->ip_summed = rcv_priv->ip_summed;
length = skb->len + ETH_HLEN; length = skb->len + ETH_HLEN;

View File

@ -891,7 +891,6 @@ void hostap_setup_dev(struct net_device *dev, local_info_t *local,
SET_ETHTOOL_OPS(dev, &prism2_ethtool_ops); SET_ETHTOOL_OPS(dev, &prism2_ethtool_ops);
netif_stop_queue(dev);
} }
static int hostap_enable_hostapd(local_info_t *local, int rtnl_locked) static int hostap_enable_hostapd(local_info_t *local, int rtnl_locked)

View File

@ -315,6 +315,7 @@ struct iwl_cfg iwl100_bgn_cfg = {
.mod_params = &iwlagn_mod_params, .mod_params = &iwlagn_mod_params,
.base_params = &iwl1000_base_params, .base_params = &iwl1000_base_params,
.ht_params = &iwl1000_ht_params, .ht_params = &iwl1000_ht_params,
.use_new_eeprom_reading = true,
}; };
struct iwl_cfg iwl100_bg_cfg = { struct iwl_cfg iwl100_bg_cfg = {
@ -330,6 +331,7 @@ struct iwl_cfg iwl100_bg_cfg = {
.ops = &iwl1000_ops, .ops = &iwl1000_ops,
.mod_params = &iwlagn_mod_params, .mod_params = &iwlagn_mod_params,
.base_params = &iwl1000_base_params, .base_params = &iwl1000_base_params,
.use_new_eeprom_reading = true,
}; };
MODULE_FIRMWARE(IWL1000_MODULE_FIRMWARE(IWL1000_UCODE_API_MAX)); MODULE_FIRMWARE(IWL1000_MODULE_FIRMWARE(IWL1000_UCODE_API_MAX));

View File

@ -561,6 +561,7 @@ struct iwl_cfg iwl6000g2a_2agn_cfg = {
.ht_params = &iwl6000_ht_params, .ht_params = &iwl6000_ht_params,
.need_dc_calib = true, .need_dc_calib = true,
.need_temp_offset_calib = true, .need_temp_offset_calib = true,
.use_new_eeprom_reading = true,
}; };
struct iwl_cfg iwl6000g2a_2abg_cfg = { struct iwl_cfg iwl6000g2a_2abg_cfg = {
@ -578,6 +579,7 @@ struct iwl_cfg iwl6000g2a_2abg_cfg = {
.base_params = &iwl6000_base_params, .base_params = &iwl6000_base_params,
.need_dc_calib = true, .need_dc_calib = true,
.need_temp_offset_calib = true, .need_temp_offset_calib = true,
.use_new_eeprom_reading = true,
}; };
struct iwl_cfg iwl6000g2a_2bg_cfg = { struct iwl_cfg iwl6000g2a_2bg_cfg = {
@ -595,6 +597,7 @@ struct iwl_cfg iwl6000g2a_2bg_cfg = {
.base_params = &iwl6000_base_params, .base_params = &iwl6000_base_params,
.need_dc_calib = true, .need_dc_calib = true,
.need_temp_offset_calib = true, .need_temp_offset_calib = true,
.use_new_eeprom_reading = true,
}; };
struct iwl_cfg iwl6000g2b_2agn_cfg = { struct iwl_cfg iwl6000g2b_2agn_cfg = {
@ -616,6 +619,7 @@ struct iwl_cfg iwl6000g2b_2agn_cfg = {
.need_temp_offset_calib = true, .need_temp_offset_calib = true,
/* Due to bluetooth, we transmit 2.4 GHz probes only on antenna A */ /* Due to bluetooth, we transmit 2.4 GHz probes only on antenna A */
.scan_tx_antennas[IEEE80211_BAND_2GHZ] = ANT_A, .scan_tx_antennas[IEEE80211_BAND_2GHZ] = ANT_A,
.use_new_eeprom_reading = true,
}; };
struct iwl_cfg iwl6000g2b_2abg_cfg = { struct iwl_cfg iwl6000g2b_2abg_cfg = {
@ -636,6 +640,7 @@ struct iwl_cfg iwl6000g2b_2abg_cfg = {
.need_temp_offset_calib = true, .need_temp_offset_calib = true,
/* Due to bluetooth, we transmit 2.4 GHz probes only on antenna A */ /* Due to bluetooth, we transmit 2.4 GHz probes only on antenna A */
.scan_tx_antennas[IEEE80211_BAND_2GHZ] = ANT_A, .scan_tx_antennas[IEEE80211_BAND_2GHZ] = ANT_A,
.use_new_eeprom_reading = true,
}; };
struct iwl_cfg iwl6000g2b_2bgn_cfg = { struct iwl_cfg iwl6000g2b_2bgn_cfg = {
@ -657,6 +662,7 @@ struct iwl_cfg iwl6000g2b_2bgn_cfg = {
.need_temp_offset_calib = true, .need_temp_offset_calib = true,
/* Due to bluetooth, we transmit 2.4 GHz probes only on antenna A */ /* Due to bluetooth, we transmit 2.4 GHz probes only on antenna A */
.scan_tx_antennas[IEEE80211_BAND_2GHZ] = ANT_A, .scan_tx_antennas[IEEE80211_BAND_2GHZ] = ANT_A,
.use_new_eeprom_reading = true,
}; };
struct iwl_cfg iwl6000g2b_2bg_cfg = { struct iwl_cfg iwl6000g2b_2bg_cfg = {
@ -677,6 +683,7 @@ struct iwl_cfg iwl6000g2b_2bg_cfg = {
.need_temp_offset_calib = true, .need_temp_offset_calib = true,
/* Due to bluetooth, we transmit 2.4 GHz probes only on antenna A */ /* Due to bluetooth, we transmit 2.4 GHz probes only on antenna A */
.scan_tx_antennas[IEEE80211_BAND_2GHZ] = ANT_A, .scan_tx_antennas[IEEE80211_BAND_2GHZ] = ANT_A,
.use_new_eeprom_reading = true,
}; };
struct iwl_cfg iwl6000g2b_bgn_cfg = { struct iwl_cfg iwl6000g2b_bgn_cfg = {
@ -698,6 +705,7 @@ struct iwl_cfg iwl6000g2b_bgn_cfg = {
.need_temp_offset_calib = true, .need_temp_offset_calib = true,
/* Due to bluetooth, we transmit 2.4 GHz probes only on antenna A */ /* Due to bluetooth, we transmit 2.4 GHz probes only on antenna A */
.scan_tx_antennas[IEEE80211_BAND_2GHZ] = ANT_A, .scan_tx_antennas[IEEE80211_BAND_2GHZ] = ANT_A,
.use_new_eeprom_reading = true,
}; };
struct iwl_cfg iwl6000g2b_bg_cfg = { struct iwl_cfg iwl6000g2b_bg_cfg = {
@ -718,6 +726,7 @@ struct iwl_cfg iwl6000g2b_bg_cfg = {
.need_temp_offset_calib = true, .need_temp_offset_calib = true,
/* Due to bluetooth, we transmit 2.4 GHz probes only on antenna A */ /* Due to bluetooth, we transmit 2.4 GHz probes only on antenna A */
.scan_tx_antennas[IEEE80211_BAND_2GHZ] = ANT_A, .scan_tx_antennas[IEEE80211_BAND_2GHZ] = ANT_A,
.use_new_eeprom_reading = true,
}; };
/* /*
@ -804,6 +813,7 @@ struct iwl_cfg iwl6050g2_bgn_cfg = {
.base_params = &iwl6050_base_params, .base_params = &iwl6050_base_params,
.ht_params = &iwl6000_ht_params, .ht_params = &iwl6000_ht_params,
.need_dc_calib = true, .need_dc_calib = true,
.use_new_eeprom_reading = true,
}; };
struct iwl_cfg iwl6050_2abg_cfg = { struct iwl_cfg iwl6050_2abg_cfg = {
@ -857,6 +867,7 @@ struct iwl_cfg iwl130_bgn_cfg = {
.need_dc_calib = true, .need_dc_calib = true,
/* Due to bluetooth, we transmit 2.4 GHz probes only on antenna A */ /* Due to bluetooth, we transmit 2.4 GHz probes only on antenna A */
.scan_tx_antennas[IEEE80211_BAND_2GHZ] = ANT_A, .scan_tx_antennas[IEEE80211_BAND_2GHZ] = ANT_A,
.use_new_eeprom_reading = true,
}; };
struct iwl_cfg iwl130_bg_cfg = { struct iwl_cfg iwl130_bg_cfg = {
@ -876,6 +887,7 @@ struct iwl_cfg iwl130_bg_cfg = {
.need_dc_calib = true, .need_dc_calib = true,
/* Due to bluetooth, we transmit 2.4 GHz probes only on antenna A */ /* Due to bluetooth, we transmit 2.4 GHz probes only on antenna A */
.scan_tx_antennas[IEEE80211_BAND_2GHZ] = ANT_A, .scan_tx_antennas[IEEE80211_BAND_2GHZ] = ANT_A,
.use_new_eeprom_reading = true,
}; };
MODULE_FIRMWARE(IWL6000_MODULE_FIRMWARE(IWL6000_UCODE_API_MAX)); MODULE_FIRMWARE(IWL6000_MODULE_FIRMWARE(IWL6000_UCODE_API_MAX));

View File

@ -392,7 +392,7 @@ static s8 iwl_update_channel_txpower(struct iwl_priv *priv,
/** /**
* iwlcore_eeprom_enhanced_txpower: process enhanced tx power info * iwlcore_eeprom_enhanced_txpower: process enhanced tx power info
*/ */
void iwlcore_eeprom_enhanced_txpower(struct iwl_priv *priv) static void iwlcore_eeprom_enhanced_txpower_old(struct iwl_priv *priv)
{ {
int eeprom_section_count = 0; int eeprom_section_count = 0;
int section, element; int section, element;
@ -419,7 +419,8 @@ void iwlcore_eeprom_enhanced_txpower(struct iwl_priv *priv)
* always check for valid entry before process * always check for valid entry before process
* the information * the information
*/ */
if (!enhanced_txpower->common || enhanced_txpower->reserved) if (!(enhanced_txpower->flags || enhanced_txpower->channel) ||
enhanced_txpower->delta_20_in_40)
continue; continue;
for (element = 0; element < eeprom_section_count; element++) { for (element = 0; element < eeprom_section_count; element++) {
@ -452,3 +453,86 @@ void iwlcore_eeprom_enhanced_txpower(struct iwl_priv *priv)
} }
} }
} }
static void
iwlcore_eeprom_enh_txp_read_element(struct iwl_priv *priv,
struct iwl_eeprom_enhanced_txpwr *txp,
s8 max_txpower_avg)
{
int ch_idx;
bool is_ht40 = txp->flags & IWL_EEPROM_ENH_TXP_FL_40MHZ;
enum ieee80211_band band;
band = txp->flags & IWL_EEPROM_ENH_TXP_FL_BAND_52G ?
IEEE80211_BAND_5GHZ : IEEE80211_BAND_2GHZ;
for (ch_idx = 0; ch_idx < priv->channel_count; ch_idx++) {
struct iwl_channel_info *ch_info = &priv->channel_info[ch_idx];
/* update matching channel or from common data only */
if (txp->channel != 0 && ch_info->channel != txp->channel)
continue;
/* update matching band only */
if (band != ch_info->band)
continue;
if (ch_info->max_power_avg < max_txpower_avg && !is_ht40) {
ch_info->max_power_avg = max_txpower_avg;
ch_info->curr_txpow = max_txpower_avg;
ch_info->scan_power = max_txpower_avg;
}
if (is_ht40 && ch_info->ht40_max_power_avg < max_txpower_avg)
ch_info->ht40_max_power_avg = max_txpower_avg;
}
}
#define EEPROM_TXP_OFFS (0x00 | INDIRECT_ADDRESS | INDIRECT_TXP_LIMIT)
#define EEPROM_TXP_ENTRY_LEN sizeof(struct iwl_eeprom_enhanced_txpwr)
#define EEPROM_TXP_SZ_OFFS (0x00 | INDIRECT_ADDRESS | INDIRECT_TXP_LIMIT_SIZE)
static void iwlcore_eeprom_enhanced_txpower_new(struct iwl_priv *priv)
{
struct iwl_eeprom_enhanced_txpwr *txp_array, *txp;
int idx, entries;
__le16 *txp_len;
s8 max_txp_avg, max_txp_avg_halfdbm;
BUILD_BUG_ON(sizeof(struct iwl_eeprom_enhanced_txpwr) != 8);
/* the length is in 16-bit words, but we want entries */
txp_len = (__le16 *) iwlagn_eeprom_query_addr(priv, EEPROM_TXP_SZ_OFFS);
entries = le16_to_cpup(txp_len) * 2 / EEPROM_TXP_ENTRY_LEN;
txp_array = (void *) iwlagn_eeprom_query_addr(priv, EEPROM_TXP_OFFS);
for (idx = 0; idx < entries; idx++) {
txp = &txp_array[idx];
/* skip invalid entries */
if (!(txp->flags & IWL_EEPROM_ENH_TXP_FL_VALID))
continue;
max_txp_avg = iwl_get_max_txpower_avg(priv, txp_array, idx,
&max_txp_avg_halfdbm);
/*
* Update the user limit values values to the highest
* power supported by any channel
*/
if (max_txp_avg > priv->tx_power_user_lmt)
priv->tx_power_user_lmt = max_txp_avg;
if (max_txp_avg_halfdbm > priv->tx_power_lmt_in_half_dbm)
priv->tx_power_lmt_in_half_dbm = max_txp_avg_halfdbm;
iwlcore_eeprom_enh_txp_read_element(priv, txp, max_txp_avg);
}
}
void iwlcore_eeprom_enhanced_txpower(struct iwl_priv *priv)
{
if (priv->cfg->use_new_eeprom_reading)
iwlcore_eeprom_enhanced_txpower_new(priv);
else
iwlcore_eeprom_enhanced_txpower_old(priv);
}

View File

@ -569,6 +569,12 @@ static u32 eeprom_indirect_address(const struct iwl_priv *priv, u32 address)
case INDIRECT_REGULATORY: case INDIRECT_REGULATORY:
offset = iwl_eeprom_query16(priv, EEPROM_LINK_REGULATORY); offset = iwl_eeprom_query16(priv, EEPROM_LINK_REGULATORY);
break; break;
case INDIRECT_TXP_LIMIT:
offset = iwl_eeprom_query16(priv, EEPROM_LINK_TXP_LIMIT);
break;
case INDIRECT_TXP_LIMIT_SIZE:
offset = iwl_eeprom_query16(priv, EEPROM_LINK_TXP_LIMIT_SIZE);
break;
case INDIRECT_CALIBRATION: case INDIRECT_CALIBRATION:
offset = iwl_eeprom_query16(priv, EEPROM_LINK_CALIBRATION); offset = iwl_eeprom_query16(priv, EEPROM_LINK_CALIBRATION);
break; break;

View File

@ -390,6 +390,7 @@ struct iwl_cfg {
const bool need_temp_offset_calib; /* if used set to true */ const bool need_temp_offset_calib; /* if used set to true */
u8 scan_rx_antennas[IEEE80211_NUM_BANDS]; u8 scan_rx_antennas[IEEE80211_NUM_BANDS];
u8 scan_tx_antennas[IEEE80211_NUM_BANDS]; u8 scan_tx_antennas[IEEE80211_NUM_BANDS];
const bool use_new_eeprom_reading; /* temporary, remove later */
}; };
/*************************** /***************************

View File

@ -120,6 +120,17 @@ struct iwl_eeprom_channel {
s8 max_power_avg; /* max power (dBm) on this chnl, limit 31 */ s8 max_power_avg; /* max power (dBm) on this chnl, limit 31 */
} __packed; } __packed;
enum iwl_eeprom_enhanced_txpwr_flags {
IWL_EEPROM_ENH_TXP_FL_VALID = BIT(0),
IWL_EEPROM_ENH_TXP_FL_BAND_52G = BIT(1),
IWL_EEPROM_ENH_TXP_FL_OFDM = BIT(2),
IWL_EEPROM_ENH_TXP_FL_40MHZ = BIT(3),
IWL_EEPROM_ENH_TXP_FL_HT_AP = BIT(4),
IWL_EEPROM_ENH_TXP_FL_RES1 = BIT(5),
IWL_EEPROM_ENH_TXP_FL_RES2 = BIT(6),
IWL_EEPROM_ENH_TXP_FL_COMMON_TYPE = BIT(7),
};
/** /**
* iwl_eeprom_enhanced_txpwr structure * iwl_eeprom_enhanced_txpwr structure
* This structure presents the enhanced regulatory tx power limit layout * This structure presents the enhanced regulatory tx power limit layout
@ -127,21 +138,23 @@ struct iwl_eeprom_channel {
* Enhanced regulatory tx power portion of eeprom image can be broken down * Enhanced regulatory tx power portion of eeprom image can be broken down
* into individual structures; each one is 8 bytes in size and contain the * into individual structures; each one is 8 bytes in size and contain the
* following information * following information
* @common: (desc + channel) not used by driver, should _NOT_ be "zero" * @flags: entry flags
* @channel: channel number
* @chain_a_max_pwr: chain a max power in 1/2 dBm * @chain_a_max_pwr: chain a max power in 1/2 dBm
* @chain_b_max_pwr: chain b max power in 1/2 dBm * @chain_b_max_pwr: chain b max power in 1/2 dBm
* @chain_c_max_pwr: chain c max power in 1/2 dBm * @chain_c_max_pwr: chain c max power in 1/2 dBm
* @reserved: not used, should be "zero" * @delta_20_in_40: 20-in-40 deltas (hi/lo)
* @mimo2_max_pwr: mimo2 max power in 1/2 dBm * @mimo2_max_pwr: mimo2 max power in 1/2 dBm
* @mimo3_max_pwr: mimo3 max power in 1/2 dBm * @mimo3_max_pwr: mimo3 max power in 1/2 dBm
* *
*/ */
struct iwl_eeprom_enhanced_txpwr { struct iwl_eeprom_enhanced_txpwr {
__le16 common; u8 flags;
u8 channel;
s8 chain_a_max; s8 chain_a_max;
s8 chain_b_max; s8 chain_b_max;
s8 chain_c_max; s8 chain_c_max;
s8 reserved; u8 delta_20_in_40;
s8 mimo2_max; s8 mimo2_max;
s8 mimo3_max; s8 mimo3_max;
} __packed; } __packed;
@ -186,6 +199,8 @@ struct iwl_eeprom_enhanced_txpwr {
#define EEPROM_LINK_CALIBRATION (2*0x67) #define EEPROM_LINK_CALIBRATION (2*0x67)
#define EEPROM_LINK_PROCESS_ADJST (2*0x68) #define EEPROM_LINK_PROCESS_ADJST (2*0x68)
#define EEPROM_LINK_OTHERS (2*0x69) #define EEPROM_LINK_OTHERS (2*0x69)
#define EEPROM_LINK_TXP_LIMIT (2*0x6a)
#define EEPROM_LINK_TXP_LIMIT_SIZE (2*0x6b)
/* agn regulatory - indirect access */ /* agn regulatory - indirect access */
#define EEPROM_REG_BAND_1_CHANNELS ((0x08)\ #define EEPROM_REG_BAND_1_CHANNELS ((0x08)\
@ -389,6 +404,8 @@ struct iwl_eeprom_calib_info {
#define INDIRECT_CALIBRATION 0x00040000 #define INDIRECT_CALIBRATION 0x00040000
#define INDIRECT_PROCESS_ADJST 0x00050000 #define INDIRECT_PROCESS_ADJST 0x00050000
#define INDIRECT_OTHERS 0x00060000 #define INDIRECT_OTHERS 0x00060000
#define INDIRECT_TXP_LIMIT 0x00070000
#define INDIRECT_TXP_LIMIT_SIZE 0x00080000
#define INDIRECT_ADDRESS 0x00100000 #define INDIRECT_ADDRESS 0x00100000
/* General */ /* General */

View File

@ -619,7 +619,7 @@ static int lbs_ret_scan(struct lbs_private *priv, unsigned long dummy,
print_ssid(ssid_buf, ssid, ssid_len), print_ssid(ssid_buf, ssid, ssid_len),
LBS_SCAN_RSSI_TO_MBM(rssi)/100); LBS_SCAN_RSSI_TO_MBM(rssi)/100);
if (channel || if (channel &&
!(channel->flags & IEEE80211_CHAN_DISABLED)) !(channel->flags & IEEE80211_CHAN_DISABLED))
cfg80211_inform_bss(wiphy, channel, cfg80211_inform_bss(wiphy, channel,
bssid, le64_to_cpu(*(__le64 *)tsfdesc), bssid, le64_to_cpu(*(__le64 *)tsfdesc),

View File

@ -43,6 +43,7 @@ MODULE_FIRMWARE("isl3887usb");
static struct usb_device_id p54u_table[] __devinitdata = { static struct usb_device_id p54u_table[] __devinitdata = {
/* Version 1 devices (pci chip + net2280) */ /* Version 1 devices (pci chip + net2280) */
{USB_DEVICE(0x0411, 0x0050)}, /* Buffalo WLI2-USB2-G54 */
{USB_DEVICE(0x045e, 0x00c2)}, /* Microsoft MN-710 */ {USB_DEVICE(0x045e, 0x00c2)}, /* Microsoft MN-710 */
{USB_DEVICE(0x0506, 0x0a11)}, /* 3COM 3CRWE254G72 */ {USB_DEVICE(0x0506, 0x0a11)}, /* 3COM 3CRWE254G72 */
{USB_DEVICE(0x06b9, 0x0120)}, /* Thomson SpeedTouch 120g */ {USB_DEVICE(0x06b9, 0x0120)}, /* Thomson SpeedTouch 120g */
@ -56,9 +57,13 @@ static struct usb_device_id p54u_table[] __devinitdata = {
{USB_DEVICE(0x0846, 0x4220)}, /* Netgear WG111 */ {USB_DEVICE(0x0846, 0x4220)}, /* Netgear WG111 */
{USB_DEVICE(0x09aa, 0x1000)}, /* Spinnaker Proto board */ {USB_DEVICE(0x09aa, 0x1000)}, /* Spinnaker Proto board */
{USB_DEVICE(0x0cde, 0x0006)}, /* Medion 40900, Roper Europe */ {USB_DEVICE(0x0cde, 0x0006)}, /* Medion 40900, Roper Europe */
{USB_DEVICE(0x0db0, 0x6826)}, /* MSI UB54G (MS-6826) */
{USB_DEVICE(0x107b, 0x55f2)}, /* Gateway WGU-210 (Gemtek) */ {USB_DEVICE(0x107b, 0x55f2)}, /* Gateway WGU-210 (Gemtek) */
{USB_DEVICE(0x124a, 0x4023)}, /* Shuttle PN15, Airvast WM168g, IOGear GWU513 */ {USB_DEVICE(0x124a, 0x4023)}, /* Shuttle PN15, Airvast WM168g, IOGear GWU513 */
{USB_DEVICE(0x1435, 0x0210)}, /* Inventel UR054G */
{USB_DEVICE(0x15a9, 0x0002)}, /* Gemtek WUBI-100GW 802.11g */
{USB_DEVICE(0x1630, 0x0005)}, /* 2Wire 802.11g USB (v1) / Z-Com */ {USB_DEVICE(0x1630, 0x0005)}, /* 2Wire 802.11g USB (v1) / Z-Com */
{USB_DEVICE(0x182d, 0x096b)}, /* Sitecom WL-107 */
{USB_DEVICE(0x1915, 0x2234)}, /* Linksys WUSB54G OEM */ {USB_DEVICE(0x1915, 0x2234)}, /* Linksys WUSB54G OEM */
{USB_DEVICE(0x1915, 0x2235)}, /* Linksys WUSB54G Portable OEM */ {USB_DEVICE(0x1915, 0x2235)}, /* Linksys WUSB54G Portable OEM */
{USB_DEVICE(0x2001, 0x3701)}, /* DLink DWL-G120 Spinnaker */ {USB_DEVICE(0x2001, 0x3701)}, /* DLink DWL-G120 Spinnaker */
@ -94,6 +99,7 @@ static struct usb_device_id p54u_table[] __devinitdata = {
{USB_DEVICE(0x1435, 0x0427)}, /* Inventel UR054G */ {USB_DEVICE(0x1435, 0x0427)}, /* Inventel UR054G */
{USB_DEVICE(0x1668, 0x1050)}, /* Actiontec 802UIG-1 */ {USB_DEVICE(0x1668, 0x1050)}, /* Actiontec 802UIG-1 */
{USB_DEVICE(0x2001, 0x3704)}, /* DLink DWL-G122 rev A2 */ {USB_DEVICE(0x2001, 0x3704)}, /* DLink DWL-G122 rev A2 */
{USB_DEVICE(0x2001, 0x3705)}, /* D-Link DWL-G120 rev C1 */
{USB_DEVICE(0x413c, 0x5513)}, /* Dell WLA3310 USB Wireless Adapter */ {USB_DEVICE(0x413c, 0x5513)}, /* Dell WLA3310 USB Wireless Adapter */
{USB_DEVICE(0x413c, 0x8102)}, /* Spinnaker DUT */ {USB_DEVICE(0x413c, 0x8102)}, /* Spinnaker DUT */
{USB_DEVICE(0x413c, 0x8104)}, /* Cohiba Proto board */ {USB_DEVICE(0x413c, 0x8104)}, /* Cohiba Proto board */

View File

@ -912,6 +912,7 @@ static int rt2800pci_probe_hw(struct rt2x00_dev *rt2x00dev)
__set_bit(DRIVER_REQUIRE_DMA, &rt2x00dev->flags); __set_bit(DRIVER_REQUIRE_DMA, &rt2x00dev->flags);
__set_bit(DRIVER_REQUIRE_L2PAD, &rt2x00dev->flags); __set_bit(DRIVER_REQUIRE_L2PAD, &rt2x00dev->flags);
__set_bit(DRIVER_REQUIRE_TXSTATUS_FIFO, &rt2x00dev->flags); __set_bit(DRIVER_REQUIRE_TXSTATUS_FIFO, &rt2x00dev->flags);
__set_bit(DRIVER_REQUIRE_TASKLET_CONTEXT, &rt2x00dev->flags);
if (!modparam_nohwcrypt) if (!modparam_nohwcrypt)
__set_bit(CONFIG_SUPPORT_HW_CRYPTO, &rt2x00dev->flags); __set_bit(CONFIG_SUPPORT_HW_CRYPTO, &rt2x00dev->flags);
__set_bit(DRIVER_SUPPORT_LINK_TUNING, &rt2x00dev->flags); __set_bit(DRIVER_SUPPORT_LINK_TUNING, &rt2x00dev->flags);

View File

@ -664,6 +664,7 @@ enum rt2x00_flags {
DRIVER_REQUIRE_COPY_IV, DRIVER_REQUIRE_COPY_IV,
DRIVER_REQUIRE_L2PAD, DRIVER_REQUIRE_L2PAD,
DRIVER_REQUIRE_TXSTATUS_FIFO, DRIVER_REQUIRE_TXSTATUS_FIFO,
DRIVER_REQUIRE_TASKLET_CONTEXT,
/* /*
* Driver features * Driver features

View File

@ -390,9 +390,12 @@ void rt2x00lib_txdone(struct queue_entry *entry,
* through a mac80211 library call (RTS/CTS) then we should not * through a mac80211 library call (RTS/CTS) then we should not
* send the status report back. * send the status report back.
*/ */
if (!(skbdesc_flags & SKBDESC_NOT_MAC80211)) if (!(skbdesc_flags & SKBDESC_NOT_MAC80211)) {
if (test_bit(DRIVER_REQUIRE_TASKLET_CONTEXT, &rt2x00dev->flags))
ieee80211_tx_status(rt2x00dev->hw, entry->skb); ieee80211_tx_status(rt2x00dev->hw, entry->skb);
else else
ieee80211_tx_status_ni(rt2x00dev->hw, entry->skb);
} else
dev_kfree_skb_any(entry->skb); dev_kfree_skb_any(entry->skb);
/* /*

View File

@ -744,7 +744,7 @@ static int yellowfin_init_ring(struct net_device *dev)
} }
for (i = 0; i < RX_RING_SIZE; i++) { for (i = 0; i < RX_RING_SIZE; i++) {
struct sk_buff *skb = dev_alloc_skb(yp->rx_buf_sz); struct sk_buff *skb = dev_alloc_skb(yp->rx_buf_sz + 2);
yp->rx_skbuff[i] = skb; yp->rx_skbuff[i] = skb;
if (skb == NULL) if (skb == NULL)
break; break;
@ -1157,7 +1157,7 @@ static int yellowfin_rx(struct net_device *dev)
for (; yp->cur_rx - yp->dirty_rx > 0; yp->dirty_rx++) { for (; yp->cur_rx - yp->dirty_rx > 0; yp->dirty_rx++) {
entry = yp->dirty_rx % RX_RING_SIZE; entry = yp->dirty_rx % RX_RING_SIZE;
if (yp->rx_skbuff[entry] == NULL) { if (yp->rx_skbuff[entry] == NULL) {
struct sk_buff *skb = dev_alloc_skb(yp->rx_buf_sz); struct sk_buff *skb = dev_alloc_skb(yp->rx_buf_sz + 2);
if (skb == NULL) if (skb == NULL)
break; /* Better luck next round. */ break; /* Better luck next round. */
yp->rx_skbuff[entry] = skb; yp->rx_skbuff[entry] = skb;

View File

@ -61,7 +61,7 @@ void of_i2c_register_devices(struct i2c_adapter *adap)
info.of_node = of_node_get(node); info.of_node = of_node_get(node);
info.archdata = &dev_ad; info.archdata = &dev_ad;
request_module("%s", info.type); request_module("%s%s", I2C_MODULE_PREFIX, info.type);
result = i2c_new_device(adap, &info); result = i2c_new_device(adap, &info);
if (result == NULL) { if (result == NULL) {

View File

@ -115,7 +115,8 @@ static struct pcie_port_service_driver __initdata dummy_driver = {
static int __init select_detection_mode(void) static int __init select_detection_mode(void)
{ {
struct dummy_slot *slot, *tmp; struct dummy_slot *slot, *tmp;
pcie_port_service_register(&dummy_driver); if (pcie_port_service_register(&dummy_driver))
return PCIEHP_DETECT_ACPI;
pcie_port_service_unregister(&dummy_driver); pcie_port_service_unregister(&dummy_driver);
list_for_each_entry_safe(slot, tmp, &dummy_slots, list) { list_for_each_entry_safe(slot, tmp, &dummy_slots, list) {
list_del(&slot->list); list_del(&slot->list);

View File

@ -207,7 +207,7 @@ static int rs5c372_get_datetime(struct i2c_client *client, struct rtc_time *tm)
static int rs5c372_set_datetime(struct i2c_client *client, struct rtc_time *tm) static int rs5c372_set_datetime(struct i2c_client *client, struct rtc_time *tm)
{ {
struct rs5c372 *rs5c = i2c_get_clientdata(client); struct rs5c372 *rs5c = i2c_get_clientdata(client);
unsigned char buf[8]; unsigned char buf[7];
int addr; int addr;
dev_dbg(&client->dev, "%s: tm is secs=%d, mins=%d, hours=%d " dev_dbg(&client->dev, "%s: tm is secs=%d, mins=%d, hours=%d "

View File

@ -677,7 +677,7 @@ bfa_fcs_fabric_sm_isolated(struct bfa_fcs_fabric_s *fabric,
bfa_trc(fabric->fcs, event); bfa_trc(fabric->fcs, event);
wwn2str(pwwn_ptr, fabric->bport.port_cfg.pwwn); wwn2str(pwwn_ptr, fabric->bport.port_cfg.pwwn);
BFA_LOG(KERN_INFO, bfad, log_level, BFA_LOG(KERN_INFO, bfad, bfa_log_level,
"Port is isolated due to VF_ID mismatch. " "Port is isolated due to VF_ID mismatch. "
"PWWN: %s Port VF_ID: %04x switch port VF_ID: %04x.", "PWWN: %s Port VF_ID: %04x switch port VF_ID: %04x.",
pwwn_ptr, fabric->fcs->port_vfid, pwwn_ptr, fabric->fcs->port_vfid,
@ -1411,7 +1411,7 @@ bfa_fcs_fabric_set_fabric_name(struct bfa_fcs_fabric_s *fabric,
wwn2str(pwwn_ptr, bfa_fcs_lport_get_pwwn(&fabric->bport)); wwn2str(pwwn_ptr, bfa_fcs_lport_get_pwwn(&fabric->bport));
wwn2str(fwwn_ptr, wwn2str(fwwn_ptr,
bfa_fcs_lport_get_fabric_name(&fabric->bport)); bfa_fcs_lport_get_fabric_name(&fabric->bport));
BFA_LOG(KERN_WARNING, bfad, log_level, BFA_LOG(KERN_WARNING, bfad, bfa_log_level,
"Base port WWN = %s Fabric WWN = %s\n", "Base port WWN = %s Fabric WWN = %s\n",
pwwn_ptr, fwwn_ptr); pwwn_ptr, fwwn_ptr);
} }

View File

@ -261,7 +261,7 @@ bfa_fcs_itnim_sm_hcb_online(struct bfa_fcs_itnim_s *itnim,
bfa_fcb_itnim_online(itnim->itnim_drv); bfa_fcb_itnim_online(itnim->itnim_drv);
wwn2str(lpwwn_buf, bfa_fcs_lport_get_pwwn(itnim->rport->port)); wwn2str(lpwwn_buf, bfa_fcs_lport_get_pwwn(itnim->rport->port));
wwn2str(rpwwn_buf, itnim->rport->pwwn); wwn2str(rpwwn_buf, itnim->rport->pwwn);
BFA_LOG(KERN_INFO, bfad, log_level, BFA_LOG(KERN_INFO, bfad, bfa_log_level,
"Target (WWN = %s) is online for initiator (WWN = %s)\n", "Target (WWN = %s) is online for initiator (WWN = %s)\n",
rpwwn_buf, lpwwn_buf); rpwwn_buf, lpwwn_buf);
break; break;
@ -301,11 +301,11 @@ bfa_fcs_itnim_sm_online(struct bfa_fcs_itnim_s *itnim,
wwn2str(lpwwn_buf, bfa_fcs_lport_get_pwwn(itnim->rport->port)); wwn2str(lpwwn_buf, bfa_fcs_lport_get_pwwn(itnim->rport->port));
wwn2str(rpwwn_buf, itnim->rport->pwwn); wwn2str(rpwwn_buf, itnim->rport->pwwn);
if (bfa_fcs_lport_is_online(itnim->rport->port) == BFA_TRUE) if (bfa_fcs_lport_is_online(itnim->rport->port) == BFA_TRUE)
BFA_LOG(KERN_ERR, bfad, log_level, BFA_LOG(KERN_ERR, bfad, bfa_log_level,
"Target (WWN = %s) connectivity lost for " "Target (WWN = %s) connectivity lost for "
"initiator (WWN = %s)\n", rpwwn_buf, lpwwn_buf); "initiator (WWN = %s)\n", rpwwn_buf, lpwwn_buf);
else else
BFA_LOG(KERN_INFO, bfad, log_level, BFA_LOG(KERN_INFO, bfad, bfa_log_level,
"Target (WWN = %s) offlined by initiator (WWN = %s)\n", "Target (WWN = %s) offlined by initiator (WWN = %s)\n",
rpwwn_buf, lpwwn_buf); rpwwn_buf, lpwwn_buf);
break; break;

View File

@ -491,7 +491,7 @@ bfa_fcs_lport_online_actions(struct bfa_fcs_lport_s *port)
__port_action[port->fabric->fab_type].online(port); __port_action[port->fabric->fab_type].online(port);
wwn2str(lpwwn_buf, bfa_fcs_lport_get_pwwn(port)); wwn2str(lpwwn_buf, bfa_fcs_lport_get_pwwn(port));
BFA_LOG(KERN_INFO, bfad, log_level, BFA_LOG(KERN_INFO, bfad, bfa_log_level,
"Logical port online: WWN = %s Role = %s\n", "Logical port online: WWN = %s Role = %s\n",
lpwwn_buf, "Initiator"); lpwwn_buf, "Initiator");
@ -512,11 +512,11 @@ bfa_fcs_lport_offline_actions(struct bfa_fcs_lport_s *port)
wwn2str(lpwwn_buf, bfa_fcs_lport_get_pwwn(port)); wwn2str(lpwwn_buf, bfa_fcs_lport_get_pwwn(port));
if (bfa_fcs_fabric_is_online(port->fabric) == BFA_TRUE) if (bfa_fcs_fabric_is_online(port->fabric) == BFA_TRUE)
BFA_LOG(KERN_ERR, bfad, log_level, BFA_LOG(KERN_ERR, bfad, bfa_log_level,
"Logical port lost fabric connectivity: WWN = %s Role = %s\n", "Logical port lost fabric connectivity: WWN = %s Role = %s\n",
lpwwn_buf, "Initiator"); lpwwn_buf, "Initiator");
else else
BFA_LOG(KERN_INFO, bfad, log_level, BFA_LOG(KERN_INFO, bfad, bfa_log_level,
"Logical port taken offline: WWN = %s Role = %s\n", "Logical port taken offline: WWN = %s Role = %s\n",
lpwwn_buf, "Initiator"); lpwwn_buf, "Initiator");
@ -573,7 +573,7 @@ bfa_fcs_lport_deleted(struct bfa_fcs_lport_s *port)
char lpwwn_buf[BFA_STRING_32]; char lpwwn_buf[BFA_STRING_32];
wwn2str(lpwwn_buf, bfa_fcs_lport_get_pwwn(port)); wwn2str(lpwwn_buf, bfa_fcs_lport_get_pwwn(port));
BFA_LOG(KERN_INFO, bfad, log_level, BFA_LOG(KERN_INFO, bfad, bfa_log_level,
"Logical port deleted: WWN = %s Role = %s\n", "Logical port deleted: WWN = %s Role = %s\n",
lpwwn_buf, "Initiator"); lpwwn_buf, "Initiator");
@ -878,7 +878,7 @@ bfa_fcs_lport_init(struct bfa_fcs_lport_s *lport,
vport ? vport->vport_drv : NULL); vport ? vport->vport_drv : NULL);
wwn2str(lpwwn_buf, bfa_fcs_lport_get_pwwn(lport)); wwn2str(lpwwn_buf, bfa_fcs_lport_get_pwwn(lport));
BFA_LOG(KERN_INFO, bfad, log_level, BFA_LOG(KERN_INFO, bfad, bfa_log_level,
"New logical port created: WWN = %s Role = %s\n", "New logical port created: WWN = %s Role = %s\n",
lpwwn_buf, "Initiator"); lpwwn_buf, "Initiator");

View File

@ -2056,7 +2056,7 @@ bfa_fcs_rport_online_action(struct bfa_fcs_rport_s *rport)
wwn2str(lpwwn_buf, bfa_fcs_lport_get_pwwn(port)); wwn2str(lpwwn_buf, bfa_fcs_lport_get_pwwn(port));
wwn2str(rpwwn_buf, rport->pwwn); wwn2str(rpwwn_buf, rport->pwwn);
if (!BFA_FCS_PID_IS_WKA(rport->pid)) if (!BFA_FCS_PID_IS_WKA(rport->pid))
BFA_LOG(KERN_INFO, bfad, log_level, BFA_LOG(KERN_INFO, bfad, bfa_log_level,
"Remote port (WWN = %s) online for logical port (WWN = %s)\n", "Remote port (WWN = %s) online for logical port (WWN = %s)\n",
rpwwn_buf, lpwwn_buf); rpwwn_buf, lpwwn_buf);
} }
@ -2075,12 +2075,12 @@ bfa_fcs_rport_offline_action(struct bfa_fcs_rport_s *rport)
wwn2str(rpwwn_buf, rport->pwwn); wwn2str(rpwwn_buf, rport->pwwn);
if (!BFA_FCS_PID_IS_WKA(rport->pid)) { if (!BFA_FCS_PID_IS_WKA(rport->pid)) {
if (bfa_fcs_lport_is_online(rport->port) == BFA_TRUE) if (bfa_fcs_lport_is_online(rport->port) == BFA_TRUE)
BFA_LOG(KERN_ERR, bfad, log_level, BFA_LOG(KERN_ERR, bfad, bfa_log_level,
"Remote port (WWN = %s) connectivity lost for " "Remote port (WWN = %s) connectivity lost for "
"logical port (WWN = %s)\n", "logical port (WWN = %s)\n",
rpwwn_buf, lpwwn_buf); rpwwn_buf, lpwwn_buf);
else else
BFA_LOG(KERN_INFO, bfad, log_level, BFA_LOG(KERN_INFO, bfad, bfa_log_level,
"Remote port (WWN = %s) offlined by " "Remote port (WWN = %s) offlined by "
"logical port (WWN = %s)\n", "logical port (WWN = %s)\n",
rpwwn_buf, lpwwn_buf); rpwwn_buf, lpwwn_buf);

View File

@ -402,7 +402,7 @@ bfa_ioc_sm_op_entry(struct bfa_ioc_s *ioc)
ioc->cbfn->enable_cbfn(ioc->bfa, BFA_STATUS_OK); ioc->cbfn->enable_cbfn(ioc->bfa, BFA_STATUS_OK);
bfa_ioc_hb_monitor(ioc); bfa_ioc_hb_monitor(ioc);
BFA_LOG(KERN_INFO, bfad, log_level, "IOC enabled\n"); BFA_LOG(KERN_INFO, bfad, bfa_log_level, "IOC enabled\n");
} }
static void static void
@ -444,7 +444,7 @@ bfa_ioc_sm_disabling_entry(struct bfa_ioc_s *ioc)
{ {
struct bfad_s *bfad = (struct bfad_s *)ioc->bfa->bfad; struct bfad_s *bfad = (struct bfad_s *)ioc->bfa->bfad;
bfa_iocpf_disable(ioc); bfa_iocpf_disable(ioc);
BFA_LOG(KERN_INFO, bfad, log_level, "IOC disabled\n"); BFA_LOG(KERN_INFO, bfad, bfa_log_level, "IOC disabled\n");
} }
/* /*
@ -565,7 +565,7 @@ bfa_ioc_sm_fail_entry(struct bfa_ioc_s *ioc)
notify->cbfn(notify->cbarg); notify->cbfn(notify->cbarg);
} }
BFA_LOG(KERN_CRIT, bfad, log_level, BFA_LOG(KERN_CRIT, bfad, bfa_log_level,
"Heart Beat of IOC has failed\n"); "Heart Beat of IOC has failed\n");
} }
@ -1812,7 +1812,7 @@ bfa_ioc_pf_fwmismatch(struct bfa_ioc_s *ioc)
* Provide enable completion callback. * Provide enable completion callback.
*/ */
ioc->cbfn->enable_cbfn(ioc->bfa, BFA_STATUS_IOC_FAILURE); ioc->cbfn->enable_cbfn(ioc->bfa, BFA_STATUS_IOC_FAILURE);
BFA_LOG(KERN_WARNING, bfad, log_level, BFA_LOG(KERN_WARNING, bfad, bfa_log_level,
"Running firmware version is incompatible " "Running firmware version is incompatible "
"with the driver version\n"); "with the driver version\n");
} }

View File

@ -2138,7 +2138,7 @@ bfa_fcport_sm_enabling_qwait(struct bfa_fcport_s *fcport,
bfa_plog_str(fcport->bfa->plog, BFA_PL_MID_HAL, bfa_plog_str(fcport->bfa->plog, BFA_PL_MID_HAL,
BFA_PL_EID_PORT_DISABLE, 0, "Port Disable"); BFA_PL_EID_PORT_DISABLE, 0, "Port Disable");
wwn2str(pwwn_buf, fcport->pwwn); wwn2str(pwwn_buf, fcport->pwwn);
BFA_LOG(KERN_INFO, bfad, log_level, BFA_LOG(KERN_INFO, bfad, bfa_log_level,
"Base port disabled: WWN = %s\n", pwwn_buf); "Base port disabled: WWN = %s\n", pwwn_buf);
break; break;
@ -2198,7 +2198,7 @@ bfa_fcport_sm_enabling(struct bfa_fcport_s *fcport,
bfa_plog_str(fcport->bfa->plog, BFA_PL_MID_HAL, bfa_plog_str(fcport->bfa->plog, BFA_PL_MID_HAL,
BFA_PL_EID_PORT_DISABLE, 0, "Port Disable"); BFA_PL_EID_PORT_DISABLE, 0, "Port Disable");
wwn2str(pwwn_buf, fcport->pwwn); wwn2str(pwwn_buf, fcport->pwwn);
BFA_LOG(KERN_INFO, bfad, log_level, BFA_LOG(KERN_INFO, bfad, bfa_log_level,
"Base port disabled: WWN = %s\n", pwwn_buf); "Base port disabled: WWN = %s\n", pwwn_buf);
break; break;
@ -2251,7 +2251,7 @@ bfa_fcport_sm_linkdown(struct bfa_fcport_s *fcport,
bfa_fcport_scn(fcport, BFA_PORT_LINKUP, BFA_FALSE); bfa_fcport_scn(fcport, BFA_PORT_LINKUP, BFA_FALSE);
wwn2str(pwwn_buf, fcport->pwwn); wwn2str(pwwn_buf, fcport->pwwn);
BFA_LOG(KERN_INFO, bfad, log_level, BFA_LOG(KERN_INFO, bfad, bfa_log_level,
"Base port online: WWN = %s\n", pwwn_buf); "Base port online: WWN = %s\n", pwwn_buf);
break; break;
@ -2277,7 +2277,7 @@ bfa_fcport_sm_linkdown(struct bfa_fcport_s *fcport,
bfa_plog_str(fcport->bfa->plog, BFA_PL_MID_HAL, bfa_plog_str(fcport->bfa->plog, BFA_PL_MID_HAL,
BFA_PL_EID_PORT_DISABLE, 0, "Port Disable"); BFA_PL_EID_PORT_DISABLE, 0, "Port Disable");
wwn2str(pwwn_buf, fcport->pwwn); wwn2str(pwwn_buf, fcport->pwwn);
BFA_LOG(KERN_INFO, bfad, log_level, BFA_LOG(KERN_INFO, bfad, bfa_log_level,
"Base port disabled: WWN = %s\n", pwwn_buf); "Base port disabled: WWN = %s\n", pwwn_buf);
break; break;
@ -2322,9 +2322,9 @@ bfa_fcport_sm_linkup(struct bfa_fcport_s *fcport,
bfa_plog_str(fcport->bfa->plog, BFA_PL_MID_HAL, bfa_plog_str(fcport->bfa->plog, BFA_PL_MID_HAL,
BFA_PL_EID_PORT_DISABLE, 0, "Port Disable"); BFA_PL_EID_PORT_DISABLE, 0, "Port Disable");
wwn2str(pwwn_buf, fcport->pwwn); wwn2str(pwwn_buf, fcport->pwwn);
BFA_LOG(KERN_INFO, bfad, log_level, BFA_LOG(KERN_INFO, bfad, bfa_log_level,
"Base port offline: WWN = %s\n", pwwn_buf); "Base port offline: WWN = %s\n", pwwn_buf);
BFA_LOG(KERN_INFO, bfad, log_level, BFA_LOG(KERN_INFO, bfad, bfa_log_level,
"Base port disabled: WWN = %s\n", pwwn_buf); "Base port disabled: WWN = %s\n", pwwn_buf);
break; break;
@ -2336,10 +2336,10 @@ bfa_fcport_sm_linkup(struct bfa_fcport_s *fcport,
BFA_PL_EID_PORT_ST_CHANGE, 0, "Port Linkdown"); BFA_PL_EID_PORT_ST_CHANGE, 0, "Port Linkdown");
wwn2str(pwwn_buf, fcport->pwwn); wwn2str(pwwn_buf, fcport->pwwn);
if (BFA_PORT_IS_DISABLED(fcport->bfa)) if (BFA_PORT_IS_DISABLED(fcport->bfa))
BFA_LOG(KERN_INFO, bfad, log_level, BFA_LOG(KERN_INFO, bfad, bfa_log_level,
"Base port offline: WWN = %s\n", pwwn_buf); "Base port offline: WWN = %s\n", pwwn_buf);
else else
BFA_LOG(KERN_ERR, bfad, log_level, BFA_LOG(KERN_ERR, bfad, bfa_log_level,
"Base port (WWN = %s) " "Base port (WWN = %s) "
"lost fabric connectivity\n", pwwn_buf); "lost fabric connectivity\n", pwwn_buf);
break; break;
@ -2349,10 +2349,10 @@ bfa_fcport_sm_linkup(struct bfa_fcport_s *fcport,
bfa_fcport_reset_linkinfo(fcport); bfa_fcport_reset_linkinfo(fcport);
wwn2str(pwwn_buf, fcport->pwwn); wwn2str(pwwn_buf, fcport->pwwn);
if (BFA_PORT_IS_DISABLED(fcport->bfa)) if (BFA_PORT_IS_DISABLED(fcport->bfa))
BFA_LOG(KERN_INFO, bfad, log_level, BFA_LOG(KERN_INFO, bfad, bfa_log_level,
"Base port offline: WWN = %s\n", pwwn_buf); "Base port offline: WWN = %s\n", pwwn_buf);
else else
BFA_LOG(KERN_ERR, bfad, log_level, BFA_LOG(KERN_ERR, bfad, bfa_log_level,
"Base port (WWN = %s) " "Base port (WWN = %s) "
"lost fabric connectivity\n", pwwn_buf); "lost fabric connectivity\n", pwwn_buf);
break; break;
@ -2363,10 +2363,10 @@ bfa_fcport_sm_linkup(struct bfa_fcport_s *fcport,
bfa_fcport_scn(fcport, BFA_PORT_LINKDOWN, BFA_FALSE); bfa_fcport_scn(fcport, BFA_PORT_LINKDOWN, BFA_FALSE);
wwn2str(pwwn_buf, fcport->pwwn); wwn2str(pwwn_buf, fcport->pwwn);
if (BFA_PORT_IS_DISABLED(fcport->bfa)) if (BFA_PORT_IS_DISABLED(fcport->bfa))
BFA_LOG(KERN_INFO, bfad, log_level, BFA_LOG(KERN_INFO, bfad, bfa_log_level,
"Base port offline: WWN = %s\n", pwwn_buf); "Base port offline: WWN = %s\n", pwwn_buf);
else else
BFA_LOG(KERN_ERR, bfad, log_level, BFA_LOG(KERN_ERR, bfad, bfa_log_level,
"Base port (WWN = %s) " "Base port (WWN = %s) "
"lost fabric connectivity\n", pwwn_buf); "lost fabric connectivity\n", pwwn_buf);
break; break;
@ -2497,7 +2497,7 @@ bfa_fcport_sm_disabling(struct bfa_fcport_s *fcport,
bfa_plog_str(fcport->bfa->plog, BFA_PL_MID_HAL, bfa_plog_str(fcport->bfa->plog, BFA_PL_MID_HAL,
BFA_PL_EID_PORT_ENABLE, 0, "Port Enable"); BFA_PL_EID_PORT_ENABLE, 0, "Port Enable");
wwn2str(pwwn_buf, fcport->pwwn); wwn2str(pwwn_buf, fcport->pwwn);
BFA_LOG(KERN_INFO, bfad, log_level, BFA_LOG(KERN_INFO, bfad, bfa_log_level,
"Base port enabled: WWN = %s\n", pwwn_buf); "Base port enabled: WWN = %s\n", pwwn_buf);
break; break;
@ -2551,7 +2551,7 @@ bfa_fcport_sm_disabled(struct bfa_fcport_s *fcport,
bfa_plog_str(fcport->bfa->plog, BFA_PL_MID_HAL, bfa_plog_str(fcport->bfa->plog, BFA_PL_MID_HAL,
BFA_PL_EID_PORT_ENABLE, 0, "Port Enable"); BFA_PL_EID_PORT_ENABLE, 0, "Port Enable");
wwn2str(pwwn_buf, fcport->pwwn); wwn2str(pwwn_buf, fcport->pwwn);
BFA_LOG(KERN_INFO, bfad, log_level, BFA_LOG(KERN_INFO, bfad, bfa_log_level,
"Base port enabled: WWN = %s\n", pwwn_buf); "Base port enabled: WWN = %s\n", pwwn_buf);
break; break;

Some files were not shown because too many files have changed in this diff Show More