Projectname large_stringclasses 15
values | Filepath large_stringlengths 4 106 ⌀ | Function large_stringlengths 11 3.45k | Label list |
|---|---|---|---|
Linux Kernel | drivers/ata/libata-eh.c | static inline int ata_eh_worth_retry(struct ata_queued_cmd *qc) {
if (qc->err_mask & AC_ERR_MEDIA)
return 0;
if (qc->flags & ATA_QCFLAG_IO)
return 1; /* otherwise retry anything from fs stack */
if (qc->err_mask & AC_ERR_INVALID)
return 0; /* don't retry these */
return qc->er... | [
0,
0
] |
Linux Kernel | drivers/ata/libata-eh.c | static int atapi_eh_clear_ua(struct ata_device *dev) {
int i;
for (i = 0; i < ATA_EH_UA_TRIES; i++) {
u8 *sense_buffer = dev->link->ap->sector_buf;
u8 sense_key = 0;
unsigned int err_mask;
err_mask = atapi_eh_tur(dev, &sense_key);
if (err_mask != 0 && err_mask != AC_ERR_DEV) {
ata_dev_wa... | [
1,
0
] |
Linux Kernel | drivers/ata/libata-eh.c | static int ata_eh_maybe_retry_flush(struct ata_device *dev) {
struct ata_link *link = dev->link;
struct ata_port *ap = link->ap;
struct ata_queued_cmd *qc;
struct ata_taskfile tf;
unsigned int err_mask;
int rc = 0;
if (!ata_tag_valid(link->active_tag))
return 0;
qc = __ata_qc_from_tag(ap, link->ac... | [
1,
0
] |
Linux Kernel | drivers/ata/libata-eh.c | static int ata_eh_schedule_probe(struct ata_device *dev) {
struct ata_eh_context *ehc = &dev->link->eh_context;
struct ata_link *link = ata_dev_phys_link(dev);
int trials = 0;
if (!(ehc->i.probe_mask & (1 << dev->devno)) ||
(ehc->did_probe_mask & (1 << dev->devno)))
return 0;
ata_eh_detach_dev(dev... | [
0,
0
] |
Linux Kernel | drivers/ata/libata-eh.c | static int ata_eh_handle_dev_fail(struct ata_device *dev, int err) {
struct ata_eh_context *ehc = &dev->link->eh_context;
if (err != -EAGAIN)
ehc->tries[dev->devno]--;
switch (err) {
case -ENODEV:
/* device missing or wrong IDENTIFY data, schedule probing */
ehc->i.probe_mask |= (1 << dev->devno);... | [
1,
0
] |
Linux Kernel | drivers/ata/libata-eh.c | void ata_eh_finish(struct ata_port *ap) {
struct ata_queued_cmd *qc;
int tag;
ata_qc_for_each_raw(ap, qc, tag) {
if (!(qc->flags & ATA_QCFLAG_FAILED))
continue;
if (qc->err_mask) {
/* FIXME: Once EH migration is complete,
* generate sense data in this function,
* considering bo... | [
1,
1
] |
Linux Kernel | drivers/ata/libata-eh.c | void ata_do_eh(struct ata_port *ap, ata_prereset_fn_t prereset,
ata_reset_fn_t softreset, ata_reset_fn_t hardreset,
ata_postreset_fn_t postreset) {
struct ata_device *dev;
int rc;
ata_eh_autopsy(ap);
ata_eh_report(ap);
rc = ata_eh_recover(ap, prereset, softreset, hardreset, pos... | [
0,
0
] |
Linux Kernel | drivers/ata/libata-eh.c | static void ata_eh_handle_port_suspend(struct ata_port *ap) {
unsigned long flags;
int rc = 0;
struct ata_device *dev;
spin_lock_irqsave(ap->lock, flags);
if (!(ap->pflags & ATA_PFLAG_PM_PENDING) ||
ap->pm_mesg.event & PM_EVENT_RESUME) {
spin_unlock_irqrestore(ap->lock, flags);
return;
}
sp... | [
0,
0
] |
Linux Kernel | drivers/ata/libata-pata-timings.c |
static void ata_timing_quantize(const struct ata_timing *t,
struct ata_timing *q, int T, int UT) {
q->setup = EZ(t->setup, T);
q->act8b = EZ(t->act8b, T);
q->rec8b = EZ(t->rec8b, T);
q->cyc8b = EZ(t->cyc8b, T);
q->active = EZ(t->active, T);
q->recover = EZ(t->recover, T);
... | [
0,
0
] |
Linux Kernel | drivers/ata/libata-pmp.c | static int sata_pmp_read_gscr(struct ata_device *dev, u32 *gscr) {
static const int gscr_to_read[] = {0, 1, 2, 32, 33, 64, 96};
int i;
for (i = 0; i < ARRAY_SIZE(gscr_to_read); i++) {
int reg = gscr_to_read[i];
unsigned int err_mask;
err_mask = sata_pmp_read(dev->link, reg, &gscr[reg]);
if (err_... | [
0,
0
] |
Linux Kernel | drivers/ata/libata-pmp.c | static int sata_pmp_same_pmp(struct ata_device *dev, const u32 *new_gscr) {
const u32 *old_gscr = dev->gscr;
u16 old_vendor, new_vendor, old_devid, new_devid;
int old_nr_ports, new_nr_ports;
old_vendor = sata_pmp_gscr_vendor(old_gscr);
new_vendor = sata_pmp_gscr_vendor(new_gscr);
old_devid = sata_pmp_gscr_... | [
1,
0
] |
Linux Kernel | drivers/ata/libata-sata.c | int sata_link_debounce(struct ata_link *link, const unsigned long *params,
unsigned long deadline) {
unsigned long interval = params[0];
unsigned long duration = params[1];
unsigned long last_jiffies, t;
u32 last, cur;
int rc;
t = ata_deadline(jiffies, params[2]);
if (time_before(t... | [
1,
0
] |
Linux Kernel | drivers/ata/libata-sata.c | int sata_link_resume(struct ata_link *link, const unsigned long *params,
unsigned long deadline) {
int tries = ATA_LINK_RESUME_TRIES;
u32 scontrol, serror;
int rc;
if ((rc = sata_scr_read(link, SCR_CONTROL, &scontrol)))
return rc;
do {
scontrol = (scontrol & 0x0f0) | 0x300;
... | [
1,
0
] |
Linux Kernel | drivers/ata/libata-sata.c | static int __sata_set_spd_needed(struct ata_link *link, u32 *scontrol) {
struct ata_link *host_link = &link->ap->link;
u32 limit, target, spd;
limit = link->sata_spd_limit;
if (!ata_is_host_link(link) && host_link->sata_spd)
limit &= (1 << host_link->sata_spd) - 1;
if (limit == UINT_MAX)
target = 0... | [
1,
0
] |
Linux Kernel | drivers/ata/libata-sata.c | int ata_qc_complete_multiple(struct ata_port *ap, u64 qc_active) {
u64 done_mask, ap_qc_active = ap->qc_active;
int nr_done = 0;
if (ap_qc_active & (1ULL << ATA_TAG_INTERNAL)) {
qc_active |= (qc_active & 0x01) << ATA_TAG_INTERNAL;
qc_active ^= qc_active & 0x01;
}
done_mask = ap_qc_active ^ qc_active... | [
1,
0
] |
Linux Kernel | drivers/ata/libata-sata.c |
static ssize_t ata_ncq_prio_supported_show(struct device *device,
struct device_attribute *attr,
char *buf) {
struct scsi_device *sdev = to_scsi_device(device);
struct ata_port *ap = ata_shost_to_port(sdev->host);
struct ata_de... | [
0,
0
] |
Linux Kernel | drivers/ata/libata-sata.c |
static ssize_t ata_ncq_prio_enable_show(struct device *device,
struct device_attribute *attr,
char *buf) {
struct scsi_device *sdev = to_scsi_device(device);
struct ata_port *ap = ata_shost_to_port(sdev->host);
struct ata_device *dev... | [
0,
0
] |
Linux Kernel | drivers/ata/libata-sata.c |
static ssize_t ata_ncq_prio_enable_store(struct device *device,
struct device_attribute *attr,
const char *buf, size_t len) {
struct scsi_device *sdev = to_scsi_device(device);
struct ata_port *ap;
struct ata_device *dev;
long in... | [
0,
0
] |
Linux Kernel | drivers/ata/libata-sata.c |
static ssize_t ata_scsi_em_message_show(struct device *dev,
struct device_attribute *attr,
char *buf) {
struct Scsi_Host *shost = class_to_shost(dev);
struct ata_port *ap = ata_shost_to_port(shost);
if (ap->ops->em_show && (ap->flag... | [
1,
0
] |
Linux Kernel | drivers/ata/libata-sata.c | struct ata_port *ata_sas_port_alloc(struct ata_host *host,
struct ata_port_info *port_info,
struct Scsi_Host *shost) {
struct ata_port *ap;
ap = ata_port_alloc(host);
if (!ap)
return NULL;
ap->port_no = 0;
ap->lock = &host->lock;
... | [
0,
0
] |
Linux Kernel | drivers/ata/libata-sata.c | int ata_sas_port_init(struct ata_port *ap) {
int rc = ap->ops->port_start(ap);
if (rc)
return rc;
ap->print_id = atomic_inc_return(&ata_print_id);
return 0;
} | [
0,
0
] |
Linux Kernel | drivers/ata/libata-sata.c |
int ata_sas_tport_add(struct device *parent, struct ata_port *ap) {
return ata_tport_add(parent, ap);
} | [
0,
0
] |
Linux Kernel | drivers/ata/libata-sata.c | void ata_sas_port_destroy(struct ata_port *ap) {
if (ap->ops->port_stop)
ap->ops->port_stop(ap);
kfree(ap);
} | [
0,
0
] |
Linux Kernel | drivers/ata/libata-sata.c | static int ata_eh_read_log_10h(struct ata_device *dev, int *tag,
struct ata_taskfile *tf) {
u8 *buf = dev->link->ap->sector_buf;
unsigned int err_mask;
u8 csum;
int i;
err_mask = ata_read_log_page(dev, ATA_LOG_SATA_NCQ, 0, buf, 1);
if (err_mask)
return -EIO;
csum = 0;
... | [
1,
0
] |
Linux Kernel | drivers/ata/libata-scsi.c | int ata_std_bios_param(struct scsi_device *sdev, struct block_device *bdev,
sector_t capacity, int geom[]) {
geom[0] = 255;
geom[1] = 63;
sector_div(capacity, 255 * 63);
geom[2] = capacity;
return 0;
} | [
0,
1
] |
Linux Kernel | drivers/ata/libata-scsi.c | static int ata_get_identity(struct ata_port *ap, struct scsi_device *sdev,
void __user *arg) {
struct ata_device *dev = ata_scsi_find_dev(ap, sdev);
u16 __user *dst = arg;
char buf[40];
if (!dev)
return -ENOMSG;
if (copy_to_user(dst, dev->id, ATA_ID_WORDS * sizeof(u16)))
... | [
1,
0
] |
Linux Kernel | drivers/ata/libata-scsi.c | static struct ata_queued_cmd *ata_scsi_qc_new(struct ata_device *dev,
struct scsi_cmnd *cmd) {
struct ata_port *ap = dev->link->ap;
struct ata_queued_cmd *qc;
int tag;
if (unlikely(ata_port_is_frozen(ap)))
goto fail;
if (ap->flags & ATA_FLAG_SAS_HOST) {
... | [
1,
0
] |
Linux Kernel | drivers/ata/libata-scsi.c | bool ata_scsi_dma_need_drain(struct request *rq) {
struct scsi_cmnd *scmd = blk_mq_rq_to_pdu(rq);
return atapi_cmd_type(scmd->cmnd[0]) == ATAPI_MISC;
} | [
0,
0
] |
Linux Kernel | drivers/ata/libata-scsi.c | void ata_scsi_slave_destroy(struct scsi_device *sdev) {
struct ata_port *ap = ata_shost_to_port(sdev->host);
unsigned long flags;
struct ata_device *dev;
if (!ap->ops->error_handler)
return;
spin_lock_irqsave(ap->lock, flags);
dev = __ata_scsi_find_dev(ap, sdev);
if (dev && dev->sdev) {
dev->sd... | [
1,
0
] |
Linux Kernel | drivers/ata/libata-scsi.c | static void scsi_6_lba_len(const u8 *cdb, u64 *plba, u32 *plen) {
u64 lba = 0;
u32 len;
lba |= ((u64)(cdb[1] & 0x1f)) << 16;
lba |= ((u64)cdb[2]) << 8;
lba |= ((u64)cdb[3]);
len = cdb[4];
*plba = lba;
*plen = len;
} | [
0,
0
] |
Linux Kernel | drivers/ata/libata-scsi.c | static int ata_scsi_translate(struct ata_device *dev, struct scsi_cmnd *cmd,
ata_xlat_func_t xlat_func) {
struct ata_port *ap = dev->link->ap;
struct ata_queued_cmd *qc;
int rc;
qc = ata_scsi_qc_new(dev, cmd);
if (!qc)
goto err_mem;
if (cmd->sc_data_direction == DMA_FROM_... | [
1,
0
] |
Linux Kernel | drivers/ata/libata-scsi.c | static unsigned int ata_scsiop_inq_80(struct ata_scsi_args *args, u8 *rbuf) {
static const u8 hdr[] = {
0, 0x80, 0, ATA_ID_SERNO_LEN, /* page len */
};
memcpy(rbuf, hdr, sizeof(hdr));
ata_id_string(args->id, (unsigned char *)&rbuf[4], ATA_ID_SERNO,
ATA_ID_SERNO_LEN);
return 0;
} | [
1,
0
] |
Linux Kernel | drivers/ata/libata-scsi.c | static unsigned int ata_scsiop_inq_b2(struct ata_scsi_args *args, u8 *rbuf) {
rbuf[1] = 0xb2;
rbuf[3] = 0x4;
rbuf[5] = 1 << 6; /* TPWS */
return 0;
} | [
1,
0
] |
Linux Kernel | drivers/ata/libata-scsi.c | static unsigned int ata_scsiop_inq_b9(struct ata_scsi_args *args, u8 *rbuf) {
struct ata_cpr_log *cpr_log = args->dev->cpr_log;
u8 *desc = &rbuf[64];
int i;
rbuf[1] = 0xb9;
put_unaligned_be16(64 + (int)cpr_log->nr_cpr * 32 - 4, &rbuf[2]);
for (i = 0; i < cpr_log->nr_cpr; i++, desc += 32) {
desc[0] = c... | [
1,
0
] |
Linux Kernel | drivers/ata/libata-scsi.c | static unsigned int ata_msense_control(struct ata_device *dev, u8 *buf,
bool changeable) {
modecpy(buf, def_control_mpage, sizeof(def_control_mpage), changeable);
if (changeable) {
buf[2] |= (1 << 2);
} else {
bool d_sense = (dev->flags & ATA_DFLAG_D_SENSE);
buf... | [
1,
0
] |
Linux Kernel | drivers/ata/libata-scsi.c | static unsigned int ata_msense_rw_recovery(u8 *buf, bool changeable) {
modecpy(buf, def_rw_recovery_mpage, sizeof(def_rw_recovery_mpage),
changeable);
return sizeof(def_rw_recovery_mpage);
} | [
1,
0
] |
Linux Kernel | drivers/ata/libata-scsi.c | static int ata_dev_supports_fua(u16 *id) {
unsigned char model[ATA_ID_PROD_LEN + 1], fw[ATA_ID_FW_REV_LEN + 1];
if (!libata_fua)
return 0;
if (!ata_id_has_fua(id))
return 0;
ata_id_c_string(id, model, ATA_ID_PROD, sizeof(model));
ata_id_c_string(id, fw, ATA_ID_FW_REV, sizeof(fw));
if (strcmp(mode... | [
1,
0
] |
Linux Kernel | drivers/ata/libata-scsi.c | static unsigned int ata_scsiop_report_luns(struct ata_scsi_args *args,
u8 *rbuf) {
rbuf[3] = 8;
return 0;
} | [
0,
0
] |
Linux Kernel | drivers/ata/libata-scsi.c | static void atapi_sense_complete(struct ata_queued_cmd *qc) {
if (qc->err_mask && ((qc->err_mask & AC_ERR_DEV) == 0)) {
/* FIXME: not quite right; we don't want the
* translation of taskfile registers into
* a sense descriptors, since that's only
* correct for ATA, not ATAPI
*/
ata_gen_pas... | [
1,
1
] |
Linux Kernel | drivers/ata/libata-scsi.c | static void atapi_request_sense(struct ata_queued_cmd *qc) {
struct ata_port *ap = qc->ap;
struct scsi_cmnd *cmd = qc->scsicmd;
memset(cmd->sense_buffer, 0, SCSI_SENSE_BUFFERSIZE);
#ifdef CONFIG_ATA_SFF
if (ap->ops->sff_tf_read)
ap->ops->sff_tf_read(ap, &qc->tf);
#endif
cmd->sense_buffer[0] = 0x70;
c... | [
1,
0
] |
Linux Kernel | drivers/ata/libata-scsi.c | struct ata_device *ata_scsi_find_dev(struct ata_port *ap,
const struct scsi_device *scsidev) {
struct ata_device *dev = __ata_scsi_find_dev(ap, scsidev);
if (unlikely(!dev || !ata_dev_enabled(dev)))
return NULL;
return dev;
} | [
0,
0
] |
Linux Kernel | drivers/ata/libata-scsi.c | static u8 ata_scsi_map_proto(u8 byte1) {
switch ((byte1 & 0x1e) >> 1) {
case 3:
return ATA_PROT_NODATA;
case 6: /* DMA */
case 10: /* UDMA Data-in */
case 11: /* UDMA Data-Out */
return ATA_PROT_DMA;
case 4: /* PIO Data-in */
case 5: /* PIO Data-out */
return ATA_PROT_PIO;
case 12: /* FP... | [
0,
0
] |
Linux Kernel | drivers/ata/libata-scsi.c | static int ata_mselect_control(struct ata_queued_cmd *qc, const u8 *buf,
int len, u16 *fp) {
struct ata_device *dev = qc->dev;
u8 mpage[CONTROL_MPAGE_LEN];
u8 d_sense;
int i;
if (len != CONTROL_MPAGE_LEN - 2) {
*fp = min(len, CONTROL_MPAGE_LEN - 2);
return -EINVAL;
}
... | [
1,
0
] |
Linux Kernel | drivers/ata/libata-scsi.c | int ata_scsi_queuecmd(struct Scsi_Host *shost, struct scsi_cmnd *cmd) {
struct ata_port *ap;
struct ata_device *dev;
struct scsi_device *scsidev = cmd->device;
int rc = 0;
unsigned long irq_flags;
ap = ata_shost_to_port(shost);
spin_lock_irqsave(ap->lock, irq_flags);
dev = ata_scsi_find_dev(ap, scsid... | [
0,
0
] |
Linux Kernel | drivers/ata/libata-scsi.c | static void ata_scsi_assign_ofnode(struct ata_device *dev,
struct ata_port *ap) {
struct scsi_device *sdev = dev->sdev;
struct device *d = ap->host->dev;
struct device_node *np = d->of_node;
struct device_node *child;
for_each_available_child_of_node(np, child) {
int re... | [
1,
0
] |
Linux Kernel | drivers/ata/libata-scsi.c | int ata_scsi_offline_dev(struct ata_device *dev) {
if (dev->sdev) {
scsi_device_set_state(dev->sdev, SDEV_OFFLINE);
return 1;
}
return 0;
} | [
0,
0
] |
Linux Kernel | drivers/ata/libata-scsi.c |
static void ata_scsi_handle_link_detach(struct ata_link *link) {
struct ata_port *ap = link->ap;
struct ata_device *dev;
ata_for_each_dev(dev, link, ALL) {
unsigned long flags;
if (!(dev->flags & ATA_DFLAG_DETACHED))
continue;
spin_lock_irqsave(ap->lock, flags);
dev->flags &= ~ATA_DFLAG_... | [
0,
0
] |
Linux Kernel | drivers/ata/libata-sff.c | int ata_sff_wait_ready(struct ata_link *link, unsigned long deadline) {
return ata_wait_ready(link, deadline, ata_sff_check_ready);
} | [
0,
0
] |
Linux Kernel | drivers/ata/libata-sff.c | static inline void ata_tf_to_host(struct ata_port *ap,
const struct ata_taskfile *tf,
unsigned int tag) {
trace_ata_tf_load(ap, tf);
ap->ops->sff_tf_load(ap, tf);
trace_ata_exec_command(ap, tf, tag);
ap->ops->sff_exec_command(ap, tf);
} | [
0,
0
] |
Linux Kernel | drivers/ata/libata-sff.c | static void ata_pio_sector(struct ata_queued_cmd *qc) {
struct ata_port *ap = qc->ap;
struct page *page;
unsigned int offset;
if (!qc->cursg) {
qc->curbytes = qc->nbytes;
return;
}
if (qc->curbytes == qc->nbytes - qc->sect_size)
ap->hsm_task_state = HSM_ST_LAST;
page = sg_page(qc->cursg);
... | [
1,
0
] |
Linux Kernel | drivers/ata/libata-sff.c | static void ata_pio_sectors(struct ata_queued_cmd *qc) {
if (is_multi_taskfile(&qc->tf)) {
unsigned int nsect;
WARN_ON_ONCE(qc->dev->multi_count == 0);
nsect =
min((qc->nbytes - qc->curbytes) / qc->sect_size, qc->dev->multi_count);
while (nsect--)
ata_pio_sector(qc);
} else
ata_... | [
1,
0
] |
Linux Kernel | drivers/ata/libata-sff.c | static void atapi_send_cdb(struct ata_port *ap, struct ata_queued_cmd *qc) {
trace_atapi_send_cdb(qc, 0, qc->dev->cdb_len);
WARN_ON_ONCE(qc->dev->cdb_len < 12);
ap->ops->sff_data_xfer(qc, qc->cdb, qc->dev->cdb_len, 1);
ata_sff_sync(ap);
/* FIXME: If the CDB is for DMA do we need to do the transition delay
... | [
1,
1
] |
Linux Kernel | drivers/ata/libata-sff.c | static void ata_hsm_qc_complete(struct ata_queued_cmd *qc, int in_wq) {
struct ata_port *ap = qc->ap;
if (ap->ops->error_handler) {
if (in_wq) {
qc = ata_qc_from_tag(ap, qc->tag);
if (qc) {
if (likely(!(qc->err_mask & AC_ERR_HSM))) {
ata_sff_irq_on(ap);
ata_qc_complete(... | [
0,
0
] |
Linux Kernel | drivers/ata/libata-sff.c |
void ata_sff_queue_work(struct work_struct *work) {
queue_work(ata_sff_wq, work);
} | [
0,
0
] |
Linux Kernel | drivers/ata/libata-sff.c | void ata_sff_queue_pio_task(struct ata_link *link, unsigned long delay) {
struct ata_port *ap = link->ap;
WARN_ON((ap->sff_pio_task_link != NULL) && (ap->sff_pio_task_link != link));
ap->sff_pio_task_link = link;
ata_sff_queue_delayed_work(&ap->sff_pio_task, msecs_to_jiffies(delay));
} | [
0,
0
] |
Linux Kernel | drivers/ata/libata-sff.c | void ata_sff_flush_pio_task(struct ata_port *ap) {
trace_ata_sff_flush_pio_task(ap);
cancel_delayed_work_sync(&ap->sff_pio_task);
spin_lock_irq(ap->lock);
ap->hsm_task_state = HSM_ST_IDLE;
spin_unlock_irq(ap->lock);
ap->sff_pio_task_link = NULL;
} | [
0,
0
] |
Linux Kernel | drivers/ata/libata-sff.c | void ata_sff_freeze(struct ata_port *ap) {
ap->ctl |= ATA_NIEN;
ap->last_ctl = ap->ctl;
ata_sff_set_devctl(ap, ap->ctl);
ap->ops->sff_check_status(ap);
if (ap->ops->sff_irq_clear)
ap->ops->sff_irq_clear(ap);
} | [
0,
0
] |
Linux Kernel | drivers/ata/libata-sff.c | int ata_sff_prereset(struct ata_link *link, unsigned long deadline) {
struct ata_eh_context *ehc = &link->eh_context;
int rc;
ata_std_prereset(link, deadline);
/* if we're about to do hardreset, nothing more to do */
if (ehc->i.action & ATA_EH_HARDRESET)
return 0;
/* wait for !BSY if we don't know th... | [
1,
0
] |
Linux Kernel | drivers/ata/libata-sff.c | void ata_sff_drain_fifo(struct ata_queued_cmd *qc) {
int count;
struct ata_port *ap;
if (qc == NULL || qc->dma_dir == DMA_TO_DEVICE)
return;
ap = qc->ap;
/* Drain up to 64K of data before we give up this recovery method */
for (count = 0; (ap->ops->sff_check_status(ap) & ATA_DRQ) && count < 65536;
... | [
1,
0
] |
Linux Kernel | drivers/ata/libata-sff.c | static bool ata_resources_present(struct pci_dev *pdev, int port) {
int i;
port *= 2;
for (i = 0; i < 2; i++) {
if (pci_resource_start(pdev, port + i) == 0 ||
pci_resource_len(pdev, port + i) == 0)
return false;
}
return true;
} | [
0,
0
] |
Linux Kernel | drivers/ata/libata-sff.c | static int ata_pci_init_one(struct pci_dev *pdev,
const struct ata_port_info *const *ppi,
struct scsi_host_template *sht, void *host_priv,
int hflags, bool bmdma) {
struct device *dev = &pdev->dev;
const struct ata_port_info *pi;
... | [
0,
0
] |
Linux Kernel | drivers/ata/libata-sff.c | static void ata_bmdma_fill_sg_dumb(struct ata_queued_cmd *qc) {
struct ata_port *ap = qc->ap;
struct ata_bmdma_prd *prd = ap->bmdma_prd;
struct scatterlist *sg;
unsigned int si, pi;
pi = 0;
for_each_sg(qc->sg, sg, qc->n_elem, si) {
u32 addr, offset;
u32 sg_len, len, blen;
addr = (u32)sg_dma_ad... | [
1,
0
] |
Linux Kernel | drivers/ata/libata-sff.c | enum ata_completion_errors ata_bmdma_qc_prep(struct ata_queued_cmd *qc) {
if (!(qc->flags & ATA_QCFLAG_DMAMAP))
return AC_ERR_OK;
ata_bmdma_fill_sg(qc);
return AC_ERR_OK;
} | [
0,
0
] |
Linux Kernel | drivers/ata/libata-sff.c | enum ata_completion_errors ata_bmdma_dumb_qc_prep(struct ata_queued_cmd *qc) {
if (!(qc->flags & ATA_QCFLAG_DMAMAP))
return AC_ERR_OK;
ata_bmdma_fill_sg_dumb(qc);
return AC_ERR_OK;
} | [
0,
0
] |
Linux Kernel | drivers/ata/libata-sff.c | unsigned int ata_bmdma_port_intr(struct ata_port *ap,
struct ata_queued_cmd *qc) {
struct ata_eh_info *ehi = &ap->link.eh_info;
u8 host_stat = 0;
bool bmdma_stopped = false;
unsigned int handled;
if (ap->hsm_task_state == HSM_ST_LAST && ata_is_dma(qc->tf.protocol)) {
hos... | [
0,
0
] |
Linux Kernel | drivers/ata/libata-sff.c | irqreturn_t ata_bmdma_interrupt(int irq, void *dev_instance) {
return __ata_sff_interrupt(irq, dev_instance, ata_bmdma_port_intr);
} | [
0,
0
] |
Linux Kernel | drivers/ata/libata-sff.c | void ata_bmdma_start(struct ata_queued_cmd *qc) {
struct ata_port *ap = qc->ap;
u8 dmactl;
dmactl = ioread8(ap->ioaddr.bmdma_addr + ATA_DMA_CMD);
iowrite8(dmactl | ATA_DMA_START, ap->ioaddr.bmdma_addr + ATA_DMA_CMD);
/* Strictly, one may wish to issue an ioread8() here, to
* flush the mmio write. Howeve... | [
0,
1
] |
Linux Kernel | drivers/ata/libata-sff.c | void ata_bmdma_stop(struct ata_queued_cmd *qc) {
struct ata_port *ap = qc->ap;
void __iomem *mmio = ap->ioaddr.bmdma_addr;
iowrite8(ioread8(mmio + ATA_DMA_CMD) & ~ATA_DMA_START, mmio + ATA_DMA_CMD);
/* one-PIO-cycle guaranteed wait, per spec, for HDMA1:0 transition */
ata_sff_dma_pause(ap);
} | [
0,
0
] |
Linux Kernel | drivers/ata/libata-sff.c | u8 ata_bmdma_status(struct ata_port *ap) {
return ioread8(ap->ioaddr.bmdma_addr + ATA_DMA_STATUS);
} | [
0,
0
] |
Linux Kernel | drivers/ata/libata-sff.c | int ata_pci_bmdma_clear_simplex(struct pci_dev *pdev) {
unsigned long bmdma = pci_resource_start(pdev, 4);
u8 simplex;
if (bmdma == 0)
return -ENOENT;
simplex = inb(bmdma + 0x02);
outb(simplex & 0x60, bmdma + 0x02);
simplex = inb(bmdma + 0x02);
if (simplex & 0x80)
return -EOPNOTSUPP;
return 0;... | [
1,
0
] |
Linux Kernel | drivers/ata/libata-sff.c |
int __init ata_sff_init(void) {
ata_sff_wq = alloc_workqueue("ata_sff", WQ_MEM_RECLAIM, WQ_MAX_ACTIVE);
if (!ata_sff_wq)
return -ENOMEM;
return 0;
} | [
0,
0
] |
Linux Kernel | drivers/ata/libata-trace.c |
const char *libata_trace_parse_eh_err_mask(struct trace_seq *p,
unsigned int eh_err_mask) {
const char *ret = trace_seq_buffer_ptr(p);
trace_seq_printf(p, "%x", eh_err_mask);
if (eh_err_mask) {
trace_seq_printf(p, "{ ");
if (eh_err_mask & AC_ERR_DEV)
trac... | [
0,
0
] |
Linux Kernel | drivers/ata/libata-trace.c |
const char *libata_trace_parse_qc_flags(struct trace_seq *p,
unsigned int qc_flags) {
const char *ret = trace_seq_buffer_ptr(p);
trace_seq_printf(p, "%x", qc_flags);
if (qc_flags) {
trace_seq_printf(p, "{ ");
if (qc_flags & ATA_QCFLAG_ACTIVE)
trace_seq_print... | [
0,
0
] |
Linux Kernel | drivers/ata/libata-transport.c |
static void ata_tport_release(struct device *dev) {
struct ata_port *ap = tdev_to_port(dev);
ata_host_put(ap->host);
} | [
0,
0
] |
Linux Kernel | drivers/ata/libata-transport.c | static int ata_is_port(const struct device *dev) {
return dev->release == ata_tport_release;
} | [
0,
0
] |
Linux Kernel | drivers/ata/libata-transport.c |
static int ata_tport_match(struct attribute_container *cont,
struct device *dev) {
if (!ata_is_port(dev))
return 0;
return &ata_scsi_transport_template->host_attrs.ac == cont;
} | [
0,
0
] |
Linux Kernel | drivers/ata/libata-transport.c | unsigned int ata_port_classify(struct ata_port *ap,
const struct ata_taskfile *tf) {
int i;
unsigned int class = ata_dev_classify(tf);
for (i = 1; i < ARRAY_SIZE(ata_class_names); i++) {
if (ata_class_names[i].value == class) {
ata_port_dbg(ap, "found %s device by sig\n",... | [
1,
0
] |
Linux Kernel | drivers/ata/libata-transport.c | static int noop(int x) { return x; }
#define ata_link_show_linkspeed(field, format) \
static ssize_t show_ata_link_##field( \
struct device *dev, struct device_attribute *attr, char *buf) { \
struct ata_link *link = transport_c... | [
1,
0
] |
Linux Kernel | drivers/ata/libata-transport.c | static int ata_is_link(const struct device *dev) {
return dev->release == ata_tlink_release;
} | [
0,
0
] |
Linux Kernel | drivers/ata/libata-transport.c |
static int ata_tlink_match(struct attribute_container *cont,
struct device *dev) {
struct ata_internal *i = to_ata_internal(ata_scsi_transport_template);
if (!ata_is_link(dev))
return 0;
return &i->link_attr_cont.ac == cont;
} | [
0,
0
] |
Linux Kernel | drivers/ata/libata-transport.c | int ata_tlink_add(struct ata_link *link) {
struct device *dev = &link->tdev;
struct ata_port *ap = link->ap;
struct ata_device *ata_dev;
int error;
device_initialize(dev);
dev->parent = &ap->tdev;
dev->release = ata_tlink_release;
if (ata_is_host_link(link))
dev_set_name(dev, "link%d", ap->print_id... | [
1,
0
] |
Linux Kernel | drivers/ata/libata-transport.c | static int ata_is_ata_dev(const struct device *dev) {
return dev->release == ata_tdev_release;
} | [
0,
0
] |
Linux Kernel | drivers/ata/libata-transport.c | static int ata_tdev_add(struct ata_device *ata_dev) {
struct device *dev = &ata_dev->tdev;
struct ata_link *link = ata_dev->link;
struct ata_port *ap = link->ap;
int error;
device_initialize(dev);
dev->parent = &link->tdev;
dev->release = ata_tdev_release;
if (ata_is_host_link(link))
dev_set_name(d... | [
1,
0
] |
Linux Kernel | drivers/ata/libata-transport.c | struct scsi_transport_template *ata_attach_transport(void) {
struct ata_internal *i;
int count;
i = kzalloc(sizeof(struct ata_internal), GFP_KERNEL);
if (!i)
return NULL;
i->t.eh_strategy_handler = ata_scsi_error;
i->t.user_scan = ata_scsi_user_scan;
i->t.host_attrs.ac.attrs = &i->port_attrs[0];
... | [
0,
0
] |
Linux Kernel | drivers/ata/libata-transport.c | void ata_release_transport(struct scsi_transport_template *t) {
struct ata_internal *i = to_ata_internal(t);
transport_container_unregister(&i->t.host_attrs);
transport_container_unregister(&i->link_attr_cont);
transport_container_unregister(&i->dev_attr_cont);
kfree(i);
} | [
0,
0
] |
Linux Kernel | drivers/ata/libata-transport.c |
void __exit libata_transport_exit(void) {
transport_class_unregister(&ata_link_class);
transport_class_unregister(&ata_port_class);
transport_class_unregister(&ata_dev_class);
} | [
0,
0
] |
Linux Kernel | drivers/ata/libata-zpodd.c | static int eject_tray(struct ata_device *dev) {
struct ata_taskfile tf;
static const char cdb[ATAPI_CDB_LEN] = {
GPCMD_START_STOP_UNIT, 0, 0, 0, 0x02, 0, 0, 0, 0, 0, 0, 0,
};
ata_tf_init(dev, &tf);
tf.flags = ATA_TFLAG_ISADDR | ATA_TFLAG_DEVICE;
tf.command = ATA_CMD_PACKET;
tf.protocol = ATAPI_PROT... | [
0,
0
] |
Linux Kernel | drivers/ata/libata-zpodd.c |
bool zpodd_zpready(struct ata_device *dev) {
struct zpodd *zpodd = dev->zpodd;
return zpodd->zp_ready;
} | [
0,
0
] |
Linux Kernel | drivers/ata/libata-zpodd.c | void zpodd_post_poweron(struct ata_device *dev) {
struct zpodd *zpodd = dev->zpodd;
if (!zpodd->powered_off)
return;
zpodd->powered_off = false;
if (zpodd->from_notify) {
zpodd->from_notify = false;
if (zpodd->mech_type == ODD_MECH_TYPE_DRAWER)
eject_tray(dev);
}
zpodd->zp_sampled = fa... | [
0,
0
] |
Linux Kernel | drivers/ata/libata-zpodd.c |
void zpodd_init(struct ata_device *dev) {
struct acpi_device *adev = ACPI_COMPANION(&dev->tdev);
enum odd_mech_type mech_type;
struct zpodd *zpodd;
if (dev->zpodd || !adev || !acpi_device_can_poweroff(adev))
return;
mech_type = zpodd_get_mech_type(dev);
if (mech_type == ODD_MECH_TYPE_UNSUPPORTED)
... | [
0,
0
] |
Linux Kernel | drivers/ata/libata.h | static inline int ata_acpi_on_devcfg(struct ata_device *dev) { return 0; } | [
0,
0
] |
Linux Kernel | drivers/ata/libata.h | static inline void ata_acpi_set_state(struct ata_port *ap, pm_message_t state) {
} | [
0,
0
] |
Linux Kernel | drivers/ata/libata.h | static inline void ata_acpi_bind_port(struct ata_port *ap) {} | [
0,
0
] |
Linux Kernel | drivers/ata/libata.h | static inline int sata_pmp_scr_read(struct ata_link *link, int reg, u32 *val) {
return -EINVAL;
} | [
0,
0
] |
Linux Kernel | drivers/ata/libata.h | static inline void ata_sff_port_init(struct ata_port *ap) {} | [
0,
0
] |
Linux Kernel | drivers/ata/libata.h | static inline void zpodd_init(struct ata_device *dev) {} | [
0,
0
] |
Linux Kernel | drivers/ata/libata.h | static inline bool zpodd_dev_enabled(struct ata_device *dev) { return false; } | [
0,
0
] |
Linux Kernel | drivers/ata/libata.h | static inline void zpodd_enable_run_wake(struct ata_device *dev) {} | [
0,
0
] |
Linux Kernel | drivers/ata/pata_acpi.c | static void pacpi_set_piomode(struct ata_port *ap, struct ata_device *adev) {
int unit = adev->devno;
struct pata_acpi *acpi = ap->private_data;
const struct ata_timing *t;
if (!(acpi->gtm.flags & 0x10))
unit = 0;
t = ata_timing_find_mode(adev->pio_mode);
acpi->gtm.drive[unit].pio = t->cycle;
ata_ac... | [
0,
0
] |
Linux Kernel | drivers/ata/pata_acpi.c | static int pacpi_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_MWDMA2,
.udma_mask = ATA_UDMA6,
.port_ops = &pacpi_ops,
};
co... | [
0,
0
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.