本文整理汇总了C++中pr_warning函数的典型用法代码示例。如果您正苦于以下问题:C++ pr_warning函数的具体用法?C++ pr_warning怎么用?C++ pr_warning使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了pr_warning函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: rmnet_tx_timeout
static void rmnet_tx_timeout(struct net_device *dev)
{
pr_warning("[%s] rmnet_tx_timeout()\n", dev->name);
}
开发者ID:DirtyDroidX,项目名称:android_kernel_htc_m8ul,代码行数:4,代码来源:msm_rmnet.c
示例2: blk_trace_synthesize_old_trace
static int blk_trace_synthesize_old_trace(struct trace_iterator *iter)
{
struct trace_seq *s = &iter->seq;
struct blk_io_trace *t = (struct blk_io_trace *)iter->ent;
const int offset = offsetof(struct blk_io_trace, sector);
struct blk_io_trace old = {
.magic = BLK_IO_TRACE_MAGIC | BLK_IO_TRACE_VERSION,
.time = iter->ts,
};
if (!trace_seq_putmem(s, &old, offset))
return 0;
return trace_seq_putmem(s, &t->sector,
sizeof(old) - offset + t->pdu_len);
}
static enum print_line_t
blk_trace_event_print_binary(struct trace_iterator *iter, int flags)
{
return blk_trace_synthesize_old_trace(iter) ?
TRACE_TYPE_HANDLED : TRACE_TYPE_PARTIAL_LINE;
}
static enum print_line_t blk_tracer_print_line(struct trace_iterator *iter)
{
if (!(blk_tracer_flags.val & TRACE_BLK_OPT_CLASSIC))
return TRACE_TYPE_UNHANDLED;
return print_one_line(iter, true);
}
static int blk_tracer_set_flag(u32 old_flags, u32 bit, int set)
{
/* don't output context-info for blk_classic output */
if (bit == TRACE_BLK_OPT_CLASSIC) {
if (set)
trace_flags &= ~TRACE_ITER_CONTEXT_INFO;
else
trace_flags |= TRACE_ITER_CONTEXT_INFO;
}
return 0;
}
static struct tracer blk_tracer __read_mostly = {
.name = "blk",
.init = blk_tracer_init,
.reset = blk_tracer_reset,
.start = blk_tracer_start,
.stop = blk_tracer_stop,
.print_header = blk_tracer_print_header,
.print_line = blk_tracer_print_line,
.flags = &blk_tracer_flags,
.set_flag = blk_tracer_set_flag,
};
static struct trace_event trace_blk_event = {
.type = TRACE_BLK,
.trace = blk_trace_event_print,
.binary = blk_trace_event_print_binary,
};
static int __init init_blk_tracer(void)
{
if (!register_ftrace_event(&trace_blk_event)) {
pr_warning("Warning: could not register block events\n");
return 1;
}
if (register_tracer(&blk_tracer) != 0) {
pr_warning("Warning: could not register the block tracer\n");
unregister_ftrace_event(&trace_blk_event);
return 1;
}
return 0;
}
device_initcall(init_blk_tracer);
static int blk_trace_remove_queue(struct request_queue *q)
{
struct blk_trace *bt;
bt = xchg(&q->blk_trace, NULL);
if (bt == NULL)
return -EINVAL;
if (atomic_dec_and_test(&blk_probes_ref))
blk_unregister_tracepoints();
blk_trace_free(bt);
return 0;
}
/*
* Setup everything required to start tracing
*/
static int blk_trace_setup_queue(struct request_queue *q,
struct block_device *bdev)
{
//.........这里部分代码省略.........
开发者ID:A2109devs,项目名称:lenovo_a2109a_kernel,代码行数:101,代码来源:blktrace.c
示例3: da830_evm_init
static __init void da830_evm_init(void)
{
struct davinci_soc_info *soc_info = &davinci_soc_info;
int ret;
ret = da830_register_edma(da830_edma_rsv);
if (ret)
pr_warning("da830_evm_init: edma registration failed: %d\n",
ret);
ret = davinci_cfg_reg_list(da830_i2c0_pins);
if (ret)
pr_warning("da830_evm_init: i2c0 mux setup failed: %d\n",
ret);
ret = da8xx_register_i2c(0, &da830_evm_i2c_0_pdata);
if (ret)
pr_warning("da830_evm_init: i2c0 registration failed: %d\n",
ret);
da830_evm_usb_init();
soc_info->emac_pdata->rmii_en = 1;
soc_info->emac_pdata->phy_id = DA830_EVM_PHY_ID;
ret = davinci_cfg_reg_list(da830_cpgmac_pins);
if (ret)
pr_warning("da830_evm_init: cpgmac mux setup failed: %d\n",
ret);
ret = da8xx_register_emac();
if (ret)
pr_warning("da830_evm_init: emac registration failed: %d\n",
ret);
ret = da8xx_register_watchdog();
if (ret)
pr_warning("da830_evm_init: watchdog registration failed: %d\n",
ret);
davinci_serial_init(&da830_evm_uart_config);
i2c_register_board_info(1, da830_evm_i2c_devices,
ARRAY_SIZE(da830_evm_i2c_devices));
ret = davinci_cfg_reg_list(da830_evm_mcasp1_pins);
if (ret)
pr_warning("da830_evm_init: mcasp1 mux setup failed: %d\n",
ret);
da8xx_register_mcasp(1, &da830_evm_snd_data);
da830_evm_init_mmc();
ret = da8xx_register_rtc();
if (ret)
pr_warning("da830_evm_init: rtc setup failed: %d\n", ret);
ret = da8xx_register_spi(0, da830evm_spi_info,
ARRAY_SIZE(da830evm_spi_info));
if (ret)
pr_warning("da830_evm_init: spi 0 registration failed: %d\n",
ret);
}
开发者ID:1DeMaCr,项目名称:Codina_Kernel-3.x,代码行数:63,代码来源:board-da830-evm.c
示例4: twl6030_irq_thread
/*
* This thread processes interrupts reported by the Primary Interrupt Handler.
*/
static int twl6030_irq_thread(void *data)
{
long irq = (long)data;
static unsigned i2c_errors;
static const unsigned max_i2c_errors = 100;
int ret;
current->flags |= PF_NOFREEZE;
while (!kthread_should_stop()) {
int i;
union {
u8 bytes[4];
u32 int_sts;
} sts;
u32 int_sts; /* sts.int_sts converted to CPU endianness */
/* Wait for IRQ, then read PIH irq status (also blocking) */
wait_for_completion_interruptible(&irq_event);
/* read INT_STS_A, B and C in one shot using a burst read */
ret = twl_i2c_read(TWL_MODULE_PIH, sts.bytes,
REG_INT_STS_A, 3);
if (ret) {
pr_warning("twl6030: I2C error %d reading PIH ISR\n",
ret);
if (++i2c_errors >= max_i2c_errors) {
printk(KERN_ERR "Maximum I2C error count"
" exceeded. Terminating %s.\n",
__func__);
break;
}
complete(&irq_event);
continue;
}
sts.bytes[3] = 0; /* Only 24 bits are valid*/
/*
* Since VBUS status bit is not reliable for VBUS disconnect
* use CHARGER VBUS detection status bit instead.
*/
if (sts.bytes[2] & 0x10)
sts.bytes[2] |= 0x08;
int_sts = le32_to_cpu(sts.int_sts);
for (i = 0; int_sts; int_sts >>= 1, i++) {
local_irq_disable();
if (int_sts & 0x1) {
int module_irq = twl6030_irq_base +
twl6030_interrupt_mapping[i];
generic_handle_irq(module_irq);
}
local_irq_enable();
}
/*
* NOTE:
* Simulation confirms that documentation is wrong w.r.t the
* interrupt status clear operation. A single *byte* write to
* any one of STS_A to STS_C register results in all three
* STS registers being reset. Since it does not matter which
* value is written, all three registers are cleared on a
* single byte write, so we just use 0x0 to clear.
*/
ret = twl_i2c_write_u8(TWL_MODULE_PIH, 0x00, REG_INT_STS_A);
if (ret)
pr_warning("twl6030: I2C error in clearing PIH ISR\n");
enable_irq(irq);
}
return 0;
}
开发者ID:Astralix,项目名称:EasyPad_971_Dual_Core,代码行数:80,代码来源:twl6030-irq.c
示例5: xics_migrate_irqs_away
void xics_migrate_irqs_away(void)
{
int cpu = smp_processor_id(), hw_cpu = hard_smp_processor_id();
unsigned int irq, virq;
struct irq_desc *desc;
if (hw_cpu == xics_default_server)
xics_update_irq_servers();
icp_ops->set_priority(0);
xics_set_cpu_giq(xics_default_distrib_server, 0);
icp_ops->set_priority(DEFAULT_PRIORITY);
for_each_irq_desc(virq, desc) {
struct irq_chip *chip;
long server;
unsigned long flags;
struct ics *ics;
if (virq < NUM_ISA_INTERRUPTS)
continue;
if (!desc->action)
continue;
if (desc->irq_data.domain != xics_host)
continue;
irq = desc->irq_data.hwirq;
if (irq == XICS_IPI || irq == XICS_IRQ_SPURIOUS)
continue;
chip = irq_desc_get_chip(desc);
if (!chip || !chip->irq_set_affinity)
continue;
raw_spin_lock_irqsave(&desc->lock, flags);
server = -1;
ics = irq_get_chip_data(virq);
if (ics)
server = ics->get_server(ics, irq);
if (server < 0) {
printk(KERN_ERR "%s: Can't find server for irq %d\n",
__func__, irq);
goto unlock;
}
if (server != hw_cpu)
goto unlock;
if (cpu_online(cpu))
pr_warning("IRQ %u affinity broken off cpu %u\n",
virq, cpu);
raw_spin_unlock_irqrestore(&desc->lock, flags);
irq_set_affinity(virq, cpu_all_mask);
continue;
unlock:
raw_spin_unlock_irqrestore(&desc->lock, flags);
}
}
开发者ID:Blackburn29,项目名称:PsycoKernel,代码行数:70,代码来源:xics-common.c
示例6: mmc_select_powerclass
/*
* Select the PowerClass for the current bus width
* If power class is defined for 4/8 bit bus in the
* extended CSD register, select it by executing the
* mmc_switch command.
*/
static int mmc_select_powerclass(struct mmc_card *card,
unsigned int bus_width, u8 *ext_csd)
{
int err = 0;
unsigned int pwrclass_val;
unsigned int index = 0;
struct mmc_host *host;
BUG_ON(!card);
host = card->host;
BUG_ON(!host);
if (ext_csd == NULL)
return 0;
/* Power class selection is supported for versions >= 4.0 */
if (card->csd.mmca_vsn < CSD_SPEC_VER_4)
return 0;
/* Power class values are defined only for 4/8 bit bus */
if (bus_width == EXT_CSD_BUS_WIDTH_1)
return 0;
switch (1 << host->ios.vdd) {
case MMC_VDD_165_195:
if (host->ios.clock <= 26000000)
index = EXT_CSD_PWR_CL_26_195;
else if (host->ios.clock <= 52000000)
index = (bus_width <= EXT_CSD_BUS_WIDTH_8) ?
EXT_CSD_PWR_CL_52_195 :
EXT_CSD_PWR_CL_DDR_52_195;
else if (host->ios.clock <= 200000000)
index = EXT_CSD_PWR_CL_200_195;
break;
case MMC_VDD_27_28:
case MMC_VDD_28_29:
case MMC_VDD_29_30:
case MMC_VDD_30_31:
case MMC_VDD_31_32:
case MMC_VDD_32_33:
case MMC_VDD_33_34:
case MMC_VDD_34_35:
case MMC_VDD_35_36:
if (host->ios.clock <= 26000000)
index = EXT_CSD_PWR_CL_26_360;
else if (host->ios.clock <= 52000000)
index = (bus_width <= EXT_CSD_BUS_WIDTH_8) ?
EXT_CSD_PWR_CL_52_360 :
EXT_CSD_PWR_CL_DDR_52_360;
else if (host->ios.clock <= 200000000)
index = EXT_CSD_PWR_CL_200_360;
break;
default:
pr_warning("%s: Voltage range not supported "
"for power class.\n", mmc_hostname(host));
return -EINVAL;
}
pwrclass_val = ext_csd[index];
if (bus_width & (EXT_CSD_BUS_WIDTH_8 | EXT_CSD_DDR_BUS_WIDTH_8))
pwrclass_val = (pwrclass_val & EXT_CSD_PWR_CL_8BIT_MASK) >>
EXT_CSD_PWR_CL_8BIT_SHIFT;
else
开发者ID:android-armv7a-belalang-tempur,项目名称:Adam-Kernel-GS4,代码行数:71,代码来源:mmc.c
示例7: mdss_dsi_cmds_rx
//.........这里部分代码省略.........
mdss_dsi_enable_irq(ctrl, DSI_CMD_TERM);
ret = mdss_dsi_cmd_dma_tx(ctrl, tp);
if (IS_ERR_VALUE(ret)) {
mdss_dsi_disable_irq(ctrl, DSI_CMD_TERM);
pr_err("%s: failed to tx max_pkt_size\n",
__func__);
rp->len = 0;
goto end;
}
pr_debug("%s: max_pkt_size=%d sent\n",
__func__, pkt_size);
}
mdss_dsi_buf_init(tp);
ret = mdss_dsi_cmd_dma_add(tp, cmds);
if (!ret) {
pr_err("%s: failed to add cmd = 0x%x\n",
__func__, cmds->payload[0]);
rp->len = 0;
goto end;
}
mdss_dsi_wait4video_eng_busy(ctrl); /* video mode only */
mdss_dsi_enable_irq(ctrl, DSI_CMD_TERM);
/* transmit read comamnd to client */
ret = mdss_dsi_cmd_dma_tx(ctrl, tp);
if (IS_ERR_VALUE(ret)) {
mdss_dsi_disable_irq(ctrl, DSI_CMD_TERM);
pr_err("%s: failed to tx cmd = 0x%x\n",
__func__, cmds->payload[0]);
rp->len = 0;
goto end;
}
/*
* once cmd_dma_done interrupt received,
* return data from client is ready and stored
* at RDBK_DATA register already
* since rx fifo is 16 bytes, dcs header is kept at first loop,
* after that dcs header lost during shift into registers
*/
dlen = mdss_dsi_cmd_dma_rx(ctrl, rp, rx_byte);
if (short_response)
break;
if (rlen <= data_byte) {
diff = data_byte - rlen;
end = 1;
} else {
diff = 0;
rlen -= data_byte;
}
dlen -= 2; /* 2 padding bytes */
dlen -= 2; /* 2 crc */
dlen -= diff;
rp->data += dlen; /* next start position */
rp->len += dlen;
data_byte = 12; /* NOT first read */
pkt_size += data_byte;
pr_debug("%s: rp data=%x len=%d dlen=%d diff=%d\n",
__func__, (int)rp->data, rp->len, dlen, diff);
}
rp->data = rp->start; /* move back to start position */
cmd = rp->data[0];
switch (cmd) {
case DTYPE_ACK_ERR_RESP:
pr_debug("%s: rx ACK_ERR_PACLAGE\n", __func__);
rp->len = 0;
case DTYPE_GEN_READ1_RESP:
case DTYPE_DCS_READ1_RESP:
mdss_dsi_short_read1_resp(rp);
break;
case DTYPE_GEN_READ2_RESP:
case DTYPE_DCS_READ2_RESP:
mdss_dsi_short_read2_resp(rp);
break;
case DTYPE_GEN_LREAD_RESP:
case DTYPE_DCS_LREAD_RESP:
mdss_dsi_long_read_resp(rp);
break;
default:
pr_warning("%s:Invalid response cmd :len=%d dlen=%d diff=%d\n", __func__, rp->len, dlen, diff);
for (i = 0;i < (rp->len); i++)
pr_info(" rp[%d]=%x \n",i,rp->data[i]);
rp->len = 0;
}
end:
if (left_ctrl_restore)
MIPI_OUTP(left_ctrl_pdata->ctrl_base + 0x0004,
left_dsi_ctrl); /*restore */
if (video_mode)
MIPI_OUTP((ctrl->ctrl_base) + 0x0004,
dsi_ctrl); /* restore */
pr_debug("%s : -- \n",__func__);
return rp->len;
}
开发者ID:GalaxyTab4,项目名称:android_kernel_samsung_lt03lte,代码行数:101,代码来源:mdss_dsi_host.c
示例8: qnap_ts209_init
static void __init qnap_ts209_init(void)
{
/*
* Setup basic Orion functions. Need to be called early.
*/
orion5x_init();
/*
* Setup flash mapping
*/
orion5x_setup_dev_boot_win(QNAP_TS209_NOR_BOOT_BASE,
QNAP_TS209_NOR_BOOT_SIZE);
/*
* Open a special address decode windows for the PCIe WA.
*/
orion5x_setup_pcie_wa_win(ORION5X_PCIE_WA_PHYS_BASE,
ORION5X_PCIE_WA_SIZE);
/*
* Setup Multiplexing Pins --
* MPP[0] Reserved
* MPP[1] USB copy button (0 active)
* MPP[2] Load defaults button (0 active)
* MPP[3] GPIO RTC
* MPP[4-5] Reserved
* MPP[6] PCI Int A
* MPP[7] PCI Int B
* MPP[8-11] Reserved
* MPP[12] SATA 0 presence
* MPP[13] SATA 1 presence
* MPP[14] SATA 0 active
* MPP[15] SATA 1 active
* MPP[16] UART1 RXD
* MPP[17] UART1 TXD
* MPP[18] SW_RST (0 active)
* MPP[19] Reserved
* MPP[20] PCI clock 0
* MPP[21] PCI clock 1
* MPP[22] USB 0 over current
* MPP[23-25] Reserved
*/
orion5x_write(MPP_0_7_CTRL, 0x3);
orion5x_write(MPP_8_15_CTRL, 0x55550000);
orion5x_write(MPP_16_19_CTRL, 0x5500);
orion5x_gpio_set_valid_pins(0x3cc0fff);
/* register ts209 specific power-off method */
pm_power_off = qnap_ts209_power_off;
platform_add_devices(qnap_ts209_devices,
ARRAY_SIZE(qnap_ts209_devices));
/* Get RTC IRQ and register the chip */
if (gpio_request(TS209_RTC_GPIO, "rtc") == 0) {
if (gpio_direction_input(TS209_RTC_GPIO) == 0)
qnap_ts209_i2c_rtc.irq = gpio_to_irq(TS209_RTC_GPIO);
else
gpio_free(TS209_RTC_GPIO);
}
if (qnap_ts209_i2c_rtc.irq == 0)
pr_warning("qnap_ts209_init: failed to get RTC IRQ\n");
i2c_register_board_info(0, &qnap_ts209_i2c_rtc, 1);
ts209_find_mac_addr();
orion5x_eth_init(&qnap_ts209_eth_data);
orion5x_sata_init(&qnap_ts209_sata_data);
}
开发者ID:janrinze,项目名称:loox7xxport,代码行数:69,代码来源:ts209-setup.c
示例9: hsu_global_init
static void hsu_global_init(void)
{
struct hsu_port *hsu;
struct uart_hsu_port *uport;
struct hsu_dma_chan *dchan;
int i, ret;
hsu = kzalloc(sizeof(struct hsu_port), GFP_KERNEL);
if (!hsu)
return;
/* Get basic io resource and map it */
hsu->paddr = 0xffa28000;
hsu->iolen = 0x1000;
if (!(request_mem_region(hsu->paddr, hsu->iolen, "HSU global")))
pr_warning("HSU: error in request mem region\n");
hsu->reg = ioremap_nocache((unsigned long)hsu->paddr, hsu->iolen);
if (!hsu->reg) {
pr_err("HSU: error in ioremap\n");
ret = -ENOMEM;
goto err_free_region;
}
/* Initialise the 3 UART ports */
uport = hsu->port;
for (i = 0; i < 3; i++) {
uport->port.type = PORT_MFD;
uport->port.iotype = UPIO_MEM;
uport->port.mapbase = (resource_size_t)hsu->paddr
+ HSU_PORT_REG_OFFSET
+ i * HSU_PORT_REG_LENGTH;
uport->port.membase = hsu->reg + HSU_PORT_REG_OFFSET
+ i * HSU_PORT_REG_LENGTH;
sprintf(uport->name, "hsu_port%d", i);
uport->port.fifosize = 64;
uport->port.ops = &serial_hsu_pops;
uport->port.line = i;
uport->port.flags = UPF_IOREMAP;
/* set the scalable maxim support rate to 2746800 bps */
uport->port.uartclk = 115200 * 24 * 16;
uport->running = 0;
uport->txc = &hsu->chans[i * 2];
uport->rxc = &hsu->chans[i * 2 + 1];
serial_hsu_ports[i] = uport;
uport->index = i;
if (hsu_dma_enable & (1<<i))
uport->use_dma = 1;
else
uport->use_dma = 0;
uport++;
}
/* Initialise 6 dma channels */
dchan = hsu->chans;
for (i = 0; i < 6; i++) {
dchan->id = i;
dchan->dirt = (i & 0x1) ? DMA_FROM_DEVICE : DMA_TO_DEVICE;
dchan->uport = &hsu->port[i/2];
dchan->reg = hsu->reg + HSU_DMA_CHANS_REG_OFFSET +
i * HSU_DMA_CHANS_REG_LENGTH;
dchan++;
}
phsu = hsu;
hsu_debugfs_init(hsu);
return;
err_free_region:
release_mem_region(hsu->paddr, hsu->iolen);
kfree(hsu);
return;
}
开发者ID:Cool-Joe,项目名称:imx23-audio,代码行数:80,代码来源:mfd.c
示例10: kernel_physical_mapping_init
/*
* This maps the physical memory to kernel virtual address space, a total
* of max_low_pfn pages, by creating page tables starting from address
* PAGE_OFFSET.
*
* This routine transitions us from using a set of compiled-in large
* pages to using some more precise caching, including removing access
* to code pages mapped at PAGE_OFFSET (executed only at MEM_SV_START)
* marking read-only data as locally cacheable, striping the remaining
* .data and .bss across all the available tiles, and removing access
* to pages above the top of RAM (thus ensuring a page fault from a bad
* virtual address rather than a hypervisor shoot down for accessing
* memory outside the assigned limits).
*/
static void __init kernel_physical_mapping_init(pgd_t *pgd_base)
{
unsigned long address, pfn;
pmd_t *pmd;
pte_t *pte;
int pte_ofs;
const struct cpumask *my_cpu_mask = cpumask_of(smp_processor_id());
struct cpumask kstripe_mask;
int rc, i;
#if CHIP_HAS_CBOX_HOME_MAP()
if (ktext_arg_seen && ktext_hash) {
pr_warning("warning: \"ktext\" boot argument ignored"
" if \"kcache_hash\" sets up text hash-for-home\n");
ktext_small = 0;
}
if (kdata_arg_seen && kdata_hash) {
pr_warning("warning: \"kdata\" boot argument ignored"
" if \"kcache_hash\" sets up data hash-for-home\n");
}
if (kdata_huge && !hash_default) {
pr_warning("warning: disabling \"kdata=huge\"; requires"
" kcache_hash=all or =allbutstack\n");
kdata_huge = 0;
}
#endif
/*
* Set up a mask for cpus to use for kernel striping.
* This is normally all cpus, but minus dataplane cpus if any.
* If the dataplane covers the whole chip, we stripe over
* the whole chip too.
*/
cpumask_copy(&kstripe_mask, cpu_possible_mask);
if (!kdata_arg_seen)
kdata_mask = kstripe_mask;
/* Allocate and fill in L2 page tables */
for (i = 0; i < MAX_NUMNODES; ++i) {
#ifdef CONFIG_HIGHMEM
unsigned long end_pfn = node_lowmem_end_pfn[i];
#else
unsigned long end_pfn = node_end_pfn[i];
#endif
unsigned long end_huge_pfn = 0;
/* Pre-shatter the last huge page to allow per-cpu pages. */
if (kdata_huge)
end_huge_pfn = end_pfn - (HPAGE_SIZE >> PAGE_SHIFT);
pfn = node_start_pfn[i];
/* Allocate enough memory to hold L2 page tables for node. */
init_prealloc_ptes(i, end_pfn - pfn);
address = (unsigned long) pfn_to_kaddr(pfn);
while (pfn < end_pfn) {
BUG_ON(address & (HPAGE_SIZE-1));
pmd = get_pmd(pgtables, address);
pte = get_prealloc_pte(pfn);
if (pfn < end_huge_pfn) {
pgprot_t prot = init_pgprot(address);
*(pte_t *)pmd = pte_mkhuge(pfn_pte(pfn, prot));
for (pte_ofs = 0; pte_ofs < PTRS_PER_PTE;
pfn++, pte_ofs++, address += PAGE_SIZE)
pte[pte_ofs] = pfn_pte(pfn, prot);
} else {
if (kdata_huge)
printk(KERN_DEBUG "pre-shattered huge"
" page at %#lx\n", address);
for (pte_ofs = 0; pte_ofs < PTRS_PER_PTE;
pfn++, pte_ofs++, address += PAGE_SIZE) {
pgprot_t prot = init_pgprot(address);
pte[pte_ofs] = pfn_pte(pfn, prot);
}
assign_pte(pmd, pte);
}
}
}
/*
* Set or check ktext_map now that we have cpu_possible_mask
* and kstripe_mask to work with.
*/
//.........这里部分代码省略.........
开发者ID:CSCLOG,项目名称:beaglebone,代码行数:101,代码来源:init.c
示例11: check_variography
//.........这里部分代码省略.........
for (k = 0; lmc && k < v[0]->n_models; k++) {
if (v[0]->part[k].model != v[i]->part[k].model) {
reason = "model types differ";
lmc = 0;
}
if (v[0]->part[k].range[0] != v[i]->part[k].range[0]) {
reason = "ranges differ";
lmc = 0;
}
}
for (k = 0; lmc && k < v[0]->n_models; k++)
if (v[0]->part[k].tm_range != NULL) {
if (v[i]->part[k].tm_range == NULL) {
reason = "anisotropy for part of models";
lmc = 0;
} else if (
v[0]->part[k].tm_range->ratio[0] != v[i]->part[k].tm_range->ratio[0] ||
v[0]->part[k].tm_range->ratio[1] != v[i]->part[k].tm_range->ratio[1] ||
v[0]->part[k].tm_range->angle[0] != v[i]->part[k].tm_range->angle[0] ||
v[0]->part[k].tm_range->angle[1] != v[i]->part[k].tm_range->angle[1] ||
v[0]->part[k].tm_range->angle[2] != v[i]->part[k].tm_range->angle[2]
) {
reason = "anisotropy parameters are not equal";
lmc = 0;
}
} else if (v[i]->part[k].tm_range != NULL) {
reason = "anisotropy for part of models";
lmc = 0;
}
}
if (lmc) {
/*
* check for ic:
*/
a = (MAT **) emalloc(v[0]->n_models * sizeof(MAT *));
for (k = 0; k < v[0]->n_models; k++)
a[k] = m_get(n_vars, n_vars);
for (i = 0; i < n_vars; i++) {
for (j = 0; j < n_vars; j++) { /* for all variogram triplets: */
for (k = 0; k < v[0]->n_models; k++)
ME(a[k], i, j) = v[LTI(i,j)]->part[k].sill;
}
}
/* for ic: a's must be scaled versions of each other: */
ic = 1;
for (k = 1, ic = 1; ic && k < v[0]->n_models; k++) {
b = ME(a[0], 0, 0)/ME(a[k], 0, 0);
for (i = 0; ic && i < n_vars; i++)
for (j = 0; ic && j < n_vars; j++)
if (fabs(ME(a[0], i, j) / ME(a[k], i, j) - b) > EPSILON)
ic = 0;
}
/* check posdef matrices */
for (i = 0, lmc = 1, posdef = 1; i < v[0]->n_models; i++) {
posdef = is_posdef(a[i]);
if (posdef == 0) {
reason = "coefficient matrix not positive definite";
if (DEBUG_COV) {
printlog("non-positive definite coefficient matrix %d:\n",
i);
m_logoutput(a[i]);
}
ic = lmc = 0;
}
if (! posdef)
printlog(
"non-positive definite coefficient matrix in structure %d",
i+1);
}
for (k = 0; k < v[0]->n_models; k++)
m_free(a[k]);
efree(a);
if (ic) {
printlog("Intrinsic Correlation found. Good.\n");
return;
} else if (lmc) {
printlog("Linear Model of Coregionalization found. Good.\n");
return;
}
}
/*
* lmc does not hold: check on Cauchy Swartz
*/
pr_warning("No Intrinsic Correlation or Linear Model of Coregionalization found\nReason: %s", reason ? reason : "unknown");
if (gl_nocheck == 0) {
pr_warning("[add `set = list(nocheck = 1)' to the gstat() or krige() to ignore the following error]\n");
ErrMsg(ER_IMPOSVAL, "variograms do not satisfy a legal model");
}
printlog("Now checking for Cauchy-Schwartz inequalities:\n");
for (i = 0; i < n_vars; i++)
for (j = 0; j < i; j++)
if (is_valid_cs(v[LTI(i,i)], v[LTI(j,j)], v[LTI(i,j)])) {
printlog("variogram(%s,%s) passed Cauchy-Schwartz\n",
name_identifier(j), name_identifier(i));
} else
pr_warning("Cauchy-Schwartz inequality found for variogram(%s,%s)",
name_identifier(j), name_identifier(i) );
return;
}
开发者ID:cran,项目名称:gstat,代码行数:101,代码来源:vario.c
示例12: ts27010_tty_flush_buffer
static void ts27010_tty_flush_buffer(struct tty_struct *tty)
{
pr_warning("ts27010: flush_buffer not implemented on line %d\n",
tty->index);
}
开发者ID:STS-Dev-Team,项目名称:kernel_omap4_xt910s,代码行数:5,代码来源:ts27010_tty.c
示例13: ts27010_tty_unthrottle
static void ts27010_tty_unthrottle(struct tty_struct *tty)
{
pr_warning("ts27010: unthrottle not implemented on line %d\n",
tty->index);
}
开发者ID:STS-Dev-Team,项目名称:kernel_omap4_xt910s,代码行数:5,代码来源:ts27010_tty.c
示例14: nat64_filtering_and_updating
/*
* This procedure performs packet filtering and
* updates BIBs and STs.
*/
static bool nat64_filtering_and_updating(u_int8_t l3protocol, u_int8_t l4protocol,
struct sk_buff *skb, struct nf_conntrack_tuple * inner)
{
struct nat64_bib_entry *bib;
struct nat64_st_entry *session;
struct tcphdr *tcph = tcp_hdr(skb);
//struct icmphdr *icmph = icmp_hdr(skb);
bool res;
int i;
res = false;
if (l3protocol == NFPROTO_IPV4) {
pr_debug("NAT64: FNU - IPV4");
/*
* Query the STs for any records
* If there's no active session for the specified
* connection, the packet should be dropped
*/
switch (l4protocol) {
case IPPROTO_TCP:
//Query TCP ST
//pr_debug("NAT64: TCP protocol not currently supported.");
bib = nat64_bib_ipv4_lookup((*inner).dst.u3.in.s_addr,
inner->dst.u.tcp.port,
IPPROTO_TCP);
if (!bib) {
pr_warning("NAT64: IPv4 - BIB is missing.");
return res;
}
session = nat64_session_ipv4_lookup(bib,
inner->src.u3.in.s_addr,
inner->src.u.tcp.port);
if (!session) {
pr_warning("NAT64: IPv4 - session entry is "
"missing.");
return res;
}
pr_debug("NAT64: TCP protocol for IPv4 "
"finished properly.");
res = true;
break;
case IPPROTO_UDP:
//Query UDP BIB and ST
bib = nat64_bib_ipv4_lookup(inner->dst.u3.in.s_addr,
(inner->dst.u.udp.port),
IPPROTO_UDP);
if (!bib) {
pr_warning("NAT64: IPv4 - BIB is missing.");
return res;
}
session = nat64_session_ipv4_lookup(bib,
inner->src.u3.in.s_addr,
inner->src.u.udp.port);
if (!session) {
pr_warning("NAT64: IPv4 - session entry is "
"missing.");
return res;
}
pr_debug("NAT64: UDP protocol for IPv4 "
"finished properly.");
res = true;
break;
case IPPROTO_ICMP:
//Query ICMP ST
bib = nat64_bib_ipv4_lookup(inner->dst.u3.in.s_addr,
(inner->src.u.icmp.id),
IPPROTO_ICMPV6);
if (!bib) {
pr_debug("No se pudo con T':%pI4.", &inner->dst.u3.in.s_addr);
pr_debug("Inner: %hu", ntohs(inner->src.u.icmp.id));
pr_warning("NAT64: IPv4 - BIB is missing.");
return res;
}
session = nat64_session_ipv4_lookup(bib,
inner->src.u3.in.s_addr,
inner->src.u.icmp.id);
if (!session) {
pr_warning("NAT64: IPv4 - session entry is "
"missing.");
return res;
}
res = true;
break;
case IPPROTO_ICMPV6:
//Query ICMPV6 ST
pr_debug("NAT64: ICMPv6 protocol not "
"currently supported.");
//.........这里部分代码省略.........
开发者ID:ramironava,项目名称:NAT64,代码行数:101,代码来源:nf_nat64_tuple_handling.c
示例15: gs_start_tx
//.........这里部分代码省略.........
*/
static void gs_rx_push(struct work_struct *w)
{
struct gs_port *port = container_of(w, struct gs_port, push);
struct tty_struct *tty;
struct list_head *queue = &port->read_queue;
bool disconnect = false;
bool do_push = false;
/* hand any queued data to the tty */
spin_lock_irq(&port->port_lock);
tty = port->port_tty;
while (!list_empty(queue)) {
struct usb_request *req;
req = list_first_entry(queue, struct usb_request, list);
/* discard data if tty was closed */
if (!tty)
goto recycle;
/* leave data queued if tty was rx throttled */
if (test_bit(TTY_THROTTLED, &tty->flags))
break;
switch (req->status) {
case -ESHUTDOWN:
disconnect = true;
pr_vdebug(PREFIX "%d: shutdown\n", port->port_num);
break;
default:
/* presumably a transient fault */
pr_warning(PREFIX "%d: unexpected RX status %d\n",
port->port_num, req->status);
/* FALLTHROUGH */
case 0:
/* normal completion */
break;
}
/* push data to (open) tty */
if (req->actual) {
char *packet = req->buf;
unsigned size = req->actual;
unsigned n;
int count;
/* we may have pushed part of this packet already... */
n = port->n_read;
if (n) {
packet += n;
size -= n;
}
count = tty_insert_flip_string(tty, packet, size);
if (count)
do_push = true;
if (count != size) {
/* stop pushing; TTY layer can't handle more */
port->n_read += count;
pr_vdebug(PREFIX "%d: rx block %d/%d\n",
port->port_num,
count, req->actual);
break;
}
开发者ID:LDrifta,项目名称:Kernel_MS910_ZVD_Speed_Unlshd,代码行数:67,代码来源:u_serial.c
示例16: da830_evm_usb_init
static __init void da830_evm_usb_init(void)
{
u32 cfgchip2;
int ret;
/*
* Set up USB clock/mode in the CFGCHIP2 register.
* FYI: CFGCHIP2 is 0x0000ef00 initially.
*/
cfgchip2 = __raw_readl(DA8XX_SYSCFG0_VIRT(DA8XX_CFGCHIP2_REG));
/* USB2.0 PHY reference clock is 24 MHz */
cfgchip2 &= ~CFGCHIP2_REFFREQ;
cfgchip2 |= CFGCHIP2_REFFREQ_24MHZ;
/*
* Select internal reference clock for USB 2.0 PHY
* and use it as a clock source for USB 1.1 PHY
* (this is the default setting anyway).
*/
cfgchip2 &= ~CFGCHIP2_USB1PHYCLKMUX;
cfgchip2 |= CFGCHIP2_USB2PHYCLKMUX;
/*
* We have to override VBUS/ID signals when MUSB is configured into the
* host-only mode -- ID pin will float if no cable is connected, so the
* controller won't be able to drive VBUS thinking that it's a B-device.
* Otherwise, we want to use the OTG mode and enable VBUS comparators.
*/
cfgchip2 &= ~CFGCHIP2_OTGMODE;
#ifdef CONFIG_USB_MUSB_HOST
cfgchip2 |= CFGCHIP2_FORCE_HOST;
#else
cfgchip2 |= CFGCHIP2_SESENDEN | CFGCHIP2_VBDTCTEN;
#endif
__raw_writel(cfgchip2, DA8XX_SYSCFG0_VIRT(DA8XX_CFGCHIP2_REG));
/* USB_REFCLKIN is not used. */
ret = davinci_cfg_reg(DA830_USB0_DRVVBUS);
if (ret)
pr_warning("%s: USB 2.0 PinMux setup failed: %d\n",
__func__, ret);
else {
/*
* TPS2065 switch @ 5V supplies 1 A (sustains 1.5 A),
* with the power on to power good time of 3 ms.
*/
ret = da8xx_register_usb20(1000, 3);
if (ret)
pr_warning("%s: USB 2.0 registration failed: %d\n",
__func__, ret);
}
ret = davinci_cfg_reg_list(da830_evm_usb11_pins);
if (ret) {
pr_warning("%s: USB 1.1 PinMux setup failed: %d\n",
__func__, ret);
return;
}
ret = gpio_request(ON_BD_USB_DRV, "ON_BD_USB_DRV");
if (ret) {
printk(KERN_ERR "%s: failed to request GPIO for USB 1.1 port "
"power control: %d\n", __func__, ret);
return;
}
gpio_direction_output(ON_BD_USB_DRV, 0);
ret = gpio_request(ON_BD_USB_OVC, "ON_BD_USB_OVC");
if (ret) {
printk(KERN_ERR "%s: failed to request GPIO for USB 1.1 port "
"over-current indicator: %d\n", __func__, ret);
return;
}
gpio_direction_input(ON_BD_USB_OVC);
ret = da8xx_register_usb11(&da830_evm_usb11_pdata);
if (ret)
pr_warning("%s: USB 1.1 registration failed: %d\n",
__func__, ret);
}
开发者ID:1DeMaCr,项目名称:Codina_Kernel-3.x,代码行数:82,代码来源:board-da830-evm.c
示例17: elmc_send_packet
static netdev_tx_t elmc_send_packet(struct sk_buff *skb, struct net_device *dev)
{
int len;
int i;
#ifndef NO_NOPCOMMANDS
int next_nop;
#endif
struct priv *p = netdev_priv(dev);
netif_stop_queue(dev);
len = (ETH_ZLEN < skb->len) ? skb->len : ETH_ZLEN;
if (len != skb->len)
memset((char *) p->xmit_cbuffs[p->xmit_count], 0, ETH_ZLEN);
skb_copy_from_linear_data(skb, (char *) p->xmit_cbuffs[p->xmit_count], skb->len);
#if (NUM_XMIT_BUFFS == 1)
#ifdef NO_NOPCOMMANDS
p->xmit_buffs[0]->size = TBD_LAST | len;
for (i = 0; i < 16; i++) {
p->scb->cbl_offset = make16(p->xmit_cmds[0]);
p->scb->cmd = CUC_START;
p->xmit_cmds[0]->cmd_status = 0;
elmc_attn586();
dev->trans_start = jiffies;
if (!i) {
dev_kfree_skb(skb);
}
WAIT_4_SCB_CMD();
if ((p->scb->status & CU_ACTIVE)) { /* test it, because CU sometimes doesn't start immediately */
break;
}
if (p->xmit_cmds[0]->cmd_status) {
break;
}
if (i == 15) {
pr_warning("%s: Can't start transmit-command.\n", dev->name);
}
}
#else
next_nop = (p->nop_point + 1) & 0x1;
p->xmit_buffs[0]->size = TBD_LAST | len;
p->xmit_cmds[0]->cmd_link = p->nop_cmds[next_nop]->cmd_link
= make16((p->nop_cmds[next_nop]));
p->xmit_cmds[0]->cmd_status = p->nop_cmds[next_nop]->cmd_status = 0;
p->nop_cmds[p->nop_point]->cmd_link = make16((p->xmit_cmds[0]));
dev->trans_start = jiffies;
p->nop_point = next_nop;
dev_kfree_skb(skb);
#endif
#else
p->xmit_buffs[p->xmit_count]->size = TBD_LAST | len;
if ((next_nop = p->xmit_count + 1) == NUM_XMIT_BUFFS) {
next_nop = 0;
}
p->xmit_cmds[p->xmit_count]->cmd_status = 0;
p->xmit_cmds[p->xmit_count]->cmd_link = p->nop_cmds[next_nop]->cmd_link
= make16((p->nop_cmds[next_nop]));
p->nop_cmds[next_nop]->cmd_status = 0;
p->nop_cmds[p->xmit_count]->cmd_link = make16((p->xmit_cmds[p->xmit_count]));
dev->trans_start = jiffies;
p->xmit_count = next_nop;
if (p->xmit_count != p->xmit_last)
netif_wake_queue(dev);
dev_kfree_skb(skb);
#endif
return NETDEV_TX_OK;
}
开发者ID:KaZoom,项目名称:buildroot-linux-kernel-m3,代码行数:71,代码来源:3c523.c
示例18: init586
static int init586(struct net_device *dev)
{
void *ptr;
unsigned long s;
int i, result = 0;
struct priv *p = netdev_priv(dev);
volatile struct configure_cmd_struct *cfg_cmd;
volatile struct iasetup_cmd_struct *ias_cmd;
volatile struct tdr_cmd_struct *tdr_cmd;
volatile struct mcsetup_cmd_struct *mc_cmd;
struct dev_mc_list *dmi;
int num_addrs = netdev_mc_count(dev);
ptr = (void *) ((char *) p->scb + sizeof(struct scb_struct));
cfg_cmd = (struct configure_cmd_struct *) ptr; /* configure-command */
cfg_cmd->cmd_status = 0;
cfg_cmd->cmd_cmd = CMD_CONFIGURE | CMD_LAST;
cfg_cmd->cmd_link = 0xffff;
cfg_cmd->byte_cnt = 0x0a; /* number of cfg bytes */
cfg_cmd->fifo = 0x08; /* fifo-limit (8=tx:32/rx:64) */
cfg_cmd->sav_bf = 0x40; /* hold or discard bad recv frames (bit 7) */
cfg_cmd->adr_len = 0x2e; /* addr_len |!src_insert |pre-len |loopback */
cfg_cmd->priority = 0x00;
cfg_cmd->ifs = 0x60;
cfg_cmd->time_low = 0x00;
cfg_cmd->time_high = 0xf2;
cfg_cmd->promisc = 0;
if (dev->flags & (IFF_ALLMULTI | IFF_PROMISC))
cfg_cmd->promisc = 1;
cfg_cmd->carr_coll = 0x00;
p->scb->cbl_offset = make16(cfg_cmd);
p->scb->cmd = CUC_START; /* cmd.-unit start */
elmc_id_attn586();
s = jiffies; /* warning: only active with interrupts on !! */
while (!(cfg_cmd->cmd_status & STAT_COMPL)) {
if (time_after(jiffies, s + 30*HZ/100))
break;
}
if ((cfg_cmd->cmd_status & (STAT_OK | STAT_COMPL)) != (STAT_COMPL | STAT_OK)) {
pr_warning("%s (elmc): configure command failed: %x\n", dev->name, cfg_cmd->cmd_status);
return 1;
}
/*
* individual address setup
*/
ias_cmd = (struct iasetup_cmd_struct *) ptr;
ias_cmd->cmd_status = 0;
ias_cmd->cmd_cmd = CMD_IASETUP | CMD_LAST;
ias_cmd->cmd_link = 0xffff;
memcpy((char *) &ias_cmd->iaddr, (char *) dev->dev_addr, ETH_ALEN);
p->scb->cbl_offset = make16(ias_cmd);
p->scb->cmd = CUC_START; /* cmd.-unit start */
elmc_id_attn586();
s = jiffies;
while (!(ias_cmd->cmd_status & STAT_COMPL)) {
if (time_after(jiffies, s + 30*HZ/100))
break;
}
if ((ias_cmd->cmd_status & (STAT_OK | STAT_COMPL)) != (STAT_OK | STAT_COMPL)) {
pr_warning("%s (elmc): individual address setup command failed: %04x\n",
dev->name, ias_cmd->cmd_status);
return 1;
}
/*
* TDR, wire check .. e.g. no resistor e.t.c
*/
tdr_cmd = (struct tdr_cmd_struct *) ptr;
tdr_cmd->cmd_status = 0;
tdr_cmd->cmd_cmd = CMD_TDR | CMD_LAST;
tdr_cmd->cmd_link = 0xffff;
tdr_cmd->status = 0;
p->scb->cbl_offset = make16(tdr_cmd);
p->scb->cmd = CUC_START; /* cmd.-unit start */
elmc_attn586();
s = jiffies;
while (!(tdr_cmd->cmd_status & STAT_COMPL)) {
if (time_after(jiffies, s + 30*HZ/100)) {
pr_warning("%s: %d Problems while running the TDR.\n", dev->name, __LINE__);
result = 1;
break;
}
}
if (!result) {
//.........这里部分代码省略.........
开发者ID:KaZoom,项目名称:buildroot-linux-kernel-m3,代码行数:101,代码来源:3c523.c
示例19: mmc_init_card
//.........这里部分代码省略.........
mmc_set_erase_size(card);
}
}
/*
* Activate high speed (if supported)
*/
if ((card->ext_csd.hs_max_dtr != 0) &&
(host->caps & MMC_CAP_MMC_HIGHSPEED)) {
err = mmc_switch(card, EXT_CSD_CMD_SET_NORMAL,
EXT_CSD_HS_TIMING, 1);
if (err && err != -EBADMSG)
goto free_card;
if (err) {
printk(KERN_WARNING "%s: switch to highspeed failed\n",
mmc_hostname(card->host));
err = 0;
} else {
mmc_card_set_highspeed(card);
mmc_set_timing(card->host, MMC_TIMING_MMC_HS);
}
}
/*
* Enable HPI feature (if supported)
*/
if (card->ext_csd.hpi && (card->host->caps & MMC_CAP_BKOPS)) {
err = mmc_switch(card, EXT_CSD_CMD_S
|
请发表评论