Projectname large_stringclasses 15
values | Filepath large_stringlengths 4 106 ⌀ | Function large_stringlengths 11 3.45k | Label list |
|---|---|---|---|
Linux Kernel | drivers/ata/sata_sil.c | static void sil_bmdma_stop(struct ata_queued_cmd *qc) {
struct ata_port *ap = qc->ap;
void __iomem *mmio_base = ap->host->iomap[SIL_MMIO_BAR];
void __iomem *bmdma2 = mmio_base + sil_port[ap->port_no].bmdma2;
iowrite8(0, bmdma2);
/* one-PIO-cycle guaranteed wait, per spec, for HDMA1:0 transition */
ata_sff... | [
1,
0
] |
Linux Kernel | drivers/ata/sata_sil.c | static void sil_fill_sg(struct ata_queued_cmd *qc) {
struct scatterlist *sg;
struct ata_port *ap = qc->ap;
struct ata_bmdma_prd *prd, *last_prd = NULL;
unsigned int si;
prd = &ap->bmdma_prd[0];
for_each_sg(qc->sg, sg, qc->n_elem, si) {
u32 addr = (u32)sg_dma_address(sg);
u32 sg_len = sg_dma_len(sg... | [
0,
0
] |
Linux Kernel | drivers/ata/sata_sil.c |
static enum ata_completion_errors sil_qc_prep(struct ata_queued_cmd *qc) {
if (!(qc->flags & ATA_QCFLAG_DMAMAP))
return AC_ERR_OK;
sil_fill_sg(qc);
return AC_ERR_OK;
} | [
0,
0
] |
Linux Kernel | drivers/ata/sata_sil.c | static void sil_dev_config(struct ata_device *dev) {
struct ata_port *ap = dev->link->ap;
int print_info = ap->link.eh_context.i.flags & ATA_EHI_PRINTINFO;
unsigned int n, quirks = 0;
unsigned char model_num[ATA_ID_PROD_LEN + 1];
dev->horkage |= ATA_HORKAGE_NOTRIM;
ata_id_c_string(dev->id, model_num, ATA_... | [
1,
0
] |
Linux Kernel | drivers/ata/sata_sil.c | static void sil_init_controller(struct ata_host *host) {
struct pci_dev *pdev = to_pci_dev(host->dev);
void __iomem *mmio_base = host->iomap[SIL_MMIO_BAR];
u8 cls;
u32 tmp;
int i;
cls = sil_get_device_cache_line(pdev);
if (cls) {
cls >>= 3;
cls++; /* cls = (line_size/8)+1 */
for (i = 0; i < h... | [
1,
0
] |
Linux Kernel | drivers/ata/sata_sil24.c |
static unsigned long sil24_port_offset(struct ata_port *ap) {
return ap->port_no * PORT_REGS_SIZE;
} | [
0,
0
] |
Linux Kernel | drivers/ata/sata_sil24.c | static int sil24_softreset(struct ata_link *link, unsigned int *class,
unsigned long deadline) {
struct ata_port *ap = link->ap;
int pmp = sata_srst_pmp(link);
unsigned long timeout_msec = 0;
struct ata_taskfile tf;
const char *reason;
int rc;
if (sil24_init_port(ap)) {
rea... | [
1,
0
] |
Linux Kernel | drivers/ata/sata_sil24.c |
static inline void sil24_fill_sg(struct ata_queued_cmd *qc,
struct sil24_sge *sge) {
struct scatterlist *sg;
struct sil24_sge *last_sge = NULL;
unsigned int si;
for_each_sg(qc->sg, sg, qc->n_elem, si) {
sge->addr = cpu_to_le64(sg_dma_address(sg));
sge->cnt = cpu_to_le3... | [
0,
0
] |
Linux Kernel | drivers/ata/sata_sil24.c | static unsigned int sil24_qc_issue(struct ata_queued_cmd *qc) {
struct ata_port *ap = qc->ap;
struct sil24_port_priv *pp = ap->private_data;
void __iomem *port = sil24_port_base(ap);
unsigned int tag = sil24_tag(qc->hw_tag);
dma_addr_t paddr;
void __iomem *activate;
paddr = pp->cmd_block_dma + tag * size... | [
1,
0
] |
Linux Kernel | drivers/ata/sata_sil24.c | static void sil24_freeze(struct ata_port *ap) {
void __iomem *port = sil24_port_base(ap);
writel(0xffff, port + PORT_IRQ_ENABLE_CLR);
} | [
0,
0
] |
Linux Kernel | drivers/ata/sata_sil24.c | static void sil24_thaw(struct ata_port *ap) {
void __iomem *port = sil24_port_base(ap);
u32 tmp;
tmp = readl(port + PORT_IRQ_STAT);
writel(tmp, port + PORT_IRQ_STAT);
/* turn IRQ back on */
writel(DEF_PORT_IRQ, port + PORT_IRQ_ENABLE_SET);
} | [
0,
0
] |
Linux Kernel | drivers/ata/sata_sil24.c | static inline void sil24_host_intr(struct ata_port *ap) {
void __iomem *port = sil24_port_base(ap);
u32 slot_stat, qc_active;
int rc;
if (ap->flags & SIL24_FLAG_PCIX_IRQ_WOC)
writel(PORT_IRQ_COMPLETE, port + PORT_IRQ_STAT);
slot_stat = readl(port + PORT_SLOT_STAT);
if (unlikely(slot_stat & HOST_SSTAT... | [
0,
0
] |
Linux Kernel | drivers/ata/sata_sil24.c |
static irqreturn_t sil24_interrupt(int irq, void *dev_instance) {
struct ata_host *host = dev_instance;
void __iomem *host_base = host->iomap[SIL24_HOST_BAR];
unsigned handled = 0;
u32 status;
int i;
status = readl(host_base + HOST_IRQ_STAT);
if (status == 0xffffffff) {
dev_err(host->dev, "IRQ stat... | [
1,
0
] |
Linux Kernel | drivers/ata/sata_sil24.c | static void sil24_post_internal_cmd(struct ata_queued_cmd *qc) {
struct ata_port *ap = qc->ap;
if ((qc->flags & ATA_QCFLAG_FAILED) && sil24_init_port(ap))
ata_eh_freeze_port(ap);
} | [
0,
0
] |
Linux Kernel | drivers/ata/sata_sil24.c | static void sil24_init_controller(struct ata_host *host) {
void __iomem *host_base = host->iomap[SIL24_HOST_BAR];
u32 tmp;
int i;
writel(0, host_base + HOST_FLASH_CMD);
/* clear global reset & mask interrupts during initialization */
writel(0, host_base + HOST_CTRL);
/* init ports */
for (i = 0; i < ... | [
0,
0
] |
Linux Kernel | drivers/ata/sata_sis.c |
static unsigned int get_scr_cfg_addr(struct ata_link *link,
unsigned int sc_reg) {
struct ata_port *ap = link->ap;
struct pci_dev *pdev = to_pci_dev(ap->host->dev);
unsigned int addr = SIS_SCR_BASE + (4 * sc_reg);
u8 pmr;
if (ap->port_no) {
switch (pdev->device) {
... | [
1,
0
] |
Linux Kernel | drivers/ata/sata_sis.c | static u32 sis_scr_cfg_read(struct ata_link *link, unsigned int sc_reg,
u32 *val) {
struct pci_dev *pdev = to_pci_dev(link->ap->host->dev);
unsigned int cfg_addr = get_scr_cfg_addr(link, sc_reg);
if (sc_reg == SCR_ERROR)
return -EINVAL;
pci_read_config_dword(pdev, cfg_addr, val... | [
1,
0
] |
Linux Kernel | drivers/ata/sata_sis.c |
static int sis_scr_cfg_write(struct ata_link *link, unsigned int sc_reg,
u32 val) {
struct pci_dev *pdev = to_pci_dev(link->ap->host->dev);
unsigned int cfg_addr = get_scr_cfg_addr(link, sc_reg);
pci_write_config_dword(pdev, cfg_addr, val);
return 0;
} | [
1,
0
] |
Linux Kernel | drivers/ata/sata_sis.c |
static int sis_scr_write(struct ata_link *link, unsigned int sc_reg, u32 val) {
struct ata_port *ap = link->ap;
void __iomem *base = ap->ioaddr.scr_addr + link->pmp * 0x10;
if (sc_reg > SCR_CONTROL)
return -EINVAL;
if (ap->flags & SIS_FLAG_CFGSCR)
return sis_scr_cfg_write(link, sc_reg, val);
iowri... | [
1,
0
] |
Linux Kernel | drivers/ata/sata_svw.c |
static int k2_sata_scr_write(struct ata_link *link, unsigned int sc_reg,
u32 val) {
if (sc_reg > SCR_CONTROL)
return -EINVAL;
writel(val, link->ap->ioaddr.scr_addr + (sc_reg * 4));
return 0;
} | [
1,
0
] |
Linux Kernel | drivers/ata/sata_svw.c | static int k2_sata_softreset(struct ata_link *link, unsigned int *class,
unsigned long deadline) {
u8 dmactl;
void __iomem *mmio = link->ap->ioaddr.bmdma_addr;
dmactl = readb(mmio + ATA_DMA_CMD);
if (dmactl & ATA_DMA_START) {
dmactl &= ~ATA_DMA_START;
writeb(dmactl, mmio +... | [
1,
0
] |
Linux Kernel | drivers/ata/sata_sx4.c | static inline void pdc20621_ata_sg(u8 *buf, unsigned int portno,
unsigned int total_len) {
u32 addr;
unsigned int dw = PDC_DIMM_APKT_PRD >> 2;
__le32 *buf32 = (__le32 *)buf;
addr =
PDC_20621_DIMM_BASE + PDC_20621_DIMM_DATA + (PDC_DIMM_DATA_STEP * portno);
buf32[dw] =... | [
1,
0
] |
Linux Kernel | drivers/ata/sata_sx4.c | static inline unsigned int pdc20621_ata_pkt(struct ata_taskfile *tf,
unsigned int devno, u8 *buf,
unsigned int portno) {
unsigned int i, dw;
__le32 *buf32 = (__le32 *)buf;
u8 dev_reg;
unsigned int dimm_sg =
PDC_20621_... | [
1,
0
] |
Linux Kernel | drivers/ata/sata_sx4.c |
static enum ata_completion_errors pdc20621_qc_prep(struct ata_queued_cmd *qc) {
switch (qc->tf.protocol) {
case ATA_PROT_DMA:
pdc20621_dma_prep(qc);
break;
case ATA_PROT_NODATA:
pdc20621_nodata_prep(qc);
break;
default:
break;
}
return AC_ERR_OK;
} | [
0,
0
] |
Linux Kernel | drivers/ata/sata_sx4.c | static void __pdc20621_push_hdma(struct ata_queued_cmd *qc, unsigned int seq,
u32 pkt_ofs) {
struct ata_port *ap = qc->ap;
struct ata_host *host = ap->host;
void __iomem *mmio = host->iomap[PDC_MMIO_BAR];
mmio += PDC_CHIP0_OFS;
writel(0x00000001, mmio + PDC_20621_SEQCTL + (s... | [
0,
0
] |
Linux Kernel | drivers/ata/sata_sx4.c | static void pdc_reset_port(struct ata_port *ap) {
void __iomem *mmio = ap->ioaddr.cmd_addr + PDC_CTLSTAT;
unsigned int i;
u32 tmp;
/* FIXME: handle HDMA copy engine */
for (i = 11; i > 0; i--) {
tmp = readl(mmio);
if (tmp & PDC_RESET)
break;
udelay(100);
tmp |= PDC_RESET;
writel(... | [
0,
1
] |
Linux Kernel | drivers/ata/sata_sx4.c |
static void pdc_sata_setup_port(struct ata_ioports *port, void __iomem *base) {
port->cmd_addr = base;
port->data_addr = base;
port->feature_addr = port->error_addr = base + 0x4;
port->nsect_addr = base + 0x8;
port->lbal_addr = base + 0xc;
port->lbam_addr = base + 0x10;
port->lbah_addr = base + 0x14;
... | [
1,
0
] |
Linux Kernel | drivers/ata/sata_sx4.c | static void pdc20621_put_to_dimm(struct ata_host *host, void *psource,
u32 offset, u32 size) {
u32 window_size;
u16 idx;
u8 page_mask;
long dist;
void __iomem *mmio = host->iomap[PDC_MMIO_BAR];
void __iomem *dimm_mmio = host->iomap[PDC_DIMM_BAR];
mmio += PDC_CHIP0_OFS;
... | [
1,
0
] |
Linux Kernel | drivers/ata/sata_sx4.c | static void pdc_20621_init(struct ata_host *host) {
u32 tmp;
void __iomem *mmio = host->iomap[PDC_MMIO_BAR];
mmio += PDC_CHIP0_OFS;
/*
* Select page 0x40 for our 32k DIMM window
*/
tmp = readl(mmio + PDC_20621_DIMM_WINDOW) & 0xffff0000;
tmp |= PDC_PAGE_WINDOW; /* page 40h; arbitrarily selected */
... | [
1,
0
] |
Linux Kernel | drivers/ata/sata_uli.c | static int uli_scr_write(struct ata_link *link, unsigned int sc_reg, u32 val) {
if (sc_reg > SCR_CONTROL)
return -EINVAL;
uli_scr_cfg_write(link, sc_reg, val);
return 0;
} | [
0,
0
] |
Linux Kernel | drivers/ata/sata_via.c |
static int svia_scr_read(struct ata_link *link, unsigned int sc_reg, u32 *val) {
if (sc_reg > SCR_CONTROL)
return -EINVAL;
*val = ioread32(link->ap->ioaddr.scr_addr + (4 * sc_reg));
return 0;
} | [
1,
0
] |
Linux Kernel | drivers/ata/sata_via.c | static int vt8251_scr_read(struct ata_link *link, unsigned int scr, u32 *val) {
static const u8 ipm_tbl[] = {1, 2, 6, 0};
struct pci_dev *pdev = to_pci_dev(link->ap->host->dev);
int slot = 2 * link->ap->port_no + link->pmp;
u32 v = 0;
u8 raw;
switch (scr) {
case SCR_STATUS:
pci_read_config_byte(pdev,... | [
1,
0
] |
Linux Kernel | drivers/ata/sata_via.c |
static void vt6421_set_dma_mode(struct ata_port *ap, struct ata_device *adev) {
struct pci_dev *pdev = to_pci_dev(ap->host->dev);
static const u8 udma_bits[] = {0xEE, 0xE8, 0xE6, 0xE4,
0xE2, 0xE1, 0xE0, 0xE0};
pci_write_config_byte(pdev, PATA_UDMA_TIMING - adev->devno,
... | [
0,
0
] |
Linux Kernel | drivers/ata/sata_via.c |
static void __iomem *vt6421_scr_addr(void __iomem *addr, unsigned int port) {
return addr + (port * 64);
} | [
0,
0
] |
Linux Kernel | drivers/ata/sata_via.c |
static int vt6420_prepare_host(struct pci_dev *pdev, struct ata_host **r_host) {
const struct ata_port_info *ppi[] = {&vt6420_port_info, NULL};
struct ata_host *host;
int rc;
if (vt6420_hotplug) {
ppi[0]->port_ops->scr_read = svia_scr_read;
ppi[0]->port_ops->scr_write = svia_scr_write;
}
rc = ata... | [
0,
0
] |
Linux Kernel | drivers/ata/sata_via.c |
static int vt6421_prepare_host(struct pci_dev *pdev, struct ata_host **r_host) {
const struct ata_port_info *ppi[] = {&vt6421_sport_info, &vt6421_sport_info,
&vt6421_pport_info};
struct ata_host *host;
int i, rc;
*r_host = host = ata_host_alloc_pinfo(&pdev->dev, ppi, ARR... | [
0,
0
] |
Linux Kernel | drivers/ata/sata_via.c | static int vt8251_prepare_host(struct pci_dev *pdev, struct ata_host **r_host) {
const struct ata_port_info *ppi[] = {&vt8251_port_info, NULL};
struct ata_host *host;
int i, rc;
rc = ata_pci_bmdma_prepare_host(pdev, ppi, &host);
if (rc)
return rc;
*r_host = host;
rc = pcim_iomap_regions(pdev, 1 << 5... | [
0,
0
] |
Linux Kernel | drivers/ata/sata_via.c | static int svia_pci_device_resume(struct pci_dev *pdev) {
struct ata_host *host = pci_get_drvdata(pdev);
struct svia_priv *hpriv = host->private_data;
int rc;
rc = ata_pci_device_do_resume(pdev);
if (rc)
return rc;
if (hpriv->wd_workaround)
svia_wd_fix(pdev);
ata_host_resume(host);
return 0;
... | [
0,
0
] |
Linux Kernel | drivers/ata/sata_vsc.c |
static int vsc_sata_scr_read(struct ata_link *link, unsigned int sc_reg,
u32 *val) {
if (sc_reg > SCR_CONTROL)
return -EINVAL;
*val = readl(link->ap->ioaddr.scr_addr + (sc_reg * 4));
return 0;
} | [
1,
0
] |
Linux Kernel | drivers/ata/sata_vsc.c |
static void vsc_freeze(struct ata_port *ap) {
void __iomem *mask_addr;
mask_addr =
ap->host->iomap[VSC_MMIO_BAR] + VSC_SATA_INT_MASK_OFFSET + ap->port_no;
writeb(0, mask_addr);
} | [
1,
0
] |
Linux Kernel | drivers/ata/sata_vsc.c |
static void vsc_intr_mask_update(struct ata_port *ap, u8 ctl) {
void __iomem *mask_addr;
u8 mask;
mask_addr =
ap->host->iomap[VSC_MMIO_BAR] + VSC_SATA_INT_MASK_OFFSET + ap->port_no;
mask = readb(mask_addr);
if (ctl & ATA_NIEN)
mask |= 0x80;
else
mask &= 0x7F;
writeb(mask, mask_addr);
} | [
1,
0
] |
Linux Kernel | drivers/ata/sata_vsc.c | static void vsc_sata_tf_load(struct ata_port *ap,
const struct ata_taskfile *tf) {
struct ata_ioports *ioaddr = &ap->ioaddr;
unsigned int is_addr = tf->flags & ATA_TFLAG_ISADDR;
if ((tf->ctl & ATA_NIEN) != (ap->last_ctl & ATA_NIEN)) {
ap->last_ctl = tf->ctl;
vsc_intr_mask_upd... | [
1,
0
] |
Linux Kernel | drivers/ata/sata_vsc.c |
static void vsc_sata_tf_read(struct ata_port *ap, struct ata_taskfile *tf) {
struct ata_ioports *ioaddr = &ap->ioaddr;
u16 nsect, lbal, lbam, lbah, error;
tf->status = ata_sff_check_status(ap);
tf->device = readw(ioaddr->device_addr);
error = readw(ioaddr->error_addr);
nsect = readw(ioaddr->nsect_addr);
... | [
0,
0
] |
Linux Kernel | drivers/ata/sata_vsc.c | static void vsc_port_intr(u8 port_status, struct ata_port *ap) {
struct ata_queued_cmd *qc;
int handled = 0;
if (unlikely(port_status & VSC_SATA_INT_ERROR)) {
vsc_error_intr(port_status, ap);
return;
}
qc = ata_qc_from_tag(ap, ap->link.active_tag);
if (qc && likely(!(qc->tf.flags & ATA_TFLAG_POLLI... | [
0,
0
] |
Linux Kernel | drivers/ata/sata_vsc.c | static irqreturn_t vsc_sata_interrupt(int irq, void *dev_instance) {
struct ata_host *host = dev_instance;
unsigned int i;
unsigned int handled = 0;
u32 status;
status = readl(host->iomap[VSC_MMIO_BAR] + VSC_SATA_INT_STAT_OFFSET);
if (unlikely(status == 0xffffffff || status == 0)) {
if (status)
... | [
1,
0
] |
Linux Kernel | drivers/atm/adummy.c |
static int adummy_open(struct atm_vcc *vcc) {
short vpi = vcc->vpi;
int vci = vcc->vci;
if (vci == ATM_VCI_UNSPEC || vpi == ATM_VPI_UNSPEC)
return 0;
set_bit(ATM_VF_ADDR, &vcc->flags);
set_bit(ATM_VF_READY, &vcc->flags);
return 0;
} | [
0,
0
] |
Linux Kernel | drivers/atm/adummy.c |
static int __init adummy_init(void) {
struct atm_dev *atm_dev;
struct adummy_dev *adummy_dev;
int err = 0;
printk(KERN_ERR "adummy: version %s\n", DRV_VERSION);
adummy_dev = kzalloc(sizeof(struct adummy_dev), GFP_KERNEL);
if (!adummy_dev) {
printk(KERN_ERR DEV_LABEL ": kzalloc() failed\n");
err =... | [
0,
0
] |
Linux Kernel | drivers/atm/atmtcp.c | static int atmtcp_send_control(struct atm_vcc *vcc, int type,
const struct atmtcp_control *msg, int flag) {
DECLARE_WAITQUEUE(wait, current);
struct atm_vcc *out_vcc;
struct sk_buff *skb;
struct atmtcp_control *new_msg;
int old_test;
int error = 0;
out_vcc = PRIV(vcc->dev) ... | [
1,
0
] |
Linux Kernel | drivers/atm/atmtcp.c |
static int atmtcp_v_ioctl(struct atm_dev *dev, unsigned int cmd,
void __user *arg) {
struct atm_cirange ci;
struct atm_vcc *vcc;
struct sock *s;
int i;
if (cmd != ATM_SETCIRANGE)
return -ENOIOCTLCMD;
if (copy_from_user(&ci, arg, sizeof(ci)))
return -EFAULT;
if (ci.vpi_... | [
1,
0
] |
Linux Kernel | drivers/atm/atmtcp.c | static int atmtcp_v_send(struct atm_vcc *vcc, struct sk_buff *skb) {
struct atmtcp_dev_data *dev_data;
struct atm_vcc *out_vcc = NULL;
struct sk_buff *new_skb;
struct atmtcp_hdr *hdr;
int size;
if (vcc->qos.txtp.traffic_class == ATM_NONE) {
if (vcc->pop)
vcc->pop(vcc, skb);
else
dev_kfr... | [
1,
0
] |
Linux Kernel | drivers/atm/atmtcp.c |
static int atmtcp_c_send(struct atm_vcc *vcc, struct sk_buff *skb) {
struct atm_dev *dev;
struct atmtcp_hdr *hdr;
struct atm_vcc *out_vcc;
struct sk_buff *new_skb;
int result = 0;
if (!skb->len)
return 0;
dev = vcc->dev_data;
hdr = (struct atmtcp_hdr *)skb->data;
if (hdr->length == ATMTCP_HDR_M... | [
0,
0
] |
Linux Kernel | drivers/atm/atmtcp.c |
static int atmtcp_create_persistent(int itf) {
return atmtcp_create(itf, 1, NULL);
} | [
0,
0
] |
Linux Kernel | drivers/atm/atmtcp.c |
static __init int atmtcp_init(void) {
register_atm_ioctl(&atmtcp_ioctl_ops);
return 0;
} | [
0,
0
] |
Linux Kernel | drivers/atm/eni.c | static void eni_put_free(struct eni_dev *eni_dev, void __iomem *start,
unsigned long size) {
struct eni_free *list;
int len, order;
DPRINTK("init 0x%lx+%ld(0x%lx)\n", start, size, size);
start += eni_dev->base_diff;
list = eni_dev->free_list;
len = eni_dev->free_len;
while (size)... | [
1,
0
] |
Linux Kernel | drivers/atm/eni.c | static int rx_aal0(struct atm_vcc *vcc) {
struct eni_vcc *eni_vcc;
unsigned long descr;
unsigned long length;
struct sk_buff *skb;
DPRINTK(">rx_aal0\n");
eni_vcc = ENI_VCC(vcc);
descr = readl(eni_vcc->recv + eni_vcc->descr * 4);
if ((descr & MID_RED_IDEN) != (MID_RED_RX_ID << MID_RED_SHIFT)) {
rx_i... | [
1,
1
] |
Linux Kernel | drivers/atm/eni.c | static void get_service(struct atm_dev *dev) {
struct eni_dev *eni_dev;
struct atm_vcc *vcc;
unsigned long vci;
DPRINTK(">get_service\n");
eni_dev = ENI_DEV(dev);
while (eni_in(MID_SERV_WRITE) != eni_dev->serv_read) {
vci = readl(eni_dev->service + eni_dev->serv_read * 4);
eni_dev->serv_read = (eni... | [
0,
0
] |
Linux Kernel | drivers/atm/eni.c |
static int open_rx_first(struct atm_vcc *vcc) {
struct eni_dev *eni_dev;
struct eni_vcc *eni_vcc;
unsigned long size;
DPRINTK("open_rx_first\n");
eni_dev = ENI_DEV(vcc->dev);
eni_vcc = ENI_VCC(vcc);
eni_vcc->rx = NULL;
if (vcc->qos.rxtp.traffic_class == ATM_NONE)
return 0;
size = vcc->qos.rxtp.... | [
1,
0
] |
Linux Kernel | drivers/atm/eni.c |
static int start_rx(struct atm_dev *dev) {
struct eni_dev *eni_dev;
eni_dev = ENI_DEV(dev);
eni_dev->rx_map = (struct atm_vcc **)get_zeroed_page(GFP_KERNEL);
if (!eni_dev->rx_map) {
printk(KERN_ERR DEV_LABEL "(itf %d): couldn't get free page\n",
dev->number);
free_page((unsigned long)eni_d... | [
0,
0
] |
Linux Kernel | drivers/atm/eni.c |
static struct eni_tx *alloc_tx(struct eni_dev *eni_dev, int ubr) {
int i;
for (i = !ubr; i < NR_CHAN; i++)
if (!eni_dev->tx[i].send)
return eni_dev->tx + i;
return NULL;
} | [
1,
0
] |
Linux Kernel | drivers/atm/eni.c | static int comp_tx(struct eni_dev *eni_dev, int *pcr, int reserved, int *pre,
int *res, int unlimited) {
static const int pre_div[] = {4, 16, 128, 2048};
if (unlimited)
*pre = *res = 0;
else {
if (*pcr > 0) {
int div;
for (*pre = 0; *pre < 3; (*pre)++)
if (TS_CLOCK... | [
1,
0
] |
Linux Kernel | drivers/atm/eni.c |
static int open_tx_first(struct atm_vcc *vcc) {
ENI_VCC(vcc)->tx = NULL;
if (vcc->qos.txtp.traffic_class == ATM_NONE)
return 0;
ENI_VCC(vcc)->txing = 0;
return reserve_or_set_tx(vcc, &vcc->qos.txtp, 1, 1);
} | [
0,
0
] |
Linux Kernel | drivers/atm/eni.c |
static int get_esi_fpga(struct atm_dev *dev, void __iomem *base) {
void __iomem *mac_base;
int i;
mac_base = base + EPROM_SIZE - sizeof(struct midway_eprom);
for (i = 0; i < ESI_LEN; i++)
dev->esi[i] = readb(mac_base + (i ^ 3));
return 0;
} | [
1,
0
] |
Linux Kernel | drivers/atm/eni.c | static int eni_change_qos(struct atm_vcc *vcc, struct atm_qos *qos, int flgs) {
struct eni_dev *eni_dev = ENI_DEV(vcc->dev);
struct eni_tx *tx = ENI_VCC(vcc)->tx;
struct sk_buff *skb;
int error, rate, rsv, shp;
if (qos->txtp.traffic_class == ATM_NONE)
return 0;
if (tx == eni_dev->ubr)
return -EBADF... | [
0,
0
] |
Linux Kernel | drivers/atm/eni.c |
static int eni_ioctl(struct atm_dev *dev, unsigned int cmd, void __user *arg) {
struct eni_dev *eni_dev = ENI_DEV(dev);
if (cmd == ENI_MEMDUMP) {
if (!capable(CAP_NET_ADMIN))
return -EPERM;
printk(KERN_WARNING "Please use /proc/atm/" DEV_LABEL ":%d "
"instead of obsolete ioc... | [
1,
0
] |
Linux Kernel | drivers/atm/eni.c |
static unsigned char eni_phy_get(struct atm_dev *dev, unsigned long addr) {
return readl(ENI_DEV(dev)->phy + addr * 4);
} | [
0,
0
] |
Linux Kernel | drivers/atm/eni.c |
static int eni_init_one(struct pci_dev *pci_dev,
const struct pci_device_id *ent) {
struct atm_dev *dev;
struct eni_dev *eni_dev;
struct eni_zero *zero;
int rc;
rc = pci_enable_device(pci_dev);
if (rc < 0)
goto out;
rc = dma_set_mask_and_coherent(&pci_dev->dev, DMA_BIT_MASK... | [
0,
0
] |
Linux Kernel | drivers/atm/fore200e.c | static void fore200e_chunk_free(struct fore200e *fore200e,
struct chunk *chunk) {
dma_unmap_single(fore200e->dev, chunk->dma_addr, chunk->dma_size,
chunk->direction);
kfree(chunk->alloc_addr);
} | [
0,
0
] |
Linux Kernel | drivers/atm/fore200e.c |
static int fore200e_poll(struct fore200e *fore200e, volatile u32 *addr, u32 val,
int msecs) {
unsigned long timeout = jiffies + msecs_to_jiffies(msecs);
int ok;
mb();
do {
if ((ok = (*addr == val)) || (*addr & STATUS_ERROR))
break;
} while (time_before(jiffies, timeout))... | [
1,
0
] |
Linux Kernel | drivers/atm/fore200e.c |
static void fore200e_free_rx_buf(struct fore200e *fore200e) {
int scheme, magn, nbr;
struct buffer *buffer;
for (scheme = 0; scheme < BUFFER_SCHEME_NBR; scheme++) {
for (magn = 0; magn < BUFFER_MAGN_NBR; magn++) {
if ((buffer = fore200e->host_bsq[scheme][magn].buffer) != NULL) {
for (nbr = ... | [
0,
0
] |
Linux Kernel | drivers/atm/fore200e.c |
static void fore200e_uninit_bs_queue(struct fore200e *fore200e) {
int scheme, magn;
for (scheme = 0; scheme < BUFFER_SCHEME_NBR; scheme++) {
for (magn = 0; magn < BUFFER_MAGN_NBR; magn++) {
struct chunk *status = &fore200e->host_bsq[scheme][magn].status;
struct chunk *rbd_block = &fore200e->host... | [
0,
0
] |
Linux Kernel | drivers/atm/fore200e.c | static int fore200e_pca_map(struct fore200e *fore200e) {
DPRINTK(2, "device %s being mapped in memory\n", fore200e->name);
fore200e->virt_base = ioremap(fore200e->phys_base, PCA200E_IOSPACE_LENGTH);
if (fore200e->virt_base == NULL) {
printk(FORE200E "can't map device %s\n", fore200e->name);
return -EFAU... | [
1,
0
] |
Linux Kernel | drivers/atm/fore200e.c | static int fore200e_pca_configure(struct fore200e *fore200e) {
struct pci_dev *pci_dev = to_pci_dev(fore200e->dev);
u8 master_ctrl, latency;
DPRINTK(2, "device %s being configured\n", fore200e->name);
if ((pci_dev->irq == 0) || (pci_dev->irq == 0xFF)) {
printk(FORE200E "incorrect IRQ setting - misconfigur... | [
0,
0
] |
Linux Kernel | drivers/atm/fore200e.c |
static u32 fore200e_sba_read(volatile u32 __iomem *addr) {
return sbus_readl(addr);
} | [
0,
0
] |
Linux Kernel | drivers/atm/fore200e.c |
static void fore200e_sba_write(u32 val, volatile u32 __iomem *addr) {
sbus_writel(val, addr);
} | [
0,
0
] |
Linux Kernel | drivers/atm/fore200e.c |
static int fore200e_sba_irq_check(struct fore200e *fore200e) {
return fore200e->bus->read(fore200e->regs.sba.hcr) & SBA200E_HCR_INTR_REQ;
} | [
0,
0
] |
Linux Kernel | drivers/atm/fore200e.c |
static int fore200e_sba_proc_read(struct fore200e *fore200e, char *page) {
struct platform_device *op = to_platform_device(fore200e->dev);
const struct linux_prom_registers *regs;
regs = of_get_property(op->dev.of_node, "reg", NULL);
return sprintf(page, " SBUS slot/device:\t\t%d/'%pOFn'\n",
... | [
1,
0
] |
Linux Kernel | drivers/atm/fore200e.c | static void fore200e_supply(struct fore200e *fore200e) {
int scheme, magn, i;
struct host_bsq *bsq;
struct host_bsq_entry *entry;
struct buffer *buffer;
for (scheme = 0; scheme < BUFFER_SCHEME_NBR; scheme++) {
for (magn = 0; magn < BUFFER_MAGN_NBR; magn++) {
bsq = &fore200e->host_bsq[scheme][magn... | [
0,
0
] |
Linux Kernel | drivers/atm/fore200e.c | static void fore200e_rx_irq(struct fore200e *fore200e) {
struct host_rxq *rxq = &fore200e->host_rxq;
struct host_rxq_entry *entry;
struct atm_vcc *vcc;
struct fore200e_vc_map *vc_map;
for (;;) {
entry = &rxq->host_entry[rxq->head];
if ((*entry->status & STATUS_COMPLETE) == 0)
break;
vc_m... | [
1,
0
] |
Linux Kernel | drivers/atm/fore200e.c | static void fore200e_irq(struct fore200e *fore200e) {
unsigned long flags;
spin_lock_irqsave(&fore200e->q_lock, flags);
fore200e_rx_irq(fore200e);
spin_unlock_irqrestore(&fore200e->q_lock, flags);
spin_lock_irqsave(&fore200e->q_lock, flags);
fore200e_tx_irq(fore200e);
spin_unlock_irqrestore(&fore200e->q... | [
0,
0
] |
Linux Kernel | drivers/atm/fore200e.c |
static irqreturn_t fore200e_interrupt(int irq, void *dev) {
struct fore200e *fore200e = FORE200E_DEV((struct atm_dev *)dev);
if (fore200e->bus->irq_check(fore200e) == 0) {
DPRINTK(3, "interrupt NOT triggered by device %d\n",
fore200e->atm_dev->number);
return IRQ_NONE;
}
DPRINTK(3, "inte... | [
1,
0
] |
Linux Kernel | drivers/atm/fore200e.c | static void fore200e_close(struct atm_vcc *vcc) {
struct fore200e_vcc *fore200e_vcc;
struct fore200e *fore200e;
struct fore200e_vc_map *vc_map;
unsigned long flags;
ASSERT(vcc);
fore200e = FORE200E_DEV(vcc->dev);
ASSERT((vcc->vpi >= 0) && (vcc->vpi < 1 << FORE200E_VPI_BITS));
ASSERT((vcc->vci >= 0) &&... | [
1,
0
] |
Linux Kernel | drivers/atm/fore200e.c |
static int fore200e_fetch_stats(struct fore200e *fore200e,
struct sonet_stats __user *arg) {
struct sonet_stats tmp;
if (fore200e_getstats(fore200e) < 0)
return -EIO;
tmp.section_bip = be32_to_cpu(fore200e->stats->oc3.section_bip8_errors);
tmp.line_bip = be32_to_cpu(fore2... | [
1,
0
] |
Linux Kernel | drivers/atm/fore200e.c | static int fore200e_ioctl(struct atm_dev *dev, unsigned int cmd,
void __user *arg) {
struct fore200e *fore200e = FORE200E_DEV(dev);
DPRINTK(2, "ioctl cmd = 0x%x (%u), arg = 0x%p (%lu)\n", cmd, cmd, arg,
(unsigned long)arg);
switch (cmd) {
case SONET_GETSTAT:
return for... | [
1,
0
] |
Linux Kernel | drivers/atm/fore200e.c | static int fore200e_alloc_rx_buf(struct fore200e *fore200e) {
int scheme, magn, nbr, size, i;
struct host_bsq *bsq;
struct buffer *buffer;
for (scheme = 0; scheme < BUFFER_SCHEME_NBR; scheme++) {
for (magn = 0; magn < BUFFER_MAGN_NBR; magn++) {
bsq = &fore200e->host_bsq[scheme][magn];
nbr = ... | [
1,
0
] |
Linux Kernel | drivers/atm/fore200e.c | static int fore200e_init(struct fore200e *fore200e, struct device *parent) {
if (fore200e_register(fore200e, parent) < 0)
return -ENODEV;
if (fore200e->bus->configure(fore200e) < 0)
return -ENODEV;
if (fore200e->bus->map(fore200e) < 0)
return -ENODEV;
if (fore200e_reset(fore200e, 1) < 0)
retu... | [
0,
0
] |
Linux Kernel | drivers/atm/fore200e.c |
static void __exit fore200e_module_cleanup(void) {
#ifdef CONFIG_PCI
pci_unregister_driver(&fore200e_pca_driver);
#endif
#ifdef CONFIG_SBUS
platform_driver_unregister(&fore200e_sba_driver);
#endif
} | [
0,
0
] |
Linux Kernel | drivers/atm/he.c |
int he_init_one(struct pci_dev *pci_dev, const struct pci_device_id *pci_ent) {
struct atm_dev *atm_dev = NULL;
struct he_dev *he_dev = NULL;
int err = 0;
printk(KERN_INFO "ATM he driver\n");
if (pci_enable_device(pci_dev))
return -EIO;
if (dma_set_mask_and_coherent(&pci_dev->dev, DMA_BIT_MASK(32)) !... | [
0,
0
] |
Linux Kernel | drivers/atm/he.c | static void he_remove_one(struct pci_dev *pci_dev) {
struct atm_dev *atm_dev;
struct he_dev *he_dev;
atm_dev = pci_get_drvdata(pci_dev);
he_dev = HE_DEV(atm_dev);
he_stop(he_dev);
atm_dev_deregister(atm_dev);
kfree(he_dev);
pci_disable_device(pci_dev);
} | [
0,
0
] |
Linux Kernel | drivers/atm/he.c |
static int he_init_tpdrq(struct he_dev *he_dev) {
he_dev->tpdrq_base = dma_alloc_coherent(
&he_dev->pci_dev->dev, CONFIG_TPDRQ_SIZE * sizeof(struct he_tpdrq),
&he_dev->tpdrq_phys, GFP_KERNEL);
if (he_dev->tpdrq_base == NULL) {
hprintk("failed to alloc tpdrq\n");
return -ENOMEM;
}
he_dev->t... | [
1,
0
] |
Linux Kernel | drivers/atm/he.c | static irqreturn_t he_irq_handler(int irq, void *dev_id) {
unsigned long flags;
struct he_dev *he_dev = (struct he_dev *)dev_id;
int handled = 0;
if (he_dev == NULL)
return IRQ_NONE;
spin_lock_irqsave(&he_dev->global_lock, flags);
he_dev->irq_tail = (struct he_irq *)(((unsigned long)he_dev->irq_base)... | [
0,
0
] |
Linux Kernel | drivers/atm/idt77105.c | static void idt77105_stats_timer_func(struct timer_list *unused) {
struct idt77105_priv *walk;
struct atm_dev *dev;
struct idt77105_stats *stats;
DPRINTK("IDT77105 gathering statistics\n");
for (walk = idt77105_all; walk; walk = walk->next) {
dev = walk->dev;
stats = &walk->stats;
stats->symbol_... | [
0,
0
] |
Linux Kernel | drivers/atm/idt77105.c |
static int fetch_stats(struct atm_dev *dev, struct idt77105_stats __user *arg,
int zero) {
unsigned long flags;
struct idt77105_stats stats;
spin_lock_irqsave(&idt77105_priv_lock, flags);
memcpy(&stats, &PRIV(dev)->stats, sizeof(struct idt77105_stats));
if (zero)
memset(&PRIV(dev... | [
1,
0
] |
Linux Kernel | drivers/atm/idt77252.c |
static void write_sram(struct idt77252_dev *card, unsigned long addr,
u32 value) {
unsigned long flags;
if ((idt77252_sram_write_errors == 0) &&
(((addr > card->tst[0] + card->tst_size - 2) &&
(addr < card->tst[0] + card->tst_size)) ||
((addr > card->tst[1] + card->tst_... | [
1,
0
] |
Linux Kernel | drivers/atm/idt77252.c |
static u8 idt77252_eeprom_read_status(struct idt77252_dev *card) {
u8 byte;
u32 gp;
int i, j;
gp = idt77252_read_gp(card) & ~(SAR_GP_EESCLK | SAR_GP_EECS | SAR_GP_EEDO);
for (i = 0; i < ARRAY_SIZE(rdsrtab); i++) {
idt77252_write_gp(card, gp | rdsrtab[i]);
udelay(5);
}
idt77252_write_gp(card, gp... | [
1,
0
] |
Linux Kernel | drivers/atm/idt77252.c |
static u8 idt77252_eeprom_read_byte(struct idt77252_dev *card, u8 offset) {
u8 byte;
u32 gp;
int i, j;
gp = idt77252_read_gp(card) & ~(SAR_GP_EESCLK | SAR_GP_EECS | SAR_GP_EEDO);
for (i = 0; i < ARRAY_SIZE(rdtab); i++) {
idt77252_write_gp(card, gp | rdtab[i]);
udelay(5);
}
idt77252_write_gp(car... | [
1,
0
] |
Linux Kernel | drivers/atm/idt77252.c |
static struct scq_info *alloc_scq(struct idt77252_dev *card, int class) {
struct scq_info *scq;
scq = kzalloc(sizeof(struct scq_info), GFP_KERNEL);
if (!scq)
return NULL;
scq->base =
dma_alloc_coherent(&card->pcidev->dev, SCQ_SIZE, &scq->paddr, GFP_KERNEL);
if (scq->base == NULL) {
kfree(scq);... | [
1,
0
] |
Linux Kernel | drivers/atm/idt77252.c |
static void free_scq(struct idt77252_dev *card, struct scq_info *scq) {
struct sk_buff *skb;
struct atm_vcc *vcc;
dma_free_coherent(&card->pcidev->dev, SCQ_SIZE, scq->base, scq->paddr);
while ((skb = skb_dequeue(&scq->transmit))) {
dma_unmap_single(&card->pcidev->dev, IDT77252_PRV_PADDR(skb), skb->len,
... | [
0,
0
] |
Linux Kernel | drivers/atm/idt77252.c |
static unsigned long get_free_scd(struct idt77252_dev *card,
struct vc_map *vc) {
int i;
for (i = 0; i < card->scd_size; i++) {
if (!card->scd2vc[i]) {
card->scd2vc[i] = vc;
vc->scd_index = i;
return card->scd_base + i * SAR_SRAM_SCD_SIZE;
}
}
return... | [
0,
0
] |
Linux Kernel | drivers/atm/idt77252.c |
static int __clear_tst(struct idt77252_dev *card, struct vc_map *vc) {
unsigned long idle;
int e;
idle = card->tst[card->tst_index ^ 1];
for (e = 0; e < card->tst_size - 2; e++) {
if (card->soft_tst[e].vc == vc) {
card->soft_tst[e].vc = NULL;
card->soft_tst[e].tste = TSTE_OPC_VAR;
if (... | [
1,
0
] |
Linux Kernel | drivers/atm/idt77252.c |
static int idt77252_init_ubr(struct idt77252_dev *card, struct vc_map *vc,
struct atm_vcc *vcc, struct atm_qos *qos) {
struct rate_estimator *est = NULL;
unsigned long flags;
int tcr;
spin_lock_irqsave(&vc->lock, flags);
if (vc->estimator) {
est = vc->estimator;
vc->esti... | [
1,
0
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.