Projectname large_stringclasses 15
values | Filepath large_stringlengths 4 106 ⌀ | Function large_stringlengths 11 3.45k | Label list |
|---|---|---|---|
Linux Kernel | drivers/ata/pata_ali.c | static int ali_cable_override(struct pci_dev *pdev) {
if (pdev->subsystem_vendor == 0x10CF && pdev->subsystem_device == 0x10AF)
return 1;
/* Mitac 8317 (Winbook-A) and relatives */
if (pdev->subsystem_vendor == 0x1071 && pdev->subsystem_device == 0x8317)
return 1;
/* Systems by DMI */
if (dmi_check_s... | [
1,
0
] |
Linux Kernel | drivers/ata/pata_ali.c | static unsigned int ali_20_filter(struct ata_device *adev, unsigned int mask) {
char model_num[ATA_ID_PROD_LEN + 1];
if (adev->class != ATA_DEV_ATA)
mask &= ~(ATA_MASK_MWDMA | ATA_MASK_UDMA);
ata_id_c_string(adev->id, model_num, ATA_ID_PROD, sizeof(model_num));
if (strstr(model_num, "WDC"))
mask &= ~AT... | [
1,
0
] |
Linux Kernel | drivers/ata/pata_ali.c | static void ali_warn_atapi_dma(struct ata_device *adev) {
struct ata_eh_context *ehc = &adev->link->eh_context;
int print_info = ehc->i.flags & ATA_EHI_PRINTINFO;
if (print_info && adev->class == ATA_DEV_ATAPI && !ali_atapi_dma) {
ata_dev_warn(adev, "WARNING: ATAPI DMA disabled for reliability issues. "
... | [
1,
0
] |
Linux Kernel | drivers/ata/pata_ali.c | static int ali_check_atapi_dma(struct ata_queued_cmd *qc) {
if (!ali_atapi_dma) {
/* FIXME: pata_ali can't do ATAPI DMA reliably but the
* IDE alim15x3 driver can. I tried lots of things
* but couldn't find what the actual difference was.
* If you got an idea, please write it to
* linux-ide@v... | [
0,
1
] |
Linux Kernel | drivers/ata/pata_ali.c | static void ali_c2_c3_postreset(struct ata_link *link, unsigned int *classes) {
u8 r;
int port_bit = 4 << link->ap->port_no;
if (ali_isa_bridge) {
/* Tristate and re-enable the bus signals */
pci_read_config_byte(ali_isa_bridge, 0x58, &r);
r &= ~port_bit;
pci_write_config_byte(ali_isa_bridge, 0x5... | [
0,
0
] |
Linux Kernel | drivers/ata/pata_ali.c | static int ali_reinit_one(struct pci_dev *pdev) {
struct ata_host *host = pci_get_drvdata(pdev);
int rc;
rc = ata_pci_device_do_resume(pdev);
if (rc)
return rc;
ali_init_chipset(pdev);
ata_host_resume(host);
return 0;
}
#endif | [
0,
0
] |
Linux Kernel | drivers/ata/pata_ali.c |
static int __init ali_init(void) {
int ret;
ali_isa_bridge =
pci_get_device(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M1533, NULL);
ret = pci_register_driver(&ali_pci_driver);
if (ret < 0)
pci_dev_put(ali_isa_bridge);
return ret;
} | [
0,
0
] |
Linux Kernel | drivers/ata/pata_ali.c |
static void __exit ali_exit(void) {
pci_unregister_driver(&ali_pci_driver);
pci_dev_put(ali_isa_bridge);
} | [
0,
0
] |
Linux Kernel | drivers/ata/pata_amd.c | static void amd33_set_dmamode(struct ata_port *ap, struct ata_device *adev) {
timing_setup(ap, adev, 0x40, adev->dma_mode, 1);
} | [
0,
0
] |
Linux Kernel | drivers/ata/pata_amd.c |
static void amd100_set_dmamode(struct ata_port *ap, struct ata_device *adev) {
timing_setup(ap, adev, 0x40, adev->dma_mode, 3);
} | [
0,
0
] |
Linux Kernel | drivers/ata/pata_amd.c | static int nv_pre_reset(struct ata_link *link, unsigned long deadline) {
static const struct pci_bits nv_enable_bits[] = {{0x50, 1, 0x02, 0x02},
{0x50, 1, 0x01, 0x01}};
struct ata_port *ap = link->ap;
struct pci_dev *pdev = to_pci_dev(ap->host->dev);
if (!pci... | [
0,
0
] |
Linux Kernel | drivers/ata/pata_arasan_cf.c | static inline void cf_interrupt_enable(struct arasan_cf_dev *acdev, u32 mask,
bool enable) {
u32 val = readl(acdev->vbase + IRQ_EN);
if (enable) {
writel(mask, acdev->vbase + IRQ_STS);
writel(val | mask, acdev->vbase + IRQ_EN);
} else
writel(val & ~mask, acdev->... | [
0,
0
] |
Linux Kernel | drivers/ata/pata_arasan_cf.c | static void cf_card_detect(struct arasan_cf_dev *acdev, bool hotplugged) {
struct ata_port *ap = acdev->host->ports[0];
struct ata_eh_info *ehi = &ap->link.eh_info;
u32 val = readl(acdev->vbase + CFI_STS);
if (!(val & (CARD_DETECT1 | CARD_DETECT2))) {
if (acdev->card_present)
return;
acdev->card_... | [
1,
0
] |
Linux Kernel | drivers/ata/pata_arasan_cf.c | static int cf_init(struct arasan_cf_dev *acdev) {
struct arasan_cf_pdata *pdata = dev_get_platdata(acdev->host->dev);
unsigned int if_clk;
unsigned long flags;
int ret = 0;
ret = clk_prepare_enable(acdev->clk);
if (ret) {
dev_dbg(acdev->host->dev, "clock enable failed");
return ret;
}
ret = cl... | [
1,
1
] |
Linux Kernel | drivers/ata/pata_arasan_cf.c |
static void cf_exit(struct arasan_cf_dev *acdev) {
unsigned long flags;
spin_lock_irqsave(&acdev->host->lock, flags);
cf_ginterrupt_enable(acdev, 0);
cf_interrupt_enable(acdev, TRUE_IDE_IRQS, 0);
cf_card_reset(acdev);
writel(readl(acdev->vbase + OP_MODE) & ~CFHOST_ENB, acdev->vbase + OP_MODE);
spin_unlo... | [
0,
0
] |
Linux Kernel | drivers/ata/pata_arasan_cf.c | static void arasan_cf_freeze(struct ata_port *ap) {
struct arasan_cf_dev *acdev = ap->host->private_data;
writel(readl(acdev->vbase + XFER_CTR) & ~XFER_START, acdev->vbase + XFER_CTR);
cf_ctrl_reset(acdev);
acdev->dma_status = ATA_DMA_ERR;
ata_sff_dma_pause(ap);
ata_sff_freeze(ap);
} | [
1,
0
] |
Linux Kernel | drivers/ata/pata_arasan_cf.c | static unsigned int arasan_cf_qc_issue(struct ata_queued_cmd *qc) {
struct ata_port *ap = qc->ap;
struct arasan_cf_dev *acdev = ap->host->private_data;
if (!ata_is_dma(qc->tf.protocol))
return ata_sff_qc_issue(qc);
/* select the device */
ata_wait_idle(ap);
ata_sff_dev_select(ap, qc->dev->devno);
at... | [
1,
0
] |
Linux Kernel | drivers/ata/pata_arasan_cf.c | static void arasan_cf_set_piomode(struct ata_port *ap,
struct ata_device *adev) {
struct arasan_cf_dev *acdev = ap->host->private_data;
u8 pio = adev->pio_mode - XFER_PIO_0;
unsigned long flags;
u32 val;
if (pio > 6) {
dev_err(ap->dev, "Unknown PIO mode\n");
return;
... | [
1,
0
] |
Linux Kernel | drivers/ata/pata_arasan_cf.c | static int arasan_cf_suspend(struct device *dev) {
struct ata_host *host = dev_get_drvdata(dev);
struct arasan_cf_dev *acdev = host->ports[0]->private_data;
if (acdev->dma_chan)
dmaengine_terminate_all(acdev->dma_chan);
cf_exit(acdev);
ata_host_suspend(host, PMSG_SUSPEND);
return 0;
} | [
1,
0
] |
Linux Kernel | drivers/ata/pata_arasan_cf.c |
static int arasan_cf_resume(struct device *dev) {
struct ata_host *host = dev_get_drvdata(dev);
struct arasan_cf_dev *acdev = host->ports[0]->private_data;
cf_init(acdev);
ata_host_resume(host);
return 0;
}
#endif | [
1,
0
] |
Linux Kernel | drivers/ata/pata_artop.c | static void artop6260_load_piomode(struct ata_port *ap, struct ata_device *adev,
unsigned int pio) {
struct pci_dev *pdev = to_pci_dev(ap->host->dev);
int dn = adev->devno + 2 * ap->port_no;
static const u8 timing[2][5] = {{0x00, 0x0A, 0x08, 0x33, 0x31},
... | [
0,
0
] |
Linux Kernel | drivers/ata/pata_artop.c | static int artop6210_qc_defer(struct ata_queued_cmd *qc) {
struct ata_host *host = qc->ap->host;
struct ata_port *alt = host->ports[1 ^ qc->ap->port_no];
int rc;
rc = ata_std_qc_defer(qc);
if (rc != 0)
return rc;
/* Now apply serialization rules. Only allow a command if the
other channel state ma... | [
1,
0
] |
Linux Kernel | drivers/ata/pata_atiixp.c | static int atiixp_cable_detect(struct ata_port *ap) {
struct pci_dev *pdev = to_pci_dev(ap->host->dev);
u8 udma;
if (dmi_check_system(attixp_cable_override_dmi_table))
return ATA_CBL_PATA40_SHORT;
/* Hack from drivers/ide/pci. Really we want to know how to do the
raw detection not play follow the bio... | [
1,
1
] |
Linux Kernel | drivers/ata/pata_atiixp.c | static void atiixp_set_piomode(struct ata_port *ap, struct ata_device *adev) {
unsigned long flags;
spin_lock_irqsave(&atiixp_lock, flags);
atiixp_set_pio_timing(ap, adev, adev->pio_mode - XFER_PIO_0);
spin_unlock_irqrestore(&atiixp_lock, flags);
} | [
0,
0
] |
Linux Kernel | drivers/ata/pata_atiixp.c | static int atiixp_init_one(struct pci_dev *pdev,
const struct pci_device_id *id) {
static const struct ata_port_info info = {.flags = ATA_FLAG_SLAVE_POSS,
.pio_mask = ATA_PIO4,
.mwdma_mask = ATA_MWDMA12_... | [
0,
0
] |
Linux Kernel | drivers/ata/pata_atp867x.c |
static int atp867x_set_priv(struct ata_port *ap) {
struct pci_dev *pdev = to_pci_dev(ap->host->dev);
struct atp867x_priv *dp;
int port = ap->port_no;
dp = ap->private_data = devm_kzalloc(&pdev->dev, sizeof(*dp), GFP_KERNEL);
if (dp == NULL)
return -ENOMEM;
dp->dma_mode = ATP867X_IO_DMAMODE(ap, port);... | [
1,
0
] |
Linux Kernel | drivers/ata/pata_atp867x.c | static int atp867x_ata_pci_sff_init_host(struct ata_host *host) {
struct device *gdev = host->dev;
struct pci_dev *pdev = to_pci_dev(gdev);
unsigned int mask = 0;
int i, rc;
rc = pcim_iomap_regions(pdev, 1 << ATP867X_BAR_IOBASE, DRV_NAME);
if (rc == -EBUSY)
pcim_pin_device(pdev);
if (rc)
return r... | [
1,
0
] |
Linux Kernel | drivers/ata/pata_buddha.c | static unsigned int pata_buddha_data_xfer(struct ata_queued_cmd *qc,
unsigned char *buf,
unsigned int buflen, int rw) {
struct ata_device *dev = qc->dev;
struct ata_port *ap = dev->link->ap;
void __iomem *data_addr = ap->ioaddr.da... | [
1,
1
] |
Linux Kernel | drivers/ata/pata_buddha.c | static int pata_buddha_set_mode(struct ata_link *link,
struct ata_device **unused) {
struct ata_device *dev;
ata_for_each_dev(dev, link, ENABLED) {
dev->pio_mode = dev->xfer_mode = XFER_PIO_0;
dev->xfer_shift = ATA_SHIFT_PIO;
dev->flags |= ATA_DFLAG_PIO;
ata_dev_inf... | [
0,
0
] |
Linux Kernel | drivers/ata/pata_buddha.c |
static void pata_buddha_remove(struct zorro_dev *z) {
struct ata_host *host = dev_get_drvdata(&z->dev);
ata_host_detach(host);
} | [
0,
0
] |
Linux Kernel | drivers/ata/pata_cmd640.c |
static int cmd640_init_one(struct pci_dev *pdev,
const struct pci_device_id *id) {
static const struct ata_port_info info = {.flags = ATA_FLAG_SLAVE_POSS,
.pio_mask = ATA_PIO4,
.port_ops = &cmd640_port_... | [
0,
0
] |
Linux Kernel | drivers/ata/pata_cmd64x.c | static void cmd64x_set_dmamode(struct ata_port *ap, struct ata_device *adev) {
static const u8 udma_data[] = {0x30, 0x20, 0x10, 0x20, 0x10, 0x00};
struct pci_dev *pdev = to_pci_dev(ap->host->dev);
u8 regU, regD;
int pciU = UDIDETCR0 + 8 * ap->port_no;
int pciD = BMIDESR0 + 8 * ap->port_no;
int shift = 2 *... | [
1,
0
] |
Linux Kernel | drivers/ata/pata_cmd64x.c | static void cmd648_sff_irq_clear(struct ata_port *ap) {
struct pci_dev *pdev = to_pci_dev(ap->host->dev);
unsigned long base = pci_resource_start(pdev, 4);
int irq_mask = ap->port_no ? MRDMODE_INTR_CH1 : MRDMODE_INTR_CH0;
u8 mrdmode;
ata_bmdma_irq_clear(ap);
mrdmode = inb(base + 1);
mrdmode &= ~(MRDMODE... | [
1,
0
] |
Linux Kernel | drivers/ata/pata_cmd64x.c | static void cmd646r1_bmdma_stop(struct ata_queued_cmd *qc) {
ata_bmdma_stop(qc);
} | [
0,
0
] |
Linux Kernel | drivers/ata/pata_cmd64x.c | static void cmd64x_fixup(struct pci_dev *pdev) {
u8 mrdmode;
pci_write_config_byte(pdev, PCI_LATENCY_TIMER, 64);
pci_read_config_byte(pdev, MRDMODE, &mrdmode);
mrdmode &= ~0x30;
mrdmode |= 0x02; /* Memory read line enable */
pci_write_config_byte(pdev, MRDMODE, mrdmode);
/* PPC specific fixup copied fro... | [
1,
0
] |
Linux Kernel | drivers/ata/pata_cs5520.c | static void cs5520_set_timings(struct ata_port *ap, struct ata_device *adev,
int pio) {
struct pci_dev *pdev = to_pci_dev(ap->host->dev);
int slave = adev->devno;
pio -= XFER_PIO_0;
pci_write_config_byte(pdev, 0x62 + ap->port_no,
(cs5520_pio_clocks[pio].r... | [
1,
1
] |
Linux Kernel | drivers/ata/pata_cs5530.c |
static int cs5530_is_palmax(void) {
if (dmi_check_system(palmax_dmi_table)) {
printk(KERN_INFO "Palmax PD1100: Disabling DMA on docking port.\n");
return 1;
}
return 0;
} | [
0,
0
] |
Linux Kernel | drivers/ata/pata_cs5536.c |
static void cs5536_program_dtc(struct ata_device *adev, u8 tim) {
struct pci_dev *pdev = to_pci_dev(adev->link->ap->host->dev);
int dshift = adev->devno ? IDE_D1_SHIFT : IDE_D0_SHIFT;
u32 dtc;
cs5536_read(pdev, DTC, &dtc);
dtc &= ~(IDE_DRV_MASK << dshift);
dtc |= tim << dshift;
cs5536_write(pdev, DTC, d... | [
1,
0
] |
Linux Kernel | drivers/ata/pata_cs5536.c | static int cs5536_cable_detect(struct ata_port *ap) {
struct pci_dev *pdev = to_pci_dev(ap->host->dev);
u32 cfg;
cs5536_read(pdev, CFG, &cfg);
if (cfg & IDE_CFG_CABLE)
return ATA_CBL_PATA80;
else
return ATA_CBL_PATA40;
} | [
0,
0
] |
Linux Kernel | drivers/ata/pata_cypress.c | static int cy82c693_init_one(struct pci_dev *pdev,
const struct pci_device_id *id) {
static struct ata_port_info info = {.flags = ATA_FLAG_SLAVE_POSS,
.pio_mask = ATA_PIO4,
.port_ops = &cy82c693_port_ops};
const... | [
0,
1
] |
Linux Kernel | drivers/ata/pata_efar.c | static int efar_cable_detect(struct ata_port *ap) {
struct pci_dev *pdev = to_pci_dev(ap->host->dev);
u8 tmp;
pci_read_config_byte(pdev, 0x47, &tmp);
if (tmp & (2 >> ap->port_no))
return ATA_CBL_PATA40;
return ATA_CBL_PATA80;
} | [
0,
0
] |
Linux Kernel | drivers/ata/pata_ep93xx.c | static unsigned long ep93xx_pata_wait_for_iordy(void __iomem *base,
unsigned long t2) {
unsigned long start = (1250 + 35) / 25 - t2;
unsigned long counter = start;
while (!ep93xx_pata_check_iordy(base) && counter--)
ep93xx_pata_delay(1);
return start - count... | [
1,
0
] |
Linux Kernel | drivers/ata/pata_ep93xx.c |
static u8 ep93xx_pata_check_altstatus(struct ata_port *ap) {
struct ep93xx_pata_data *drv_data = ap->host->private_data;
return ep93xx_pata_read_reg(drv_data, IDECTRL_ADDR_ALTSTATUS);
} | [
1,
0
] |
Linux Kernel | drivers/ata/pata_ep93xx.c | static void ep93xx_pata_dev_select(struct ata_port *ap, unsigned int device) {
struct ep93xx_pata_data *drv_data = ap->host->private_data;
u8 tmp = ATA_DEVICE_OBS;
if (device != 0)
tmp |= ATA_DEV1;
ep93xx_pata_write_reg(drv_data, tmp, IDECTRL_ADDR_DEVICE);
ata_sff_pause(ap);
} | [
1,
0
] |
Linux Kernel | drivers/ata/pata_ep93xx.c | static bool ep93xx_pata_device_is_present(struct ata_port *ap,
unsigned int device) {
struct ep93xx_pata_data *drv_data = ap->host->private_data;
u8 nsect, lbal;
ap->ops->sff_dev_select(ap, device);
ep93xx_pata_write_reg(drv_data, 0x55, IDECTRL_ADDR_NSECT);
ep93xx_p... | [
1,
0
] |
Linux Kernel | drivers/ata/pata_ep93xx.c | static int ep93xx_pata_port_start(struct ata_port *ap) {
struct ep93xx_pata_data *drv_data = ap->host->private_data;
drv_data->t = *ata_timing_find_mode(XFER_PIO_0);
return 0;
} | [
1,
0
] |
Linux Kernel | drivers/ata/pata_ep93xx.c |
static int ep93xx_pata_remove(struct platform_device *pdev) {
struct ata_host *host = platform_get_drvdata(pdev);
struct ep93xx_pata_data *drv_data = host->private_data;
ata_host_detach(host);
ep93xx_pata_release_dma(drv_data);
ep93xx_pata_clear_regs(drv_data->ide_base);
ep93xx_ide_release_gpio(pdev);
r... | [
0,
0
] |
Linux Kernel | drivers/ata/pata_falcon.c | static unsigned int pata_falcon_data_xfer(struct ata_queued_cmd *qc,
unsigned char *buf,
unsigned int buflen, int rw) {
struct ata_device *dev = qc->dev;
struct ata_port *ap = dev->link->ap;
void __iomem *data_addr = ap->ioaddr.da... | [
1,
0
] |
Linux Kernel | drivers/ata/pata_falcon.c |
static int __exit pata_falcon_remove_one(struct platform_device *pdev) {
struct ata_host *host = platform_get_drvdata(pdev);
ata_host_detach(host);
return 0;
} | [
0,
0
] |
Linux Kernel | drivers/ata/pata_ftide010.c | static int pata_ftide010_gemini_port_start(struct ata_port *ap) {
struct ftide010 *ftide = ap->host->private_data;
struct device *dev = ftide->dev;
struct sata_gemini *sg = ftide->sg;
int bridges = 0;
int ret;
ret = ata_bmdma_port_start(ap);
if (ret)
return ret;
if (ftide->master_to_sata0) {
d... | [
1,
0
] |
Linux Kernel | drivers/ata/pata_ftide010.c | static void pata_ftide010_gemini_port_stop(struct ata_port *ap) {
struct ftide010 *ftide = ap->host->private_data;
struct device *dev = ftide->dev;
struct sata_gemini *sg = ftide->sg;
if (ftide->master_to_sata0) {
dev_info(dev, "SATA0 (master) stop\n");
gemini_sata_stop_bridge(sg, 0);
}
if (ftide->... | [
1,
0
] |
Linux Kernel | drivers/ata/pata_ftide010.c |
static int pata_ftide010_remove(struct platform_device *pdev) {
struct ata_host *host = platform_get_drvdata(pdev);
struct ftide010 *ftide = host->private_data;
ata_host_detach(ftide->host);
clk_disable_unprepare(ftide->pclk);
return 0;
} | [
0,
0
] |
Linux Kernel | drivers/ata/pata_gayle.c | static unsigned int pata_gayle_data_xfer(struct ata_queued_cmd *qc,
unsigned char *buf,
unsigned int buflen, int rw) {
struct ata_device *dev = qc->dev;
struct ata_port *ap = dev->link->ap;
void __iomem *data_addr = ap->ioaddr.data_... | [
1,
1
] |
Linux Kernel | drivers/ata/pata_gayle.c | static int pata_gayle_set_mode(struct ata_link *link,
struct ata_device **unused) {
struct ata_device *dev;
ata_for_each_dev(dev, link, ENABLED) {
dev->pio_mode = dev->xfer_mode = XFER_PIO_0;
dev->xfer_shift = ATA_SHIFT_PIO;
dev->flags |= ATA_DFLAG_PIO;
ata_dev_info(... | [
0,
0
] |
Linux Kernel | drivers/ata/pata_gayle.c |
static void pata_gayle_irq_clear(struct ata_port *ap) {
(void)z_readb((unsigned long)ap->ioaddr.status_addr);
z_writeb(0x7c, (unsigned long)ap->private_data);
} | [
0,
0
] |
Linux Kernel | drivers/ata/pata_hpt366.c | static u32 hpt36x_find_mode(struct ata_port *ap, int speed) {
struct hpt_clock *clocks = ap->host->private_data;
while (clocks->xfer_mode) {
if (clocks->xfer_mode == speed)
return clocks->timing;
clocks++;
}
BUG();
return 0xffffffffU;
} | [
1,
0
] |
Linux Kernel | drivers/ata/pata_hpt366.c | static unsigned int hpt366_filter(struct ata_device *adev, unsigned int mask) {
if (adev->class == ATA_DEV_ATA) {
if (hpt_dma_blacklisted(adev, "UDMA", bad_ata33))
mask &= ~ATA_MASK_UDMA;
if (hpt_dma_blacklisted(adev, "UDMA3", bad_ata66_3))
mask &= ~(0xF8 << ATA_SHIFT_UDMA);
if (hpt_dma_blackl... | [
0,
0
] |
Linux Kernel | drivers/ata/pata_hpt366.c | static void hpt366_set_mode(struct ata_port *ap, struct ata_device *adev,
u8 mode) {
struct pci_dev *pdev = to_pci_dev(ap->host->dev);
u32 addr = 0x40 + 4 * adev->devno;
u32 mask, reg, t;
if (mode < XFER_MW_DMA_0)
mask = 0xc1f8ffff;
else if (mode < XFER_UDMA_0)
mask = 0x30... | [
1,
0
] |
Linux Kernel | drivers/ata/pata_hpt366.c | static void hpt36x_init_chipset(struct pci_dev *dev) {
u8 mcr1;
pci_write_config_byte(dev, PCI_CACHE_LINE_SIZE, (L1_CACHE_BYTES / 4));
pci_write_config_byte(dev, PCI_LATENCY_TIMER, 0x78);
pci_write_config_byte(dev, PCI_MIN_GNT, 0x08);
pci_write_config_byte(dev, PCI_MAX_LAT, 0x08);
pci_read_config_byte(dev... | [
0,
0
] |
Linux Kernel | drivers/ata/pata_hpt366.c | static int hpt36x_init_one(struct pci_dev *dev,
const struct pci_device_id *id) {
static const struct ata_port_info info_hpt366 = {.flags = ATA_FLAG_SLAVE_POSS,
.pio_mask = ATA_PIO4,
.mwdma... | [
0,
0
] |
Linux Kernel | drivers/ata/pata_hpt37x.c | static unsigned int hpt370a_filter(struct ata_device *adev, unsigned int mask) {
if (adev->class == ATA_DEV_ATA) {
if (hpt_dma_blacklisted(adev, "UDMA100", bad_ata100_5))
mask &= ~(0xE0 << ATA_SHIFT_UDMA);
}
return mask;
} | [
0,
0
] |
Linux Kernel | drivers/ata/pata_hpt37x.c | static int hpt37x_cable_detect(struct ata_port *ap) {
struct pci_dev *pdev = to_pci_dev(ap->host->dev);
u8 scr2, ata66;
pci_read_config_byte(pdev, 0x5B, &scr2);
pci_write_config_byte(pdev, 0x5B, scr2 & ~0x01);
udelay(10);
/* Cable register now active */
pci_read_config_byte(pdev, 0x5A, &ata66);
/* Re... | [
0,
0
] |
Linux Kernel | drivers/ata/pata_hpt37x.c | static int hpt37x_pre_reset(struct ata_link *link, unsigned long deadline) {
struct ata_port *ap = link->ap;
struct pci_dev *pdev = to_pci_dev(ap->host->dev);
static const struct pci_bits hpt37x_enable_bits[] = {{0x50, 1, 0x04, 0x04},
{0x54, 1, 0x04, 0x04}};
... | [
1,
0
] |
Linux Kernel | drivers/ata/pata_hpt37x.c | static void hpt37x_set_mode(struct ata_port *ap, struct ata_device *adev,
u8 mode) {
struct pci_dev *pdev = to_pci_dev(ap->host->dev);
int addr = 0x40 + 4 * (adev->devno + 2 * ap->port_no);
u32 reg, timing, mask;
if (mode < XFER_MW_DMA_0)
mask = 0xcfc3ffff;
else if (mode < XFE... | [
1,
0
] |
Linux Kernel | drivers/ata/pata_hpt37x.c | static void hpt37x_bmdma_stop(struct ata_queued_cmd *qc) {
struct ata_port *ap = qc->ap;
struct pci_dev *pdev = to_pci_dev(ap->host->dev);
int mscreg = 0x50 + 4 * ap->port_no;
u8 bwsr_stat, msc_stat;
pci_read_config_byte(pdev, 0x6A, &bwsr_stat);
pci_read_config_byte(pdev, mscreg, &msc_stat);
if (bwsr_sta... | [
0,
0
] |
Linux Kernel | drivers/ata/pata_hpt37x.c | static int hpt37x_calibrate_dpll(struct pci_dev *dev) {
u8 reg5b;
u32 reg5c;
int tries;
for (tries = 0; tries < 0x5000; tries++) {
udelay(50);
pci_read_config_byte(dev, 0x5b, ®5b);
if (reg5b & 0x80) {
for (tries = 0; tries < 0x1000; tries++) {
pci_read_config_byte(dev, 0x5b, ®5... | [
1,
0
] |
Linux Kernel | drivers/ata/pata_hpt37x.c | static int hpt37x_pci_clock(struct pci_dev *pdev, unsigned int base) {
unsigned int freq;
u32 fcnt;
if (pdev->device == PCI_DEVICE_ID_TTI_HPT374 && (PCI_FUNC(pdev->devfn) & 1)) {
struct pci_dev *pdev_fn0;
pdev_fn0 = pci_get_slot(pdev->bus, pdev->devfn - 1);
/* Someone hot plugged the controller on u... | [
1,
0
] |
Linux Kernel | drivers/ata/pata_hpt3x2n.c | static void hpt3x2n_bmdma_stop(struct ata_queued_cmd *qc) {
struct ata_port *ap = qc->ap;
struct pci_dev *pdev = to_pci_dev(ap->host->dev);
int mscreg = 0x50 + 4 * ap->port_no;
u8 bwsr_stat, msc_stat;
pci_read_config_byte(pdev, 0x6A, &bwsr_stat);
pci_read_config_byte(pdev, mscreg, &msc_stat);
if (bwsr_st... | [
0,
0
] |
Linux Kernel | drivers/ata/pata_hpt3x2n.c | static int hpt3x2n_use_dpll(struct ata_port *ap, int writing) {
long flags = (long)ap->host->private_data;
if (writing)
return USE_DPLL; /* Needed for write */
if (flags & PCI66)
return USE_DPLL; /* Needed at 66Mhz */
return 0;
} | [
0,
0
] |
Linux Kernel | drivers/ata/pata_hpt3x2n.c | static int hpt3x2n_qc_defer(struct ata_queued_cmd *qc) {
struct ata_port *ap = qc->ap;
struct ata_port *alt = ap->host->ports[ap->port_no ^ 1];
int rc, flags = (long)ap->host->private_data;
int dpll = hpt3x2n_use_dpll(ap, qc->tf.flags & ATA_TFLAG_WRITE);
rc = ata_std_qc_defer(qc);
if (rc != 0)
return r... | [
1,
0
] |
Linux Kernel | drivers/ata/pata_hpt3x3.c | static void hpt3x3_set_piomode(struct ata_port *ap, struct ata_device *adev) {
struct pci_dev *pdev = to_pci_dev(ap->host->dev);
u32 r1, r2;
int dn = 2 * ap->port_no + adev->devno;
pci_read_config_dword(pdev, 0x44, &r1);
pci_read_config_dword(pdev, 0x48, &r2);
r1 &= ~(7 << (3 * dn));
r1 |= (adev->pio_mo... | [
0,
0
] |
Linux Kernel | drivers/ata/pata_hpt3x3.c | static void hpt3x3_set_dmamode(struct ata_port *ap, struct ata_device *adev) {
struct pci_dev *pdev = to_pci_dev(ap->host->dev);
u32 r1, r2;
int dn = 2 * ap->port_no + adev->devno;
int mode_num = adev->dma_mode & 0x0F;
pci_read_config_dword(pdev, 0x44, &r1);
pci_read_config_dword(pdev, 0x48, &r2);
r1 &=... | [
1,
0
] |
Linux Kernel | drivers/ata/pata_icside.c | static void pata_icside_set_dmamode(struct ata_port *ap,
struct ata_device *adev) {
struct pata_icside_state *state = ap->host->private_data;
struct ata_timing t;
unsigned int cycle;
char iomd_type;
if (ata_timing_compute(adev, adev->dma_mode, &t, 1000, 1))
return;
... | [
1,
0
] |
Linux Kernel | drivers/ata/pata_icside.c | static void pata_icside_postreset(struct ata_link *link,
unsigned int *classes) {
struct ata_port *ap = link->ap;
struct pata_icside_state *state = ap->host->private_data;
if (classes[0] != ATA_DEV_NONE || classes[1] != ATA_DEV_NONE)
return ata_sff_postreset(link, classes);
... | [
1,
0
] |
Linux Kernel | drivers/ata/pata_icside.c |
static void pata_icside_setup_ioaddr(struct ata_port *ap, void __iomem *base,
struct pata_icside_info *info,
const struct portinfo *port) {
struct ata_ioports *ioaddr = &ap->ioaddr;
void __iomem *cmd = base + port->dataoffset;
ioaddr->cmd... | [
0,
0
] |
Linux Kernel | drivers/ata/pata_icside.c | static void pata_icside_shutdown(struct expansion_card *ec) {
struct ata_host *host = ecard_get_drvdata(ec);
unsigned long flags;
local_irq_save(flags);
ec->ops->irqdisable(ec, ec->irq);
local_irq_restore(flags);
/*
* Reset the ROM pointer so that we can read the ROM
* after a soft reboot. This als... | [
0,
0
] |
Linux Kernel | drivers/ata/pata_imx.c |
static void pata_imx_set_piomode(struct ata_port *ap, struct ata_device *adev) {
struct pata_imx_priv *priv = ap->host->private_data;
u32 val;
pata_imx_set_timing(adev, priv);
val = __raw_readl(priv->host_regs + PATA_IMX_ATA_CONTROL);
if (ata_pio_need_iordy(adev))
val |= PATA_IMX_ATA_CTRL_IORDY_EN;
e... | [
1,
0
] |
Linux Kernel | drivers/ata/pata_imx.c | static int pata_imx_suspend(struct device *dev) {
struct ata_host *host = dev_get_drvdata(dev);
struct pata_imx_priv *priv = host->private_data;
ata_host_suspend(host, PMSG_SUSPEND);
__raw_writel(0, priv->host_regs + PATA_IMX_ATA_INT_EN);
priv->ata_ctl = __raw_readl(priv->host_regs + PATA_IMX_ATA_CONTROL);
... | [
1,
0
] |
Linux Kernel | drivers/ata/pata_isapnp.c | static void isapnp_remove_one(struct pnp_dev *idev) {
struct device *dev = &idev->dev;
struct ata_host *host = dev_get_drvdata(dev);
ata_host_detach(host);
} | [
0,
0
] |
Linux Kernel | drivers/ata/pata_it821x.c | static void it821x_passthru_set_piomode(struct ata_port *ap,
struct ata_device *adev) {
static const u16 pio[] = {0xAA88, 0xA382, 0xA181, 0x3332, 0x3121};
static const u8 pio_want[] = {ATA_66, ATA_66, ATA_66, ATA_66, ATA_ANY};
struct it821x_dev *itdev = ap->private_data;
... | [
0,
0
] |
Linux Kernel | drivers/ata/pata_it821x.c | static void it821x_passthru_bmdma_start(struct ata_queued_cmd *qc) {
struct ata_port *ap = qc->ap;
struct ata_device *adev = qc->dev;
struct it821x_dev *itdev = ap->private_data;
int unit = adev->devno;
if (itdev->mwdma[unit] != MWDMA_OFF)
it821x_program(ap, adev, itdev->mwdma[unit]);
else if (itdev->u... | [
1,
0
] |
Linux Kernel | drivers/ata/pata_it821x.c | static void it821x_passthru_bmdma_stop(struct ata_queued_cmd *qc) {
struct ata_port *ap = qc->ap;
struct ata_device *adev = qc->dev;
struct it821x_dev *itdev = ap->private_data;
int unit = adev->devno;
ata_bmdma_stop(qc);
if (itdev->mwdma[unit] != MWDMA_OFF)
it821x_program(ap, adev, itdev->pio[unit]);
... | [
0,
0
] |
Linux Kernel | drivers/ata/pata_it821x.c | static int it821x_smart_set_mode(struct ata_link *link,
struct ata_device **unused) {
struct ata_device *dev;
ata_for_each_dev(dev, link, ENABLED) {
dev->pio_mode = XFER_PIO_0;
dev->dma_mode = XFER_MW_DMA_0;
/* We do need the right mode information for DMA or PIO
... | [
0,
0
] |
Linux Kernel | drivers/ata/pata_it821x.c | static int it821x_check_atapi_dma(struct ata_queued_cmd *qc) {
struct ata_port *ap = qc->ap;
struct it821x_dev *itdev = ap->private_data;
if (ata_qc_raw_nbytes(qc) < 2048)
return -EOPNOTSUPP;
/* No ATAPI DMA in smart mode */
if (itdev->smart)
return -EOPNOTSUPP;
/* No ATAPI DMA on rev 10 */
if (... | [
0,
0
] |
Linux Kernel | drivers/ata/pata_ixp4xx_cf.c |
static void ixp4xx_set_16bit_timing(struct ixp4xx_pata *ixpp, u8 pio_mode) {
switch (pio_mode) {
case XFER_PIO_0:
regmap_update_bits(ixpp->rmap, ixpp->cmd_csreg, IXP4XX_EXP_T1_T5_MASK,
IXP4XX_EXP_PIO_0_16);
break;
case XFER_PIO_1:
regmap_update_bits(ixpp->rmap, ixpp->cmd_csreg,... | [
0,
0
] |
Linux Kernel | drivers/ata/pata_ixp4xx_cf.c | static void ixp4xx_set_piomode(struct ata_port *ap, struct ata_device *adev) {
struct ixp4xx_pata *ixpp = ap->host->private_data;
ata_dev_info(adev, "configured for PIO%d 8bit\n",
adev->pio_mode - XFER_PIO_0);
ixp4xx_set_8bit_timing(ixpp, adev->pio_mode);
} | [
1,
0
] |
Linux Kernel | drivers/ata/pata_legacy.c | static int legacy_set_mode(struct ata_link *link, struct ata_device **unused) {
struct ata_device *dev;
ata_for_each_dev(dev, link, ENABLED) {
ata_dev_info(dev, "configured for PIO\n");
dev->pio_mode = XFER_PIO_0;
dev->xfer_mode = XFER_PIO_0;
dev->xfer_shift = ATA_SHIFT_PIO;
dev->flags |= ATA_D... | [
0,
0
] |
Linux Kernel | drivers/ata/pata_legacy.c | static void ht6560a_set_piomode(struct ata_port *ap, struct ata_device *adev) {
u8 active, recover;
struct ata_timing t;
ata_timing_compute(adev, adev->pio_mode, &t, 20000, 1000);
active = clamp_val(t.active, 2, 15);
recover = clamp_val(t.recover, 4, 15);
inb(0x3E6);
inb(0x3E6);
inb(0x3E6);
inb(0x3... | [
0,
0
] |
Linux Kernel | drivers/ata/pata_legacy.c | static u8 opti_syscfg(u8 reg) {
unsigned long flags;
u8 r;
local_irq_save(flags);
outb(reg, 0x22);
r = inb(0x24);
local_irq_restore(flags);
return r;
} | [
0,
0
] |
Linux Kernel | drivers/ata/pata_legacy.c | static unsigned int qdi_qc_issue(struct ata_queued_cmd *qc) {
struct ata_port *ap = qc->ap;
struct ata_device *adev = qc->dev;
struct legacy_data *ld_qdi = ap->host->private_data;
if (ld_qdi->clock[adev->devno] != ld_qdi->last) {
if (adev->pio_mode) {
ld_qdi->last = ld_qdi->clock[adev->devno];
... | [
1,
0
] |
Linux Kernel | drivers/ata/pata_legacy.c |
static int qdi_port(struct platform_device *dev, struct legacy_probe *lp,
struct legacy_data *ld) {
if (devm_request_region(&dev->dev, lp->private, 4, "qdi") == NULL)
return -EBUSY;
ld->timing = lp->private;
return 0;
} | [
0,
0
] |
Linux Kernel | drivers/ata/pata_legacy.c | static void winbond_set_piomode(struct ata_port *ap, struct ata_device *adev) {
struct ata_timing t;
struct legacy_data *ld_winbond = ap->host->private_data;
int active, recovery;
u8 reg;
int timing = 0x88 + (ap->port_no * 4) + (adev->devno * 2);
reg = winbond_readcfg(ld_winbond->timing, 0x81);
if (reg ... | [
1,
0
] |
Linux Kernel | drivers/ata/pata_legacy.c |
static int winbond_port(struct platform_device *dev, struct legacy_probe *lp,
struct legacy_data *ld) {
if (devm_request_region(&dev->dev, lp->private, 4, "winbond") == NULL)
return -EBUSY;
ld->timing = lp->private;
return 0;
} | [
0,
0
] |
Linux Kernel | drivers/ata/pata_legacy.c | static __init void qdi65_identify_port(u8 r, u8 res, unsigned long port) {
static const unsigned long ide_port[2] = {0x170, 0x1F0};
if ((r & 0xF0) == 0xC0) {
/* QD6500: single channel */
if (r & 8)
/* Disabled ? */
return;
legacy_probe_add(ide_port[r & 0x01], 14 + (r & 0x01), QDI6500, port)... | [
1,
0
] |
Linux Kernel | drivers/ata/pata_legacy.c | static __init int legacy_init(void) {
int i;
int ct = 0;
int primary = 0;
int secondary = 0;
int pci_present = 0;
struct legacy_probe *pl = &probe_list[0];
int slot = 0;
struct pci_dev *p = NULL;
for_each_pci_dev(p) {
int r;
for (r = 0; r < 6; r++) {
if (pci_resource_start(p, r) == 0x... | [
1,
0
] |
Linux Kernel | drivers/ata/pata_macio.c | static void pata_macio_default_timings(struct pata_macio_priv *priv) {
unsigned int value, value2 = 0;
switch (priv->kind) {
case controller_sh_ata6:
value = 0x0a820c97;
value2 = 0x00033031;
break;
case controller_un_ata6:
case controller_k2_ata6:
value = 0x08618a92;
value2 = 0x00002921;
... | [
1,
0
] |
Linux Kernel | drivers/ata/pata_macio.c | static u8 pata_macio_bmdma_status(struct ata_port *ap) {
struct pata_macio_priv *priv = ap->private_data;
struct dbdma_regs __iomem *dma_regs = ap->ioaddr.bmdma_addr;
u32 dstat, rstat = ATA_DMA_INTR;
unsigned long timeout = 0;
dstat = readl(&dma_regs->status);
dev_dbgdma(priv->dev, "%s: dstat=%x\n", __fun... | [
1,
0
] |
Linux Kernel | drivers/ata/pata_macio.c | static int pata_macio_slave_config(struct scsi_device *sdev) {
struct ata_port *ap = ata_shost_to_port(sdev->host);
struct pata_macio_priv *priv = ap->private_data;
struct ata_device *dev;
u16 cmd;
int rc;
rc = ata_scsi_slave_config(sdev);
if (rc)
return rc;
/* This is lifted from sata_nv */
dev... | [
1,
1
] |
Linux Kernel | drivers/ata/pata_macio.c | static void pmac_macio_calc_timing_masks(struct pata_macio_priv *priv,
struct ata_port_info *pinfo) {
int i = 0;
pinfo->pio_mask = 0;
pinfo->mwdma_mask = 0;
pinfo->udma_mask = 0;
while (priv->timings[i].mode > 0) {
unsigned int mask = 1U << (priv->timings[i].mode... | [
1,
0
] |
Linux Kernel | drivers/ata/pata_macio.c | static int pata_macio_suspend(struct macio_dev *mdev, pm_message_t mesg) {
struct ata_host *host = macio_get_drvdata(mdev);
return pata_macio_do_suspend(host->private_data, mesg);
} | [
0,
0
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.