Searched refs:cd (Results 1 - 200 of 241) sorted by relevance

12

/linux-4.1.27/drivers/input/touchscreen/
H A Dcyttsp4_core.c80 static int cyttsp4_load_status_regs(struct cyttsp4 *cd) cyttsp4_load_status_regs() argument
82 struct cyttsp4_sysinfo *si = &cd->sysinfo; cyttsp4_load_status_regs()
83 struct device *dev = cd->dev; cyttsp4_load_status_regs()
86 rc = cyttsp4_adap_read(cd, CY_REG_BASE, si->si_ofs.mode_size, cyttsp4_load_status_regs()
92 cyttsp4_pr_buf(dev, cd->pr_buf, si->xy_mode, cyttsp4_load_status_regs()
98 static int cyttsp4_handshake(struct cyttsp4 *cd, u8 mode) cyttsp4_handshake() argument
110 rc = cyttsp4_adap_write(cd, CY_REG_BASE, sizeof(cmd), &cmd); cyttsp4_handshake()
112 dev_err(cd->dev, "%s: bus write fail on handshake (ret=%d)\n", cyttsp4_handshake()
118 static int cyttsp4_hw_soft_reset(struct cyttsp4 *cd) cyttsp4_hw_soft_reset() argument
121 int rc = cyttsp4_adap_write(cd, CY_REG_BASE, sizeof(cmd), &cmd); cyttsp4_hw_soft_reset()
123 dev_err(cd->dev, "%s: FAILED to execute SOFT reset\n", cyttsp4_hw_soft_reset()
130 static int cyttsp4_hw_hard_reset(struct cyttsp4 *cd) cyttsp4_hw_hard_reset() argument
132 if (cd->cpdata->xres) { cyttsp4_hw_hard_reset()
133 cd->cpdata->xres(cd->cpdata, cd->dev); cyttsp4_hw_hard_reset()
134 dev_dbg(cd->dev, "%s: execute HARD reset\n", __func__); cyttsp4_hw_hard_reset()
137 dev_err(cd->dev, "%s: FAILED to execute HARD reset\n", __func__); cyttsp4_hw_hard_reset()
141 static int cyttsp4_hw_reset(struct cyttsp4 *cd) cyttsp4_hw_reset() argument
143 int rc = cyttsp4_hw_hard_reset(cd); cyttsp4_hw_reset()
145 rc = cyttsp4_hw_soft_reset(cd); cyttsp4_hw_reset()
160 static int cyttsp4_si_data_offsets(struct cyttsp4 *cd) cyttsp4_si_data_offsets() argument
162 struct cyttsp4_sysinfo *si = &cd->sysinfo; cyttsp4_si_data_offsets()
163 int rc = cyttsp4_adap_read(cd, CY_REG_BASE, sizeof(si->si_data), cyttsp4_si_data_offsets()
166 dev_err(cd->dev, "%s: fail read sysinfo data offsets r=%d\n", cyttsp4_si_data_offsets()
172 cyttsp4_pr_buf(cd->dev, cd->pr_buf, (u8 *)&si->si_data, cyttsp4_si_data_offsets()
196 static int cyttsp4_si_get_cydata(struct cyttsp4 *cd) cyttsp4_si_get_cydata() argument
198 struct cyttsp4_sysinfo *si = &cd->sysinfo; cyttsp4_si_get_cydata()
205 dev_dbg(cd->dev, "%s: cydata size: %Zd\n", __func__, cyttsp4_si_get_cydata()
210 dev_err(cd->dev, "%s: fail alloc cydata memory\n", __func__); cyttsp4_si_get_cydata()
218 rc = cyttsp4_adap_read(cd, read_offset, cyttsp4_si_get_cydata()
223 dev_err(cd->dev, "%s: fail read cydata r=%d\n", cyttsp4_si_get_cydata()
232 dev_err(cd->dev, "%s: mismatch in MFGID size, reported:%d calculated:%d\n", cyttsp4_si_get_cydata()
241 rc = cyttsp4_adap_read(cd, read_offset, si->si_ptrs.cydata->mfgid_sz, cyttsp4_si_get_cydata()
244 dev_err(cd->dev, "%s: fail read cydata r=%d\n", cyttsp4_si_get_cydata()
252 rc = cyttsp4_adap_read(cd, read_offset, cyttsp4_si_get_cydata()
257 dev_err(cd->dev, "%s: fail read cydata r=%d\n", cyttsp4_si_get_cydata()
262 cyttsp4_pr_buf(cd->dev, cd->pr_buf, (u8 *)si->si_ptrs.cydata, cyttsp4_si_get_cydata()
267 static int cyttsp4_si_get_test_data(struct cyttsp4 *cd) cyttsp4_si_get_test_data() argument
269 struct cyttsp4_sysinfo *si = &cd->sysinfo; cyttsp4_si_get_test_data()
277 dev_err(cd->dev, "%s: fail alloc test memory\n", __func__); cyttsp4_si_get_test_data()
282 rc = cyttsp4_adap_read(cd, si->si_ofs.test_ofs, si->si_ofs.test_size, cyttsp4_si_get_test_data()
285 dev_err(cd->dev, "%s: fail read test data r=%d\n", cyttsp4_si_get_test_data()
290 cyttsp4_pr_buf(cd->dev, cd->pr_buf, cyttsp4_si_get_test_data()
295 dev_info(cd->dev, "%s: %s codel=%02X\n", cyttsp4_si_get_test_data()
301 dev_info(cd->dev, "%s: %s codel=%02X\n", __func__, cyttsp4_si_get_test_data()
307 dev_info(cd->dev, "%s: %s codel=%02X\n", cyttsp4_si_get_test_data()
311 dev_info(cd->dev, "%s: SCANNING is %s codel=%02X\n", cyttsp4_si_get_test_data()
318 static int cyttsp4_si_get_pcfg_data(struct cyttsp4 *cd) cyttsp4_si_get_pcfg_data() argument
320 struct cyttsp4_sysinfo *si = &cd->sysinfo; cyttsp4_si_get_pcfg_data()
329 dev_err(cd->dev, "%s: fail alloc pcfg memory r=%d\n", cyttsp4_si_get_pcfg_data()
335 rc = cyttsp4_adap_read(cd, si->si_ofs.pcfg_ofs, si->si_ofs.pcfg_size, cyttsp4_si_get_pcfg_data()
338 dev_err(cd->dev, "%s: fail read pcfg data r=%d\n", cyttsp4_si_get_pcfg_data()
354 cyttsp4_pr_buf(cd->dev, cd->pr_buf, cyttsp4_si_get_pcfg_data()
360 static int cyttsp4_si_get_opcfg_data(struct cyttsp4 *cd) cyttsp4_si_get_opcfg_data() argument
362 struct cyttsp4_sysinfo *si = &cd->sysinfo; cyttsp4_si_get_opcfg_data()
374 dev_err(cd->dev, "%s: fail alloc opcfg memory\n", __func__); cyttsp4_si_get_opcfg_data()
380 rc = cyttsp4_adap_read(cd, si->si_ofs.opcfg_ofs, si->si_ofs.opcfg_size, cyttsp4_si_get_opcfg_data()
383 dev_err(cd->dev, "%s: fail read opcfg data r=%d\n", cyttsp4_si_get_opcfg_data()
431 dev_dbg(cd->dev, "%s: tch_rec_%s\n", __func__, cyttsp4_si_get_opcfg_data()
433 dev_dbg(cd->dev, "%s: ofs =%2Zd\n", __func__, cyttsp4_si_get_opcfg_data()
435 dev_dbg(cd->dev, "%s: siz =%2Zd\n", __func__, cyttsp4_si_get_opcfg_data()
437 dev_dbg(cd->dev, "%s: max =%2Zd\n", __func__, cyttsp4_si_get_opcfg_data()
439 dev_dbg(cd->dev, "%s: bofs=%2Zd\n", __func__, cyttsp4_si_get_opcfg_data()
447 cyttsp4_pr_buf(cd->dev, cd->pr_buf, (u8 *)si->si_ptrs.opcfg, cyttsp4_si_get_opcfg_data()
454 static int cyttsp4_si_get_ddata(struct cyttsp4 *cd) cyttsp4_si_get_ddata() argument
456 struct cyttsp4_sysinfo *si = &cd->sysinfo; cyttsp4_si_get_ddata()
464 dev_err(cd->dev, "%s: fail alloc ddata memory\n", __func__); cyttsp4_si_get_ddata()
469 rc = cyttsp4_adap_read(cd, si->si_ofs.ddata_ofs, si->si_ofs.ddata_size, cyttsp4_si_get_ddata()
472 dev_err(cd->dev, "%s: fail read ddata data r=%d\n", cyttsp4_si_get_ddata()
475 cyttsp4_pr_buf(cd->dev, cd->pr_buf, cyttsp4_si_get_ddata()
481 static int cyttsp4_si_get_mdata(struct cyttsp4 *cd) cyttsp4_si_get_mdata() argument
483 struct cyttsp4_sysinfo *si = &cd->sysinfo; cyttsp4_si_get_mdata()
491 dev_err(cd->dev, "%s: fail alloc mdata memory\n", __func__); cyttsp4_si_get_mdata()
496 rc = cyttsp4_adap_read(cd, si->si_ofs.mdata_ofs, si->si_ofs.mdata_size, cyttsp4_si_get_mdata()
499 dev_err(cd->dev, "%s: fail read mdata data r=%d\n", cyttsp4_si_get_mdata()
502 cyttsp4_pr_buf(cd->dev, cd->pr_buf, cyttsp4_si_get_mdata()
508 static int cyttsp4_si_get_btn_data(struct cyttsp4 *cd) cyttsp4_si_get_btn_data() argument
510 struct cyttsp4_sysinfo *si = &cd->sysinfo; cyttsp4_si_get_btn_data()
524 dev_err(cd->dev, "%s: %s\n", __func__, cyttsp4_si_get_btn_data()
530 if (cd->cpdata->sett[CY_IC_GRPNUM_BTN_KEYS] == NULL) cyttsp4_si_get_btn_data()
532 else if (cd->cpdata->sett[CY_IC_GRPNUM_BTN_KEYS]->data == NULL) cyttsp4_si_get_btn_data()
535 num_defined_keys = cd->cpdata->sett cyttsp4_si_get_btn_data()
540 key_table = (u16 *)cd->cpdata->sett cyttsp4_si_get_btn_data()
561 static int cyttsp4_si_get_op_data_ptrs(struct cyttsp4 *cd) cyttsp4_si_get_op_data_ptrs() argument
563 struct cyttsp4_sysinfo *si = &cd->sysinfo; cyttsp4_si_get_op_data_ptrs()
586 static void cyttsp4_si_put_log_data(struct cyttsp4 *cd) cyttsp4_si_put_log_data() argument
588 struct cyttsp4_sysinfo *si = &cd->sysinfo; cyttsp4_si_put_log_data()
589 dev_dbg(cd->dev, "%s: cydata_ofs =%4Zd siz=%4Zd\n", __func__, cyttsp4_si_put_log_data()
591 dev_dbg(cd->dev, "%s: test_ofs =%4Zd siz=%4Zd\n", __func__, cyttsp4_si_put_log_data()
593 dev_dbg(cd->dev, "%s: pcfg_ofs =%4Zd siz=%4Zd\n", __func__, cyttsp4_si_put_log_data()
595 dev_dbg(cd->dev, "%s: opcfg_ofs =%4Zd siz=%4Zd\n", __func__, cyttsp4_si_put_log_data()
597 dev_dbg(cd->dev, "%s: ddata_ofs =%4Zd siz=%4Zd\n", __func__, cyttsp4_si_put_log_data()
599 dev_dbg(cd->dev, "%s: mdata_ofs =%4Zd siz=%4Zd\n", __func__, cyttsp4_si_put_log_data()
602 dev_dbg(cd->dev, "%s: cmd_ofs =%4Zd\n", __func__, cyttsp4_si_put_log_data()
604 dev_dbg(cd->dev, "%s: rep_ofs =%4Zd\n", __func__, cyttsp4_si_put_log_data()
606 dev_dbg(cd->dev, "%s: rep_sz =%4Zd\n", __func__, cyttsp4_si_put_log_data()
608 dev_dbg(cd->dev, "%s: num_btns =%4Zd\n", __func__, cyttsp4_si_put_log_data()
610 dev_dbg(cd->dev, "%s: num_btn_regs =%4Zd\n", __func__, cyttsp4_si_put_log_data()
612 dev_dbg(cd->dev, "%s: tt_stat_ofs =%4Zd\n", __func__, cyttsp4_si_put_log_data()
614 dev_dbg(cd->dev, "%s: tch_rec_size =%4Zd\n", __func__, cyttsp4_si_put_log_data()
616 dev_dbg(cd->dev, "%s: max_tchs =%4Zd\n", __func__, cyttsp4_si_put_log_data()
618 dev_dbg(cd->dev, "%s: mode_size =%4Zd\n", __func__, cyttsp4_si_put_log_data()
620 dev_dbg(cd->dev, "%s: data_size =%4Zd\n", __func__, cyttsp4_si_put_log_data()
622 dev_dbg(cd->dev, "%s: map_sz =%4Zd\n", __func__, cyttsp4_si_put_log_data()
625 dev_dbg(cd->dev, "%s: btn_rec_size =%2Zd\n", __func__, cyttsp4_si_put_log_data()
627 dev_dbg(cd->dev, "%s: btn_diff_ofs =%2Zd\n", __func__, cyttsp4_si_put_log_data()
629 dev_dbg(cd->dev, "%s: btn_diff_size =%2Zd\n", __func__, cyttsp4_si_put_log_data()
632 dev_dbg(cd->dev, "%s: max_x = 0x%04ZX (%Zd)\n", __func__, cyttsp4_si_put_log_data()
634 dev_dbg(cd->dev, "%s: x_origin = %Zd (%s)\n", __func__, cyttsp4_si_put_log_data()
638 dev_dbg(cd->dev, "%s: max_y = 0x%04ZX (%Zd)\n", __func__, cyttsp4_si_put_log_data()
640 dev_dbg(cd->dev, "%s: y_origin = %Zd (%s)\n", __func__, cyttsp4_si_put_log_data()
644 dev_dbg(cd->dev, "%s: max_p = 0x%04ZX (%Zd)\n", __func__, cyttsp4_si_put_log_data()
647 dev_dbg(cd->dev, "%s: xy_mode=%p xy_data=%p\n", __func__, cyttsp4_si_put_log_data()
651 static int cyttsp4_get_sysinfo_regs(struct cyttsp4 *cd) cyttsp4_get_sysinfo_regs() argument
653 struct cyttsp4_sysinfo *si = &cd->sysinfo; cyttsp4_get_sysinfo_regs()
656 rc = cyttsp4_si_data_offsets(cd); cyttsp4_get_sysinfo_regs()
660 rc = cyttsp4_si_get_cydata(cd); cyttsp4_get_sysinfo_regs()
664 rc = cyttsp4_si_get_test_data(cd); cyttsp4_get_sysinfo_regs()
668 rc = cyttsp4_si_get_pcfg_data(cd); cyttsp4_get_sysinfo_regs()
672 rc = cyttsp4_si_get_opcfg_data(cd); cyttsp4_get_sysinfo_regs()
676 rc = cyttsp4_si_get_ddata(cd); cyttsp4_get_sysinfo_regs()
680 rc = cyttsp4_si_get_mdata(cd); cyttsp4_get_sysinfo_regs()
684 rc = cyttsp4_si_get_btn_data(cd); cyttsp4_get_sysinfo_regs()
688 rc = cyttsp4_si_get_op_data_ptrs(cd); cyttsp4_get_sysinfo_regs()
690 dev_err(cd->dev, "%s: failed to get_op_data\n", cyttsp4_get_sysinfo_regs()
695 cyttsp4_si_put_log_data(cd); cyttsp4_get_sysinfo_regs()
698 rc = cyttsp4_handshake(cd, si->si_data.hst_mode); cyttsp4_get_sysinfo_regs()
700 dev_err(cd->dev, "%s: handshake fail on sysinfo reg\n", cyttsp4_get_sysinfo_regs()
707 static void cyttsp4_queue_startup_(struct cyttsp4 *cd) cyttsp4_queue_startup_() argument
709 if (cd->startup_state == STARTUP_NONE) { cyttsp4_queue_startup_()
710 cd->startup_state = STARTUP_QUEUED; cyttsp4_queue_startup_()
711 schedule_work(&cd->startup_work); cyttsp4_queue_startup_()
712 dev_dbg(cd->dev, "%s: cyttsp4_startup queued\n", __func__); cyttsp4_queue_startup_()
714 dev_dbg(cd->dev, "%s: startup_state = %d\n", __func__, cyttsp4_queue_startup_()
715 cd->startup_state); cyttsp4_queue_startup_()
939 static int cyttsp4_xy_worker(struct cyttsp4 *cd) cyttsp4_xy_worker() argument
941 struct cyttsp4_mt_data *md = &cd->md; cyttsp4_xy_worker()
981 rc = cyttsp4_adap_read(cd, si->si_ofs.tt_stat_ofs + 1, cyttsp4_xy_worker()
992 cyttsp4_pr_buf(dev, cd->pr_buf, si->xy_data, num_cur_tch * cyttsp4_xy_worker()
1025 static int cyttsp4_mt_attention(struct cyttsp4 *cd) cyttsp4_mt_attention() argument
1027 struct device *dev = cd->dev; cyttsp4_mt_attention()
1028 struct cyttsp4_mt_data *md = &cd->md; cyttsp4_mt_attention()
1037 rc = cyttsp4_xy_worker(cd); cyttsp4_mt_attention()
1051 struct cyttsp4 *cd = handle; cyttsp4_irq() local
1052 struct device *dev = cd->dev; cyttsp4_irq()
1054 u8 cmd_ofs = cd->sysinfo.si_ofs.cmd_ofs; cyttsp4_irq()
1063 if (atomic_read(&cd->ignore_irq)) { cyttsp4_irq()
1068 dev_dbg(dev, "%s int:0x%x\n", __func__, cd->int_status); cyttsp4_irq()
1070 mutex_lock(&cd->system_lock); cyttsp4_irq()
1073 if (cd->sleep_state == SS_SLEEP_ON || cd->sleep_state == SS_SLEEPING) cyttsp4_irq()
1076 rc = cyttsp4_adap_read(cd, CY_REG_BASE, sizeof(mode), mode); cyttsp4_irq()
1078 dev_err(cd->dev, "%s: Fail read adapter r=%d\n", __func__, rc); cyttsp4_irq()
1087 if (cd->mode == CY_MODE_BOOTLOADER) { cyttsp4_irq()
1089 wake_up(&cd->wait_q); cyttsp4_irq()
1095 __func__, cd->mode, cur_mode); cyttsp4_irq()
1098 if (cd->mode != CY_MODE_UNKNOWN) { cyttsp4_irq()
1100 cd->mode = CY_MODE_UNKNOWN; cyttsp4_irq()
1101 cyttsp4_queue_startup_(cd); cyttsp4_irq()
1110 cd->mode = cur_mode; cyttsp4_irq()
1136 if (cd->int_status & CY_INT_IGNORE) { cyttsp4_irq()
1142 if (cd->int_status & CY_INT_AWAKE) { cyttsp4_irq()
1143 cd->int_status &= ~CY_INT_AWAKE; cyttsp4_irq()
1144 wake_up(&cd->wait_q); cyttsp4_irq()
1150 if ((cd->int_status & CY_INT_MODE_CHANGE) cyttsp4_irq()
1152 cd->int_status &= ~CY_INT_MODE_CHANGE; cyttsp4_irq()
1154 __func__, cd->mode, cur_mode); cyttsp4_irq()
1155 cd->mode = cur_mode; cyttsp4_irq()
1156 wake_up(&cd->wait_q); cyttsp4_irq()
1161 dev_vdbg(dev, "%s: cd->mode=%d cur_mode=%d\n", cyttsp4_irq()
1162 __func__, cd->mode, cur_mode); cyttsp4_irq()
1163 if ((mode[0] & CY_HST_MODE_CHANGE) == 0 && cd->mode != cur_mode) { cyttsp4_irq()
1165 dev_err(dev, "%s %d->%d 0x%x\n", __func__, cd->mode, cyttsp4_irq()
1166 cur_mode, cd->int_status); cyttsp4_irq()
1169 cyttsp4_queue_startup_(cd); cyttsp4_irq()
1175 if ((cd->int_status & CY_INT_EXEC_CMD) cyttsp4_irq()
1177 cd->int_status &= ~CY_INT_EXEC_CMD; cyttsp4_irq()
1180 wake_up(&cd->wait_q); cyttsp4_irq()
1189 if (cd->mode == CY_MODE_OPERATIONAL) { cyttsp4_irq()
1191 rc = cyttsp4_load_status_regs(cd); cyttsp4_irq()
1197 cyttsp4_mt_attention(cd); cyttsp4_irq()
1203 rc = cyttsp4_handshake(cd, mode[0]); cyttsp4_irq()
1213 udelay(cd->cpdata->level_irq_udelay); cyttsp4_irq()
1216 mutex_unlock(&cd->system_lock); cyttsp4_irq()
1220 static void cyttsp4_start_wd_timer(struct cyttsp4 *cd) cyttsp4_start_wd_timer() argument
1225 mod_timer(&cd->watchdog_timer, jiffies + cyttsp4_start_wd_timer()
1229 static void cyttsp4_stop_wd_timer(struct cyttsp4 *cd) cyttsp4_stop_wd_timer() argument
1238 del_timer_sync(&cd->watchdog_timer); cyttsp4_stop_wd_timer()
1239 cancel_work_sync(&cd->watchdog_work); cyttsp4_stop_wd_timer()
1240 del_timer_sync(&cd->watchdog_timer); cyttsp4_stop_wd_timer()
1245 struct cyttsp4 *cd = (struct cyttsp4 *)handle; cyttsp4_watchdog_timer() local
1247 dev_vdbg(cd->dev, "%s: Watchdog timer triggered\n", __func__); cyttsp4_watchdog_timer()
1249 schedule_work(&cd->watchdog_work); cyttsp4_watchdog_timer()
1254 static int cyttsp4_request_exclusive(struct cyttsp4 *cd, void *ownptr, cyttsp4_request_exclusive() argument
1260 mutex_lock(&cd->system_lock); cyttsp4_request_exclusive()
1261 if (!cd->exclusive_dev && cd->exclusive_waits == 0) { cyttsp4_request_exclusive()
1262 cd->exclusive_dev = ownptr; cyttsp4_request_exclusive()
1266 cd->exclusive_waits++; cyttsp4_request_exclusive()
1268 mutex_unlock(&cd->system_lock); cyttsp4_request_exclusive()
1270 t = wait_event_timeout(cd->wait_q, !cd->exclusive_dev, t); cyttsp4_request_exclusive()
1272 dev_err(cd->dev, "%s: tmo waiting exclusive access\n", cyttsp4_request_exclusive()
1274 mutex_lock(&cd->system_lock); cyttsp4_request_exclusive()
1275 cd->exclusive_waits--; cyttsp4_request_exclusive()
1276 mutex_unlock(&cd->system_lock); cyttsp4_request_exclusive()
1280 wait_event(cd->wait_q, !cd->exclusive_dev); cyttsp4_request_exclusive()
1282 mutex_lock(&cd->system_lock); cyttsp4_request_exclusive()
1283 if (cd->exclusive_dev) cyttsp4_request_exclusive()
1285 cd->exclusive_dev = ownptr; cyttsp4_request_exclusive()
1286 cd->exclusive_waits--; cyttsp4_request_exclusive()
1288 mutex_unlock(&cd->system_lock); cyttsp4_request_exclusive()
1296 static int cyttsp4_release_exclusive(struct cyttsp4 *cd, void *ownptr) cyttsp4_release_exclusive() argument
1298 mutex_lock(&cd->system_lock); cyttsp4_release_exclusive()
1299 if (cd->exclusive_dev != ownptr) { cyttsp4_release_exclusive()
1300 mutex_unlock(&cd->system_lock); cyttsp4_release_exclusive()
1304 dev_vdbg(cd->dev, "%s: exclusive_dev %p freed\n", cyttsp4_release_exclusive()
1305 __func__, cd->exclusive_dev); cyttsp4_release_exclusive()
1306 cd->exclusive_dev = NULL; cyttsp4_release_exclusive()
1307 wake_up(&cd->wait_q); cyttsp4_release_exclusive()
1308 mutex_unlock(&cd->system_lock); cyttsp4_release_exclusive()
1312 static int cyttsp4_wait_bl_heartbeat(struct cyttsp4 *cd) cyttsp4_wait_bl_heartbeat() argument
1318 dev_vdbg(cd->dev, "%s: wait heartbeat...\n", __func__); cyttsp4_wait_bl_heartbeat()
1319 t = wait_event_timeout(cd->wait_q, cd->mode == CY_MODE_BOOTLOADER, cyttsp4_wait_bl_heartbeat()
1322 dev_err(cd->dev, "%s: tmo waiting bl heartbeat cd->mode=%d\n", cyttsp4_wait_bl_heartbeat()
1323 __func__, cd->mode); cyttsp4_wait_bl_heartbeat()
1330 static int cyttsp4_wait_sysinfo_mode(struct cyttsp4 *cd) cyttsp4_wait_sysinfo_mode() argument
1334 dev_vdbg(cd->dev, "%s: wait sysinfo...\n", __func__); cyttsp4_wait_sysinfo_mode()
1336 t = wait_event_timeout(cd->wait_q, cd->mode == CY_MODE_SYSINFO, cyttsp4_wait_sysinfo_mode()
1339 dev_err(cd->dev, "%s: tmo waiting exit bl cd->mode=%d\n", cyttsp4_wait_sysinfo_mode()
1340 __func__, cd->mode); cyttsp4_wait_sysinfo_mode()
1341 mutex_lock(&cd->system_lock); cyttsp4_wait_sysinfo_mode()
1342 cd->int_status &= ~CY_INT_MODE_CHANGE; cyttsp4_wait_sysinfo_mode()
1343 mutex_unlock(&cd->system_lock); cyttsp4_wait_sysinfo_mode()
1350 static int cyttsp4_reset_and_wait(struct cyttsp4 *cd) cyttsp4_reset_and_wait() argument
1355 mutex_lock(&cd->system_lock); cyttsp4_reset_and_wait()
1356 dev_dbg(cd->dev, "%s: reset hw...\n", __func__); cyttsp4_reset_and_wait()
1357 rc = cyttsp4_hw_reset(cd); cyttsp4_reset_and_wait()
1358 cd->mode = CY_MODE_UNKNOWN; cyttsp4_reset_and_wait()
1359 mutex_unlock(&cd->system_lock); cyttsp4_reset_and_wait()
1361 dev_err(cd->dev, "%s:Fail hw reset r=%d\n", __func__, rc); cyttsp4_reset_and_wait()
1365 return cyttsp4_wait_bl_heartbeat(cd); cyttsp4_reset_and_wait()
1372 static int cyttsp4_set_mode(struct cyttsp4 *cd, int new_mode) cyttsp4_set_mode() argument
1390 dev_err(cd->dev, "%s: invalid mode: %02X(%d)\n", cyttsp4_set_mode()
1396 dev_dbg(cd->dev, "%s: %s=%p new_dev_mode=%02X new_mode=%d\n", cyttsp4_set_mode()
1397 __func__, "have exclusive", cd->exclusive_dev, cyttsp4_set_mode()
1400 mutex_lock(&cd->system_lock); cyttsp4_set_mode()
1401 rc = cyttsp4_adap_read(cd, CY_REG_BASE, sizeof(mode), &mode); cyttsp4_set_mode()
1403 mutex_unlock(&cd->system_lock); cyttsp4_set_mode()
1404 dev_err(cd->dev, "%s: Fail read mode r=%d\n", cyttsp4_set_mode()
1413 cd->int_status |= CY_INT_MODE_CHANGE; cyttsp4_set_mode()
1414 rc = cyttsp4_adap_write(cd, CY_REG_BASE, sizeof(mode), &mode); cyttsp4_set_mode()
1415 mutex_unlock(&cd->system_lock); cyttsp4_set_mode()
1417 dev_err(cd->dev, "%s: Fail write mode change r=%d\n", cyttsp4_set_mode()
1423 t = wait_event_timeout(cd->wait_q, cyttsp4_set_mode()
1424 (cd->int_status & CY_INT_MODE_CHANGE) == 0, cyttsp4_set_mode()
1426 dev_dbg(cd->dev, "%s: back from wait t=%ld cd->mode=%d\n", cyttsp4_set_mode()
1427 __func__, t, cd->mode); cyttsp4_set_mode()
1430 dev_err(cd->dev, "%s: %s\n", __func__, cyttsp4_set_mode()
1432 mutex_lock(&cd->system_lock); cyttsp4_set_mode()
1433 cd->int_status &= ~CY_INT_MODE_CHANGE; cyttsp4_set_mode()
1434 mutex_unlock(&cd->system_lock); cyttsp4_set_mode()
1444 struct cyttsp4 *cd = cyttsp4_watchdog_work() local
1449 mutex_lock(&cd->system_lock); cyttsp4_watchdog_work()
1450 retval = cyttsp4_load_status_regs(cd); cyttsp4_watchdog_work()
1452 dev_err(cd->dev, cyttsp4_watchdog_work()
1455 cyttsp4_queue_startup_(cd); cyttsp4_watchdog_work()
1458 mode = &cd->sysinfo.xy_mode[CY_REG_BASE]; cyttsp4_watchdog_work()
1460 dev_err(cd->dev, cyttsp4_watchdog_work()
1463 cyttsp4_queue_startup_(cd); cyttsp4_watchdog_work()
1467 cyttsp4_start_wd_timer(cd); cyttsp4_watchdog_work()
1469 mutex_unlock(&cd->system_lock); cyttsp4_watchdog_work()
1473 static int cyttsp4_core_sleep_(struct cyttsp4 *cd) cyttsp4_core_sleep_() argument
1481 mutex_lock(&cd->system_lock); cyttsp4_core_sleep_()
1482 if (cd->sleep_state == SS_SLEEP_ON) { cyttsp4_core_sleep_()
1483 mutex_unlock(&cd->system_lock); cyttsp4_core_sleep_()
1486 cd->sleep_state = SS_SLEEPING; cyttsp4_core_sleep_()
1487 mutex_unlock(&cd->system_lock); cyttsp4_core_sleep_()
1489 cyttsp4_stop_wd_timer(cd); cyttsp4_core_sleep_()
1492 disable_irq(cd->irq); cyttsp4_core_sleep_()
1494 dev_vdbg(cd->dev, "%s: write DEEP SLEEP...\n", __func__); cyttsp4_core_sleep_()
1495 mutex_lock(&cd->system_lock); cyttsp4_core_sleep_()
1496 rc = cyttsp4_adap_read(cd, CY_REG_BASE, sizeof(mode), &mode); cyttsp4_core_sleep_()
1498 mutex_unlock(&cd->system_lock); cyttsp4_core_sleep_()
1499 dev_err(cd->dev, "%s: Fail read adapter r=%d\n", __func__, rc); cyttsp4_core_sleep_()
1504 mutex_unlock(&cd->system_lock); cyttsp4_core_sleep_()
1505 dev_err(cd->dev, "%s: Device in BOOTLADER mode.\n", __func__); cyttsp4_core_sleep_()
1511 rc = cyttsp4_adap_write(cd, CY_REG_BASE, sizeof(mode[0]), &mode[0]); cyttsp4_core_sleep_()
1512 mutex_unlock(&cd->system_lock); cyttsp4_core_sleep_()
1514 dev_err(cd->dev, "%s: Fail write adapter r=%d\n", __func__, rc); cyttsp4_core_sleep_()
1517 dev_vdbg(cd->dev, "%s: write DEEP SLEEP succeeded\n", __func__); cyttsp4_core_sleep_()
1519 if (cd->cpdata->power) { cyttsp4_core_sleep_()
1520 dev_dbg(cd->dev, "%s: Power down HW\n", __func__); cyttsp4_core_sleep_()
1521 rc = cd->cpdata->power(cd->cpdata, 0, cd->dev, &cd->ignore_irq); cyttsp4_core_sleep_()
1523 dev_dbg(cd->dev, "%s: No power function\n", __func__); cyttsp4_core_sleep_()
1527 dev_err(cd->dev, "%s: HW Power down fails r=%d\n", cyttsp4_core_sleep_()
1540 cyttsp4_start_wd_timer(cd); cyttsp4_core_sleep_()
1543 mutex_lock(&cd->system_lock); cyttsp4_core_sleep_()
1544 cd->sleep_state = ss; cyttsp4_core_sleep_()
1545 cd->int_status |= int_status; cyttsp4_core_sleep_()
1546 mutex_unlock(&cd->system_lock); cyttsp4_core_sleep_()
1547 enable_irq(cd->irq); cyttsp4_core_sleep_()
1551 static int cyttsp4_startup_(struct cyttsp4 *cd) cyttsp4_startup_() argument
1556 cyttsp4_stop_wd_timer(cd); cyttsp4_startup_()
1560 dev_dbg(cd->dev, "%s: Retry %d\n", __func__, cyttsp4_startup_()
1564 rc = cyttsp4_reset_and_wait(cd); cyttsp4_startup_()
1566 dev_err(cd->dev, "%s: Error on h/w reset r=%d\n", __func__, rc); cyttsp4_startup_()
1573 dev_vdbg(cd->dev, "%s: write exit ldr...\n", __func__); cyttsp4_startup_()
1574 mutex_lock(&cd->system_lock); cyttsp4_startup_()
1575 cd->int_status &= ~CY_INT_IGNORE; cyttsp4_startup_()
1576 cd->int_status |= CY_INT_MODE_CHANGE; cyttsp4_startup_()
1578 rc = cyttsp4_adap_write(cd, CY_REG_BASE, sizeof(ldr_exit), cyttsp4_startup_()
1580 mutex_unlock(&cd->system_lock); cyttsp4_startup_()
1582 dev_err(cd->dev, "%s: Fail write r=%d\n", __func__, rc); cyttsp4_startup_()
1588 rc = cyttsp4_wait_sysinfo_mode(cd); cyttsp4_startup_()
1594 rc1 = cyttsp4_adap_read(cd, CY_REG_BASE, sizeof(ldr_err_app), cyttsp4_startup_()
1597 dev_err(cd->dev, "%s: Fail read r=%d\n", __func__, rc1); cyttsp4_startup_()
1599 dev_err(cd->dev, "%s: Error launching touch application\n", cyttsp4_startup_()
1601 mutex_lock(&cd->system_lock); cyttsp4_startup_()
1602 cd->invalid_touch_app = true; cyttsp4_startup_()
1603 mutex_unlock(&cd->system_lock); cyttsp4_startup_()
1612 mutex_lock(&cd->system_lock); cyttsp4_startup_()
1613 cd->invalid_touch_app = false; cyttsp4_startup_()
1614 mutex_unlock(&cd->system_lock); cyttsp4_startup_()
1617 dev_vdbg(cd->dev, "%s: get sysinfo regs..\n", __func__); cyttsp4_startup_()
1618 rc = cyttsp4_get_sysinfo_regs(cd); cyttsp4_startup_()
1620 dev_err(cd->dev, "%s: failed to get sysinfo regs rc=%d\n", cyttsp4_startup_()
1627 rc = cyttsp4_set_mode(cd, CY_MODE_OPERATIONAL); cyttsp4_startup_()
1629 dev_err(cd->dev, "%s: failed to set mode to operational rc=%d\n", cyttsp4_startup_()
1636 cyttsp4_lift_all(&cd->md); cyttsp4_startup_()
1639 mutex_lock(&cd->system_lock); cyttsp4_startup_()
1640 if (cd->sleep_state == SS_SLEEP_ON) { cyttsp4_startup_()
1641 cd->sleep_state = SS_SLEEP_OFF; cyttsp4_startup_()
1642 mutex_unlock(&cd->system_lock); cyttsp4_startup_()
1643 cyttsp4_core_sleep_(cd); cyttsp4_startup_()
1646 mutex_unlock(&cd->system_lock); cyttsp4_startup_()
1649 cyttsp4_start_wd_timer(cd); cyttsp4_startup_()
1654 static int cyttsp4_startup(struct cyttsp4 *cd) cyttsp4_startup() argument
1658 mutex_lock(&cd->system_lock); cyttsp4_startup()
1659 cd->startup_state = STARTUP_RUNNING; cyttsp4_startup()
1660 mutex_unlock(&cd->system_lock); cyttsp4_startup()
1662 rc = cyttsp4_request_exclusive(cd, cd->dev, cyttsp4_startup()
1665 dev_err(cd->dev, "%s: fail get exclusive ex=%p own=%p\n", cyttsp4_startup()
1666 __func__, cd->exclusive_dev, cd->dev); cyttsp4_startup()
1670 rc = cyttsp4_startup_(cd); cyttsp4_startup()
1672 if (cyttsp4_release_exclusive(cd, cd->dev) < 0) cyttsp4_startup()
1674 dev_err(cd->dev, "%s: fail to release exclusive\n", __func__); cyttsp4_startup()
1676 dev_vdbg(cd->dev, "%s: pass release exclusive\n", __func__); cyttsp4_startup()
1679 mutex_lock(&cd->system_lock); cyttsp4_startup()
1680 cd->startup_state = STARTUP_NONE; cyttsp4_startup()
1681 mutex_unlock(&cd->system_lock); cyttsp4_startup()
1684 wake_up(&cd->wait_q); cyttsp4_startup()
1691 struct cyttsp4 *cd = container_of(work, struct cyttsp4, startup_work); cyttsp4_startup_work_function() local
1694 rc = cyttsp4_startup(cd); cyttsp4_startup_work_function()
1696 dev_err(cd->dev, "%s: Fail queued startup r=%d\n", cyttsp4_startup_work_function()
1700 static void cyttsp4_free_si_ptrs(struct cyttsp4 *cd) cyttsp4_free_si_ptrs() argument
1702 struct cyttsp4_sysinfo *si = &cd->sysinfo; cyttsp4_free_si_ptrs()
1720 static int cyttsp4_core_sleep(struct cyttsp4 *cd) cyttsp4_core_sleep() argument
1724 rc = cyttsp4_request_exclusive(cd, cd->dev, cyttsp4_core_sleep()
1727 dev_err(cd->dev, "%s: fail get exclusive ex=%p own=%p\n", cyttsp4_core_sleep()
1728 __func__, cd->exclusive_dev, cd->dev); cyttsp4_core_sleep()
1732 rc = cyttsp4_core_sleep_(cd); cyttsp4_core_sleep()
1734 if (cyttsp4_release_exclusive(cd, cd->dev) < 0) cyttsp4_core_sleep()
1735 dev_err(cd->dev, "%s: fail to release exclusive\n", __func__); cyttsp4_core_sleep()
1737 dev_vdbg(cd->dev, "%s: pass release exclusive\n", __func__); cyttsp4_core_sleep()
1742 static int cyttsp4_core_wake_(struct cyttsp4 *cd) cyttsp4_core_wake_() argument
1744 struct device *dev = cd->dev; cyttsp4_core_wake_()
1750 mutex_lock(&cd->system_lock); cyttsp4_core_wake_()
1751 if (cd->sleep_state == SS_SLEEP_OFF) { cyttsp4_core_wake_()
1752 mutex_unlock(&cd->system_lock); cyttsp4_core_wake_()
1755 cd->int_status &= ~CY_INT_IGNORE; cyttsp4_core_wake_()
1756 cd->int_status |= CY_INT_AWAKE; cyttsp4_core_wake_()
1757 cd->sleep_state = SS_WAKING; cyttsp4_core_wake_()
1759 if (cd->cpdata->power) { cyttsp4_core_wake_()
1761 rc = cd->cpdata->power(cd->cpdata, 1, dev, &cd->ignore_irq); cyttsp4_core_wake_()
1771 cyttsp4_adap_read(cd, CY_REG_BASE, sizeof(mode), &mode); cyttsp4_core_wake_()
1773 dev_vdbg(cd->dev, "%s: HW power up succeeds\n", cyttsp4_core_wake_()
1775 mutex_unlock(&cd->system_lock); cyttsp4_core_wake_()
1777 t = wait_event_timeout(cd->wait_q, cyttsp4_core_wake_()
1778 (cd->int_status & CY_INT_AWAKE) == 0, cyttsp4_core_wake_()
1782 mutex_lock(&cd->system_lock); cyttsp4_core_wake_()
1783 cd->int_status &= ~CY_INT_AWAKE; cyttsp4_core_wake_()
1785 cyttsp4_queue_startup_(cd); cyttsp4_core_wake_()
1786 mutex_unlock(&cd->system_lock); cyttsp4_core_wake_()
1789 mutex_lock(&cd->system_lock); cyttsp4_core_wake_()
1790 cd->sleep_state = SS_SLEEP_OFF; cyttsp4_core_wake_()
1791 mutex_unlock(&cd->system_lock); cyttsp4_core_wake_()
1793 cyttsp4_start_wd_timer(cd); cyttsp4_core_wake_()
1798 static int cyttsp4_core_wake(struct cyttsp4 *cd) cyttsp4_core_wake() argument
1802 rc = cyttsp4_request_exclusive(cd, cd->dev, cyttsp4_core_wake()
1805 dev_err(cd->dev, "%s: fail get exclusive ex=%p own=%p\n", cyttsp4_core_wake()
1806 __func__, cd->exclusive_dev, cd->dev); cyttsp4_core_wake()
1810 rc = cyttsp4_core_wake_(cd); cyttsp4_core_wake()
1812 if (cyttsp4_release_exclusive(cd, cd->dev) < 0) cyttsp4_core_wake()
1813 dev_err(cd->dev, "%s: fail to release exclusive\n", __func__); cyttsp4_core_wake()
1815 dev_vdbg(cd->dev, "%s: pass release exclusive\n", __func__); cyttsp4_core_wake()
1822 struct cyttsp4 *cd = dev_get_drvdata(dev); cyttsp4_core_suspend() local
1823 struct cyttsp4_mt_data *md = &cd->md; cyttsp4_core_suspend()
1828 rc = cyttsp4_core_sleep(cd); cyttsp4_core_suspend()
1838 struct cyttsp4 *cd = dev_get_drvdata(dev); cyttsp4_core_resume() local
1839 struct cyttsp4_mt_data *md = &cd->md; cyttsp4_core_resume()
1844 rc = cyttsp4_core_wake(cd); cyttsp4_core_resume()
1876 static int cyttsp4_setup_input_device(struct cyttsp4 *cd) cyttsp4_setup_input_device() argument
1878 struct device *dev = cd->dev; cyttsp4_setup_input_device()
1879 struct cyttsp4_mt_data *md = &cd->md; cyttsp4_setup_input_device()
1947 static int cyttsp4_mt_probe(struct cyttsp4 *cd) cyttsp4_mt_probe() argument
1949 struct device *dev = cd->dev; cyttsp4_mt_probe()
1950 struct cyttsp4_mt_data *md = &cd->md; cyttsp4_mt_probe()
1951 struct cyttsp4_mt_platform_data *pdata = cd->pdata->mt_pdata; cyttsp4_mt_probe()
1970 md->input->id.bustype = cd->bus_ops->bustype; cyttsp4_mt_probe()
1977 md->si = &cd->sysinfo; cyttsp4_mt_probe()
1984 rc = cyttsp4_setup_input_device(cd); cyttsp4_mt_probe()
2002 struct cyttsp4 *cd; cyttsp4_probe() local
2013 cd = kzalloc(sizeof(*cd), GFP_KERNEL); cyttsp4_probe()
2014 if (!cd) { cyttsp4_probe()
2020 cd->xfer_buf = kzalloc(xfer_buf_size, GFP_KERNEL); cyttsp4_probe()
2021 if (!cd->xfer_buf) { cyttsp4_probe()
2028 cd->dev = dev; cyttsp4_probe()
2029 cd->pdata = pdata; cyttsp4_probe()
2030 cd->cpdata = pdata->core_pdata; cyttsp4_probe()
2031 cd->bus_ops = ops; cyttsp4_probe()
2034 mutex_init(&cd->system_lock); cyttsp4_probe()
2035 mutex_init(&cd->adap_lock); cyttsp4_probe()
2038 init_waitqueue_head(&cd->wait_q); cyttsp4_probe()
2041 INIT_WORK(&cd->startup_work, cyttsp4_startup_work_function); cyttsp4_probe()
2042 INIT_WORK(&cd->watchdog_work, cyttsp4_watchdog_work); cyttsp4_probe()
2045 cd->irq = gpio_to_irq(cd->cpdata->irq_gpio); cyttsp4_probe()
2046 if (cd->irq < 0) { cyttsp4_probe()
2051 dev_set_drvdata(dev, cd); cyttsp4_probe()
2054 if (cd->cpdata->init) { cyttsp4_probe()
2055 dev_dbg(cd->dev, "%s: Init HW\n", __func__); cyttsp4_probe()
2056 rc = cd->cpdata->init(cd->cpdata, 1, cd->dev); cyttsp4_probe()
2058 dev_dbg(cd->dev, "%s: No HW INIT function\n", __func__); cyttsp4_probe()
2062 dev_err(cd->dev, "%s: HW Init fail r=%d\n", __func__, rc); cyttsp4_probe()
2064 dev_dbg(dev, "%s: initialize threaded irq=%d\n", __func__, cd->irq); cyttsp4_probe()
2065 if (cd->cpdata->level_irq_udelay > 0) cyttsp4_probe()
2072 rc = request_threaded_irq(cd->irq, NULL, cyttsp4_irq, irq_flags, cyttsp4_probe()
2073 dev_name(dev), cd); cyttsp4_probe()
2080 setup_timer(&cd->watchdog_timer, cyttsp4_watchdog_timer, cyttsp4_probe()
2081 (unsigned long)cd); cyttsp4_probe()
2087 rc = cyttsp4_startup(cd); cyttsp4_probe()
2090 if (rc < 0 && cd->mode == CY_MODE_UNKNOWN) { cyttsp4_probe()
2091 dev_err(cd->dev, "%s: Fail initial startup r=%d\n", cyttsp4_probe()
2096 rc = cyttsp4_mt_probe(cd); cyttsp4_probe()
2104 return cd; cyttsp4_probe()
2107 cancel_work_sync(&cd->startup_work); cyttsp4_probe()
2108 cyttsp4_stop_wd_timer(cd); cyttsp4_probe()
2110 cyttsp4_free_si_ptrs(cd); cyttsp4_probe()
2111 free_irq(cd->irq, cd); cyttsp4_probe()
2113 if (cd->cpdata->init) cyttsp4_probe()
2114 cd->cpdata->init(cd->cpdata, 0, dev); cyttsp4_probe()
2116 kfree(cd->xfer_buf); cyttsp4_probe()
2118 kfree(cd); cyttsp4_probe()
2132 int cyttsp4_remove(struct cyttsp4 *cd) cyttsp4_remove() argument
2134 struct device *dev = cd->dev; cyttsp4_remove()
2136 cyttsp4_mt_release(&cd->md); cyttsp4_remove()
2145 cancel_work_sync(&cd->startup_work); cyttsp4_remove()
2147 cyttsp4_stop_wd_timer(cd); cyttsp4_remove()
2149 free_irq(cd->irq, cd); cyttsp4_remove()
2150 if (cd->cpdata->init) cyttsp4_remove()
2151 cd->cpdata->init(cd->cpdata, 0, dev); cyttsp4_remove()
2152 cyttsp4_free_si_ptrs(cd); cyttsp4_remove()
2153 kfree(cd); cyttsp4_remove()
/linux-4.1.27/drivers/block/paride/
H A Dpcd.c229 struct pcd_unit *cd = bdev->bd_disk->private_data; pcd_block_open() local
233 ret = cdrom_open(&cd->info, bdev, mode); pcd_block_open()
241 struct pcd_unit *cd = disk->private_data; pcd_block_release() local
243 cdrom_release(&cd->info, mode); pcd_block_release()
250 struct pcd_unit *cd = bdev->bd_disk->private_data; pcd_block_ioctl() local
254 ret = cdrom_ioctl(&cd->info, bdev, mode, cmd, arg); pcd_block_ioctl()
263 struct pcd_unit *cd = disk->private_data; pcd_block_check_events() local
264 return cdrom_check_events(&cd->info, clearing); pcd_block_check_events()
294 struct pcd_unit *cd; pcd_init_units() local
298 for (unit = 0, cd = pcd; unit < PCD_UNITS; unit++, cd++) { pcd_init_units()
302 cd->disk = disk; pcd_init_units()
303 cd->pi = &cd->pia; pcd_init_units()
304 cd->present = 0; pcd_init_units()
305 cd->last_sense = 0; pcd_init_units()
306 cd->changed = 1; pcd_init_units()
307 cd->drive = (*drives[unit])[D_SLV]; pcd_init_units()
311 cd->name = &cd->info.name[0]; pcd_init_units()
312 snprintf(cd->name, sizeof(cd->info.name), "%s%d", name, unit); pcd_init_units()
313 cd->info.ops = &pcd_dops; pcd_init_units()
314 cd->info.handle = cd; pcd_init_units()
315 cd->info.speed = 0; pcd_init_units()
316 cd->info.capacity = 1; pcd_init_units()
317 cd->info.mask = 0; pcd_init_units()
320 strcpy(disk->disk_name, cd->name); /* umm... */ pcd_init_units()
328 struct pcd_unit *cd = cdi->handle; pcd_open() local
329 if (!cd->present) pcd_open()
338 static inline int status_reg(struct pcd_unit *cd) status_reg() argument
340 return pi_read_regr(cd->pi, 1, 6); status_reg()
343 static inline int read_reg(struct pcd_unit *cd, int reg) read_reg() argument
345 return pi_read_regr(cd->pi, 0, reg); read_reg()
348 static inline void write_reg(struct pcd_unit *cd, int reg, int val) write_reg() argument
350 pi_write_regr(cd->pi, 0, reg, val); write_reg()
353 static int pcd_wait(struct pcd_unit *cd, int go, int stop, char *fun, char *msg) pcd_wait() argument
358 while ((((r = status_reg(cd)) & go) || (stop && (!(r & stop)))) pcd_wait()
363 s = read_reg(cd, 7); pcd_wait()
364 e = read_reg(cd, 1); pcd_wait()
365 p = read_reg(cd, 2); pcd_wait()
371 cd->name, fun, msg, r, s, e, j, p); pcd_wait()
377 static int pcd_command(struct pcd_unit *cd, char *cmd, int dlen, char *fun) pcd_command() argument
379 pi_connect(cd->pi); pcd_command()
381 write_reg(cd, 6, 0xa0 + 0x10 * cd->drive); pcd_command()
383 if (pcd_wait(cd, IDE_BUSY | IDE_DRQ, 0, fun, "before command")) { pcd_command()
384 pi_disconnect(cd->pi); pcd_command()
388 write_reg(cd, 4, dlen % 256); pcd_command()
389 write_reg(cd, 5, dlen / 256); pcd_command()
390 write_reg(cd, 7, 0xa0); /* ATAPI packet command */ pcd_command()
392 if (pcd_wait(cd, IDE_BUSY, IDE_DRQ, fun, "command DRQ")) { pcd_command()
393 pi_disconnect(cd->pi); pcd_command()
397 if (read_reg(cd, 2) != 1) { pcd_command()
398 printk("%s: %s: command phase error\n", cd->name, fun); pcd_command()
399 pi_disconnect(cd->pi); pcd_command()
403 pi_write_block(cd->pi, cmd, 12); pcd_command()
408 static int pcd_completion(struct pcd_unit *cd, char *buf, char *fun) pcd_completion() argument
416 if (!pcd_wait(cd, IDE_BUSY, IDE_DRQ | IDE_READY | IDE_ERR, pcd_completion()
419 while (read_reg(cd, 7) & IDE_DRQ) { pcd_completion()
420 d = read_reg(cd, 4) + 256 * read_reg(cd, 5); pcd_completion()
422 p = read_reg(cd, 2) & 3; pcd_completion()
425 pi_read_block(cd->pi, buf, n); pcd_completion()
428 cd->name, fun, n); pcd_completion()
435 cd->name, fun, p, d, k); pcd_completion()
439 cd->name); pcd_completion()
443 printk("%s: Stuck DRQ\n", cd->name); pcd_completion()
447 (cd, IDE_BUSY, IDE_DRQ | IDE_READY | IDE_ERR, fun, pcd_completion()
455 pi_disconnect(cd->pi); pcd_completion()
460 static void pcd_req_sense(struct pcd_unit *cd, char *fun) pcd_req_sense() argument
466 r = pcd_command(cd, rs_cmd, 16, "Request sense"); pcd_req_sense()
469 pcd_completion(cd, buf, "Request sense"); pcd_req_sense()
471 cd->last_sense = -1; pcd_req_sense()
476 cd->name, fun, buf[2] & 0xf, buf[12], buf[13]); pcd_req_sense()
478 cd->last_sense = pcd_req_sense()
482 cd->changed = 1; pcd_req_sense()
485 static int pcd_atapi(struct pcd_unit *cd, char *cmd, int dlen, char *buf, char *fun) pcd_atapi() argument
489 r = pcd_command(cd, cmd, dlen, fun); pcd_atapi()
492 r = pcd_completion(cd, buf, fun); pcd_atapi()
494 pcd_req_sense(cd, fun); pcd_atapi()
510 struct pcd_unit *cd = cdi->handle; pcd_check_events() local
511 int res = cd->changed; pcd_check_events()
513 cd->changed = 0; pcd_check_events()
538 static int pcd_reset(struct pcd_unit *cd) pcd_reset() argument
543 pi_connect(cd->pi); pcd_reset()
544 write_reg(cd, 6, 0xa0 + 0x10 * cd->drive); pcd_reset()
545 write_reg(cd, 7, 8); pcd_reset()
550 while ((k++ < PCD_RESET_TMO) && (status_reg(cd) & IDE_BUSY)) pcd_reset()
555 flg &= (read_reg(cd, i + 1) == expect[i]); pcd_reset()
558 printk("%s: Reset (%d) signature = ", cd->name, k); pcd_reset()
560 printk("%3x", read_reg(cd, i + 1)); pcd_reset()
566 pi_disconnect(cd->pi); pcd_reset()
575 static int pcd_ready_wait(struct pcd_unit *cd, int tmo) pcd_ready_wait() argument
582 cd->last_sense = 0; pcd_ready_wait()
583 pcd_atapi(cd, tr_cmd, 0, NULL, DBMSG("test unit ready")); pcd_ready_wait()
584 p = cd->last_sense; pcd_ready_wait()
598 struct pcd_unit *cd = cdi->handle; pcd_drive_status() local
600 if (pcd_ready_wait(cd, PCD_READY_TMO)) pcd_drive_status()
602 if (pcd_atapi(cd, rc_cmd, 8, pcd_scratch, DBMSG("check media"))) pcd_drive_status()
607 static int pcd_identify(struct pcd_unit *cd, char *id) pcd_identify() argument
614 s = pcd_atapi(cd, id_cmd, 36, pcd_buffer, "identify"); pcd_identify()
621 cd->name, cd->drive ? "Slave" : "Master"); pcd_identify()
632 printk("%s: %s: %s\n", cd->name, cd->drive ? "Slave" : "Master", id); pcd_identify()
641 static int pcd_probe(struct pcd_unit *cd, int ms, char *id) pcd_probe() argument
644 for (cd->drive = 0; cd->drive <= 1; cd->drive++) pcd_probe()
645 if (!pcd_reset(cd) && !pcd_identify(cd, id)) pcd_probe()
648 cd->drive = ms; pcd_probe()
649 if (!pcd_reset(cd) && !pcd_identify(cd, id)) pcd_probe()
660 struct pcd_unit *cd; pcd_probe_capabilities() local
662 for (unit = 0, cd = pcd; unit < PCD_UNITS; unit++, cd++) { pcd_probe_capabilities()
663 if (!cd->present) pcd_probe_capabilities()
665 r = pcd_atapi(cd, cmd, 18, buffer, "mode sense capabilities"); pcd_probe_capabilities()
670 cd->info.mask |= CDC_CD_R; pcd_probe_capabilities()
672 cd->info.mask |= CDC_CD_RW; pcd_probe_capabilities()
674 cd->info.mask |= CDC_PLAY_AUDIO; pcd_probe_capabilities()
676 cd->info.mask |= CDC_LOCK; pcd_probe_capabilities()
678 cd->info.mask |= CDC_OPEN_TRAY; pcd_probe_capabilities()
680 cd->info.mask |= CDC_CLOSE_TRAY; pcd_probe_capabilities()
688 struct pcd_unit *cd; pcd_detect() local
695 cd = pcd; pcd_detect()
696 if (pi_init(cd->pi, 1, -1, -1, -1, -1, -1, pcd_buffer, pcd_detect()
697 PI_PCD, verbose, cd->name)) { pcd_detect()
698 if (!pcd_probe(cd, -1, id) && cd->disk) { pcd_detect()
699 cd->present = 1; pcd_detect()
702 pi_release(cd->pi); pcd_detect()
705 for (unit = 0, cd = pcd; unit < PCD_UNITS; unit++, cd++) { pcd_detect()
709 if (!pi_init(cd->pi, 0, conf[D_PRT], conf[D_MOD], pcd_detect()
711 pcd_buffer, PI_PCD, verbose, cd->name)) pcd_detect()
713 if (!pcd_probe(cd, conf[D_SLV], id) && cd->disk) { pcd_detect()
714 cd->present = 1; pcd_detect()
717 pi_release(cd->pi); pcd_detect()
724 for (unit = 0, cd = pcd; unit < PCD_UNITS; unit++, cd++) pcd_detect()
725 put_disk(cd->disk); pcd_detect()
744 struct pcd_unit *cd = pcd_req->rq_disk->private_data; do_pcd_request() local
745 if (cd != pcd_current) do_pcd_request()
747 pcd_current = cd; do_pcd_request()
852 struct pcd_unit *cd = cdi->handle; pcd_audio_ioctl() local
867 r = pcd_atapi(cd, cmd, 12, buffer, "read toc header"); pcd_audio_ioctl()
891 r = pcd_atapi(cd, cmd, 12, buffer, "read toc entry"); pcd_audio_ioctl()
932 struct pcd_unit *cd; pcd_init() local
947 for (unit = 0, cd = pcd; unit < PCD_UNITS; unit++, cd++) pcd_init()
948 put_disk(cd->disk); pcd_init()
955 for (unit = 0, cd = pcd; unit < PCD_UNITS; unit++, cd++) pcd_init()
956 put_disk(cd->disk); pcd_init()
960 for (unit = 0, cd = pcd; unit < PCD_UNITS; unit++, cd++) { pcd_init()
961 if (cd->present) { pcd_init()
962 register_cdrom(&cd->info); pcd_init()
963 cd->disk->private_data = cd; pcd_init()
964 cd->disk->queue = pcd_queue; pcd_init()
965 add_disk(cd->disk); pcd_init()
974 struct pcd_unit *cd; pcd_exit() local
977 for (unit = 0, cd = pcd; unit < PCD_UNITS; unit++, cd++) { pcd_exit()
978 if (cd->present) { pcd_exit()
979 del_gendisk(cd->disk); pcd_exit()
980 pi_release(cd->pi); pcd_exit()
981 unregister_cdrom(&cd->info); pcd_exit()
983 put_disk(cd->disk); pcd_exit()
/linux-4.1.27/drivers/misc/genwqe/
H A Dcard_base.c125 struct genwqe_dev *cd; genwqe_dev_alloc() local
134 cd = kzalloc(sizeof(struct genwqe_dev), GFP_KERNEL); genwqe_dev_alloc()
135 if (!cd) genwqe_dev_alloc()
138 cd->card_idx = i; genwqe_dev_alloc()
139 cd->class_genwqe = class_genwqe; genwqe_dev_alloc()
140 cd->debugfs_genwqe = debugfs_genwqe; genwqe_dev_alloc()
146 cd->use_platform_recovery = CONFIG_GENWQE_PLATFORM_ERROR_RECOVERY; genwqe_dev_alloc()
148 init_waitqueue_head(&cd->queue_waitq); genwqe_dev_alloc()
150 spin_lock_init(&cd->file_lock); genwqe_dev_alloc()
151 INIT_LIST_HEAD(&cd->file_list); genwqe_dev_alloc()
153 cd->card_state = GENWQE_CARD_UNUSED; genwqe_dev_alloc()
154 spin_lock_init(&cd->print_lock); genwqe_dev_alloc()
156 cd->ddcb_software_timeout = genwqe_ddcb_software_timeout; genwqe_dev_alloc()
157 cd->kill_timeout = genwqe_kill_timeout; genwqe_dev_alloc()
160 cd->vf_jobtimeout_msec[j] = genwqe_vf_jobtimeout_msec; genwqe_dev_alloc()
162 genwqe_devices[i] = cd; genwqe_dev_alloc()
163 return cd; genwqe_dev_alloc()
166 static void genwqe_dev_free(struct genwqe_dev *cd) genwqe_dev_free() argument
168 if (!cd) genwqe_dev_free()
171 genwqe_devices[cd->card_idx] = NULL; genwqe_dev_free()
172 kfree(cd); genwqe_dev_free()
183 static int genwqe_bus_reset(struct genwqe_dev *cd) genwqe_bus_reset() argument
186 struct pci_dev *pci_dev = cd->pci_dev; genwqe_bus_reset()
189 if (cd->err_inject & GENWQE_INJECT_BUS_RESET_FAILURE) genwqe_bus_reset()
192 mmio = cd->mmio; genwqe_bus_reset()
193 cd->mmio = NULL; genwqe_bus_reset()
217 cd->err_inject &= ~(GENWQE_INJECT_HARDWARE_FAILURE | genwqe_bus_reset()
228 cd->mmio = pci_iomap(pci_dev, 0, 0); genwqe_bus_reset()
229 if (cd->mmio == NULL) { genwqe_bus_reset()
249 bool genwqe_need_err_masking(struct genwqe_dev *cd) genwqe_need_err_masking() argument
251 return (cd->slu_unitcfg & 0xFFFF0ull) < 0x32170ull; genwqe_need_err_masking()
254 static void genwqe_tweak_hardware(struct genwqe_dev *cd) genwqe_tweak_hardware() argument
256 struct pci_dev *pci_dev = cd->pci_dev; genwqe_tweak_hardware()
259 if (((cd->slu_unitcfg & 0xFFFF0ull) >= 0x32000ull) && genwqe_tweak_hardware()
260 ((cd->slu_unitcfg & 0xFFFF0ull) <= 0x33250ull)) { genwqe_tweak_hardware()
263 cd->slu_unitcfg, cd->app_unitcfg); genwqe_tweak_hardware()
265 __genwqe_writeq(cd, IO_APP_SEC_LEM_DEBUG_OVR, genwqe_tweak_hardware()
268 __genwqe_writeq(cd, IO_APP_ERR_ACT_MASK, genwqe_tweak_hardware()
281 int genwqe_recovery_on_fatal_gfir_required(struct genwqe_dev *cd) genwqe_recovery_on_fatal_gfir_required() argument
283 return (cd->slu_unitcfg & 0xFFFF0ull) >= 0x32170ull; genwqe_recovery_on_fatal_gfir_required()
286 int genwqe_flash_readback_fails(struct genwqe_dev *cd) genwqe_flash_readback_fails() argument
288 return (cd->slu_unitcfg & 0xFFFF0ull) < 0x32170ull; genwqe_flash_readback_fails()
302 static int genwqe_T_psec(struct genwqe_dev *cd) genwqe_T_psec() argument
307 speed = (u16)((cd->slu_unitcfg >> 28) & 0x0full); genwqe_T_psec()
323 static bool genwqe_setup_pf_jtimer(struct genwqe_dev *cd) genwqe_setup_pf_jtimer() argument
325 u32 T = genwqe_T_psec(cd); genwqe_setup_pf_jtimer()
335 genwqe_write_vreg(cd, IO_SLC_VF_APPJOB_TIMEOUT, genwqe_setup_pf_jtimer()
343 static bool genwqe_setup_vf_jtimer(struct genwqe_dev *cd) genwqe_setup_vf_jtimer() argument
345 struct pci_dev *pci_dev = cd->pci_dev; genwqe_setup_vf_jtimer()
347 u32 T = genwqe_T_psec(cd); genwqe_setup_vf_jtimer()
357 if (cd->vf_jobtimeout_msec[vf] == 0) genwqe_setup_vf_jtimer()
360 x = ilog2(cd->vf_jobtimeout_msec[vf] * genwqe_setup_vf_jtimer()
363 genwqe_write_vreg(cd, IO_SLC_VF_APPJOB_TIMEOUT, genwqe_setup_vf_jtimer()
369 static int genwqe_ffdc_buffs_alloc(struct genwqe_dev *cd) genwqe_ffdc_buffs_alloc() argument
376 e = genwqe_ffdc_buff_size(cd, 0); genwqe_ffdc_buffs_alloc()
379 e = genwqe_ffdc_buff_size(cd, 1); genwqe_ffdc_buffs_alloc()
382 e = genwqe_ffdc_buff_size(cd, 2); genwqe_ffdc_buffs_alloc()
390 cd->ffdc[type].entries = e; genwqe_ffdc_buffs_alloc()
391 cd->ffdc[type].regs = genwqe_ffdc_buffs_alloc()
402 static void genwqe_ffdc_buffs_free(struct genwqe_dev *cd) genwqe_ffdc_buffs_free() argument
407 kfree(cd->ffdc[type].regs); genwqe_ffdc_buffs_free()
408 cd->ffdc[type].regs = NULL; genwqe_ffdc_buffs_free()
412 static int genwqe_read_ids(struct genwqe_dev *cd) genwqe_read_ids() argument
416 struct pci_dev *pci_dev = cd->pci_dev; genwqe_read_ids()
418 cd->slu_unitcfg = __genwqe_readq(cd, IO_SLU_UNITCFG); genwqe_read_ids()
419 if (cd->slu_unitcfg == IO_ILLEGAL_VALUE) { genwqe_read_ids()
421 "err: SLUID=%016llx\n", cd->slu_unitcfg); genwqe_read_ids()
426 slu_id = genwqe_get_slu_id(cd); genwqe_read_ids()
434 cd->app_unitcfg = __genwqe_readq(cd, IO_APP_UNITCFG); genwqe_read_ids()
435 if (cd->app_unitcfg == IO_ILLEGAL_VALUE) { genwqe_read_ids()
437 "err: APPID=%016llx\n", cd->app_unitcfg); genwqe_read_ids()
441 genwqe_read_app_id(cd, cd->app_name, sizeof(cd->app_name)); genwqe_read_ids()
451 cd->is_privileged = 0; genwqe_read_ids()
453 cd->is_privileged = (__genwqe_readq(cd, IO_SLU_BITSTREAM) genwqe_read_ids()
460 static int genwqe_start(struct genwqe_dev *cd) genwqe_start() argument
463 struct pci_dev *pci_dev = cd->pci_dev; genwqe_start()
465 err = genwqe_read_ids(cd); genwqe_start()
469 if (genwqe_is_privileged(cd)) { genwqe_start()
471 genwqe_ffdc_buffs_alloc(cd); genwqe_start()
472 genwqe_stop_traps(cd); genwqe_start()
475 genwqe_read_ffdc_regs(cd, cd->ffdc[GENWQE_DBG_REGS].regs, genwqe_start()
476 cd->ffdc[GENWQE_DBG_REGS].entries, 0); genwqe_start()
478 genwqe_ffdc_buff_read(cd, GENWQE_DBG_UNIT0, genwqe_start()
479 cd->ffdc[GENWQE_DBG_UNIT0].regs, genwqe_start()
480 cd->ffdc[GENWQE_DBG_UNIT0].entries); genwqe_start()
482 genwqe_ffdc_buff_read(cd, GENWQE_DBG_UNIT1, genwqe_start()
483 cd->ffdc[GENWQE_DBG_UNIT1].regs, genwqe_start()
484 cd->ffdc[GENWQE_DBG_UNIT1].entries); genwqe_start()
486 genwqe_ffdc_buff_read(cd, GENWQE_DBG_UNIT2, genwqe_start()
487 cd->ffdc[GENWQE_DBG_UNIT2].regs, genwqe_start()
488 cd->ffdc[GENWQE_DBG_UNIT2].entries); genwqe_start()
490 genwqe_start_traps(cd); genwqe_start()
492 if (cd->card_state == GENWQE_CARD_FATAL_ERROR) { genwqe_start()
500 cd->softreset = 0x7Cull; genwqe_start()
501 __genwqe_writeq(cd, IO_SLC_CFGREG_SOFTRESET, genwqe_start()
502 cd->softreset); genwqe_start()
504 err = genwqe_bus_reset(cd); genwqe_start()
517 err = genwqe_read_ids(cd); genwqe_start()
523 err = genwqe_setup_service_layer(cd); /* does a reset to the card */ genwqe_start()
531 if (genwqe_is_privileged(cd)) { /* code is running _after_ reset */ genwqe_start()
532 genwqe_tweak_hardware(cd); genwqe_start()
534 genwqe_setup_pf_jtimer(cd); genwqe_start()
535 genwqe_setup_vf_jtimer(cd); genwqe_start()
538 err = genwqe_device_create(cd); genwqe_start()
547 genwqe_release_service_layer(cd); genwqe_start()
549 if (genwqe_is_privileged(cd)) genwqe_start()
550 genwqe_ffdc_buffs_free(cd); genwqe_start()
566 static int genwqe_stop(struct genwqe_dev *cd) genwqe_stop() argument
568 genwqe_finish_queue(cd); /* no register access */ genwqe_stop()
569 genwqe_device_remove(cd); /* device removed, procs killed */ genwqe_stop()
570 genwqe_release_service_layer(cd); /* here genwqe_thread is stopped */ genwqe_stop()
572 if (genwqe_is_privileged(cd)) { genwqe_stop()
573 pci_disable_sriov(cd->pci_dev); /* access pci config space */ genwqe_stop()
574 genwqe_ffdc_buffs_free(cd); genwqe_stop()
590 static int genwqe_recover_card(struct genwqe_dev *cd, int fatal_err) genwqe_recover_card() argument
593 struct pci_dev *pci_dev = cd->pci_dev; genwqe_recover_card()
595 genwqe_stop(cd); genwqe_recover_card()
602 cd->softreset = 0x70ull; genwqe_recover_card()
603 __genwqe_writeq(cd, IO_SLC_CFGREG_SOFTRESET, cd->softreset); genwqe_recover_card()
606 rc = genwqe_bus_reset(cd); genwqe_recover_card()
613 rc = genwqe_start(cd); genwqe_recover_card()
622 static int genwqe_health_check_cond(struct genwqe_dev *cd, u64 *gfir) genwqe_health_check_cond() argument
624 *gfir = __genwqe_readq(cd, IO_SLC_CFGREG_GFIR); genwqe_health_check_cond()
626 genwqe_recovery_on_fatal_gfir_required(cd); genwqe_health_check_cond()
638 static u64 genwqe_fir_checking(struct genwqe_dev *cd) genwqe_fir_checking() argument
643 struct pci_dev *pci_dev = cd->pci_dev; genwqe_fir_checking()
653 gfir = __genwqe_readq(cd, IO_SLC_CFGREG_GFIR); genwqe_fir_checking()
675 fir = __genwqe_readq(cd, fir_addr); genwqe_fir_checking()
685 fec = __genwqe_readq(cd, fec_addr); genwqe_fir_checking()
698 sfir = __genwqe_readq(cd, sfir_addr); genwqe_fir_checking()
706 sfec = __genwqe_readq(cd, sfec_addr); genwqe_fir_checking()
713 gfir = __genwqe_readq(cd, IO_SLC_CFGREG_GFIR); genwqe_fir_checking()
729 __genwqe_writeq(cd, sfir_addr, sfir); genwqe_fir_checking()
746 __genwqe_writeq(cd, fir_clr_addr, mask); genwqe_fir_checking()
754 gfir = __genwqe_readq(cd, IO_SLC_CFGREG_GFIR); genwqe_fir_checking()
805 static int genwqe_platform_recovery(struct genwqe_dev *cd) genwqe_platform_recovery() argument
807 struct pci_dev *pci_dev = cd->pci_dev; genwqe_platform_recovery()
814 cd->err_inject &= ~(GENWQE_INJECT_HARDWARE_FAILURE | genwqe_platform_recovery()
818 genwqe_stop(cd); genwqe_platform_recovery()
823 rc = genwqe_start(cd); genwqe_platform_recovery()
847 static int genwqe_reload_bistream(struct genwqe_dev *cd) genwqe_reload_bistream() argument
849 struct pci_dev *pci_dev = cd->pci_dev; genwqe_reload_bistream()
856 genwqe_stop(cd); genwqe_reload_bistream()
862 __genwqe_writeq(cd, IO_SLC_CFGREG_SOFTRESET, genwqe_reload_bistream()
863 (cd->softreset & 0xcull) | 0x70ull); genwqe_reload_bistream()
878 rc = genwqe_start(cd); genwqe_reload_bistream()
913 struct genwqe_dev *cd = data; genwqe_health_thread() local
914 struct pci_dev *pci_dev = cd->pci_dev; genwqe_health_thread()
919 rc = wait_event_interruptible_timeout(cd->health_waitq, genwqe_health_thread()
920 (genwqe_health_check_cond(cd, &gfir) || genwqe_health_thread()
933 slu_unitcfg = __genwqe_readq(cd, IO_SLU_UNITCFG); genwqe_health_thread()
941 app_unitcfg = __genwqe_readq(cd, IO_APP_UNITCFG); genwqe_health_thread()
949 gfir = __genwqe_readq(cd, IO_SLC_CFGREG_GFIR); genwqe_health_thread()
958 gfir_masked = genwqe_fir_checking(cd); genwqe_health_thread()
966 if ((gfir_masked) && !cd->skip_recovery && genwqe_health_thread()
967 genwqe_recovery_on_fatal_gfir_required(cd)) { genwqe_health_thread()
969 cd->card_state = GENWQE_CARD_FATAL_ERROR; genwqe_health_thread()
971 rc = genwqe_recover_card(cd, 0); genwqe_health_thread()
978 if (cd->card_state == GENWQE_CARD_RELOAD_BITSTREAM) { genwqe_health_thread()
980 rc = genwqe_reload_bistream(cd); genwqe_health_thread()
985 cd->last_gfir = gfir; genwqe_health_thread()
992 if (cd->use_platform_recovery) { genwqe_health_thread()
998 readq(cd->mmio + IO_SLC_CFGREG_GFIR); genwqe_health_thread()
1009 rc = genwqe_platform_recovery(cd); genwqe_health_thread()
1018 cd->card_state = GENWQE_CARD_FATAL_ERROR; genwqe_health_thread()
1019 genwqe_stop(cd); genwqe_health_thread()
1028 static int genwqe_health_check_start(struct genwqe_dev *cd) genwqe_health_check_start() argument
1036 /* init_waitqueue_head(&cd->health_waitq); */ genwqe_health_check_start()
1038 cd->health_thread = kthread_run(genwqe_health_thread, cd, genwqe_health_check_start()
1040 cd->card_idx); genwqe_health_check_start()
1041 if (IS_ERR(cd->health_thread)) { genwqe_health_check_start()
1042 rc = PTR_ERR(cd->health_thread); genwqe_health_check_start()
1043 cd->health_thread = NULL; genwqe_health_check_start()
1049 static int genwqe_health_thread_running(struct genwqe_dev *cd) genwqe_health_thread_running() argument
1051 return cd->health_thread != NULL; genwqe_health_thread_running()
1054 static int genwqe_health_check_stop(struct genwqe_dev *cd) genwqe_health_check_stop() argument
1058 if (!genwqe_health_thread_running(cd)) genwqe_health_check_stop()
1061 rc = kthread_stop(cd->health_thread); genwqe_health_check_stop()
1062 cd->health_thread = NULL; genwqe_health_check_stop()
1069 static int genwqe_pci_setup(struct genwqe_dev *cd) genwqe_pci_setup() argument
1072 struct pci_dev *pci_dev = cd->pci_dev; genwqe_pci_setup()
1123 cd->mmio_len = pci_resource_len(pci_dev, 0); genwqe_pci_setup()
1124 cd->mmio = pci_iomap(pci_dev, 0, 0); genwqe_pci_setup()
1125 if (cd->mmio == NULL) { genwqe_pci_setup()
1132 cd->num_vfs = pci_sriov_get_totalvfs(pci_dev); genwqe_pci_setup()
1133 if (cd->num_vfs < 0) genwqe_pci_setup()
1134 cd->num_vfs = 0; genwqe_pci_setup()
1136 err = genwqe_read_ids(cd); genwqe_pci_setup()
1143 pci_iounmap(pci_dev, cd->mmio); genwqe_pci_setup()
1155 static void genwqe_pci_remove(struct genwqe_dev *cd) genwqe_pci_remove() argument
1158 struct pci_dev *pci_dev = cd->pci_dev; genwqe_pci_remove()
1160 if (cd->mmio) genwqe_pci_remove()
1161 pci_iounmap(pci_dev, cd->mmio); genwqe_pci_remove()
1180 struct genwqe_dev *cd; genwqe_probe() local
1184 cd = genwqe_dev_alloc(); genwqe_probe()
1185 if (IS_ERR(cd)) { genwqe_probe()
1187 (int)PTR_ERR(cd)); genwqe_probe()
1188 return PTR_ERR(cd); genwqe_probe()
1191 dev_set_drvdata(&pci_dev->dev, cd); genwqe_probe()
1192 cd->pci_dev = pci_dev; genwqe_probe()
1194 err = genwqe_pci_setup(cd); genwqe_probe()
1201 err = genwqe_start(cd); genwqe_probe()
1208 if (genwqe_is_privileged(cd)) { genwqe_probe()
1209 err = genwqe_health_check_start(cd); genwqe_probe()
1220 genwqe_stop(cd); genwqe_probe()
1222 genwqe_pci_remove(cd); genwqe_probe()
1224 genwqe_dev_free(cd); genwqe_probe()
1235 struct genwqe_dev *cd = dev_get_drvdata(&pci_dev->dev); genwqe_remove() local
1237 genwqe_health_check_stop(cd); genwqe_remove()
1244 genwqe_stop(cd); genwqe_remove()
1245 genwqe_pci_remove(cd); genwqe_remove()
1246 genwqe_dev_free(cd); genwqe_remove()
1258 struct genwqe_dev *cd; genwqe_err_error_detected() local
1262 cd = dev_get_drvdata(&pci_dev->dev); genwqe_err_error_detected()
1263 if (cd == NULL) genwqe_err_error_detected()
1267 genwqe_health_check_stop(cd); genwqe_err_error_detected()
1268 genwqe_stop(cd); genwqe_err_error_detected()
1278 genwqe_pci_remove(cd); genwqe_err_error_detected()
1286 struct genwqe_dev *cd = dev_get_drvdata(&pci_dev->dev); genwqe_err_slot_reset() local
1288 rc = genwqe_pci_setup(cd); genwqe_err_slot_reset()
1306 struct genwqe_dev *cd = dev_get_drvdata(&pci_dev->dev); genwqe_err_resume() local
1308 rc = genwqe_start(cd); genwqe_err_resume()
1310 rc = genwqe_health_check_start(cd); genwqe_err_resume()
1324 struct genwqe_dev *cd = dev_get_drvdata(&dev->dev); genwqe_sriov_configure() local
1327 genwqe_setup_vf_jtimer(cd); genwqe_sriov_configure()
H A Dcard_debugfs.c66 struct genwqe_dev *cd = s->private; curr_dbg_uidn_show() local
70 entries = genwqe_ffdc_buff_size(cd, uid); curr_dbg_uidn_show()
81 genwqe_stop_traps(cd); /* halt the traps while dumping data */ curr_dbg_uidn_show()
82 genwqe_ffdc_buff_read(cd, uid, regs, entries); curr_dbg_uidn_show()
83 genwqe_start_traps(cd); curr_dbg_uidn_show()
113 struct genwqe_dev *cd = s->private; prev_dbg_uidn_show() local
115 dbg_uidn_show(s, cd->ffdc[uid].regs, cd->ffdc[uid].entries); prev_dbg_uidn_show()
142 struct genwqe_dev *cd = s->private; genwqe_curr_regs_show() local
150 genwqe_stop_traps(cd); genwqe_curr_regs_show()
151 genwqe_read_ffdc_regs(cd, regs, GENWQE_FFDC_REGS, 1); genwqe_curr_regs_show()
152 genwqe_start_traps(cd); genwqe_curr_regs_show()
171 struct genwqe_dev *cd = s->private; genwqe_prev_regs_show() local
173 struct genwqe_reg *regs = cd->ffdc[GENWQE_DBG_REGS].regs; genwqe_prev_regs_show()
195 struct genwqe_dev *cd = s->private; genwqe_jtimer_show() local
199 jtimer = genwqe_read_vreg(cd, IO_SLC_VF_APPJOB_TIMEOUT, 0); genwqe_jtimer_show()
203 for (vf_num = 0; vf_num < cd->num_vfs; vf_num++) { genwqe_jtimer_show()
204 jtimer = genwqe_read_vreg(cd, IO_SLC_VF_APPJOB_TIMEOUT, genwqe_jtimer_show()
207 cd->vf_jobtimeout_msec[vf_num]); genwqe_jtimer_show()
216 struct genwqe_dev *cd = s->private; genwqe_queue_working_time_show() local
220 t = genwqe_read_vreg(cd, IO_SLC_VF_QUEUE_WTIME, 0); genwqe_queue_working_time_show()
223 for (vf_num = 0; vf_num < cd->num_vfs; vf_num++) { genwqe_queue_working_time_show()
224 t = genwqe_read_vreg(cd, IO_SLC_VF_QUEUE_WTIME, vf_num + 1); genwqe_queue_working_time_show()
234 struct genwqe_dev *cd = s->private; genwqe_ddcb_info_show() local
239 queue = &cd->queue; genwqe_ddcb_info_show()
256 cd->irqs_processed); genwqe_ddcb_info_show()
269 __genwqe_readq(cd, queue->IO_QUEUE_CONFIG), genwqe_ddcb_info_show()
271 __genwqe_readq(cd, queue->IO_QUEUE_STATUS), genwqe_ddcb_info_show()
273 __genwqe_readq(cd, queue->IO_QUEUE_SEGMENT), genwqe_ddcb_info_show()
275 __genwqe_readq(cd, queue->IO_QUEUE_INITSQN), genwqe_ddcb_info_show()
277 __genwqe_readq(cd, queue->IO_QUEUE_WRAP), genwqe_ddcb_info_show()
279 __genwqe_readq(cd, queue->IO_QUEUE_OFFSET), genwqe_ddcb_info_show()
281 __genwqe_readq(cd, queue->IO_QUEUE_WTIME), genwqe_ddcb_info_show()
283 __genwqe_readq(cd, queue->IO_QUEUE_ERRCNTS), genwqe_ddcb_info_show()
285 __genwqe_readq(cd, queue->IO_QUEUE_LRW)); genwqe_ddcb_info_show()
307 struct genwqe_dev *cd = s->private; genwqe_info_show() local
310 struct pci_dev *pci_dev = cd->pci_dev; genwqe_info_show()
312 slu_id = __genwqe_readq(cd, IO_SLU_UNITCFG); genwqe_info_show()
313 app_id = __genwqe_readq(cd, IO_APP_UNITCFG); genwqe_info_show()
315 if (genwqe_is_privileged(cd)) genwqe_info_show()
316 bitstream = __genwqe_readq(cd, IO_SLU_BITSTREAM); genwqe_info_show()
329 genwqe_is_privileged(cd) ? genwqe_info_show()
331 cd->card_idx, slu_id, app_id, genwqe_info_show()
335 genwqe_base_clock_frequency(cd), genwqe_info_show()
344 int genwqe_init_debugfs(struct genwqe_dev *cd) genwqe_init_debugfs() argument
353 sprintf(card_name, "%s%d_card", GENWQE_DEVNAME, cd->card_idx); genwqe_init_debugfs()
355 root = debugfs_create_dir(card_name, cd->debugfs_genwqe); genwqe_init_debugfs()
362 file = debugfs_create_file("ddcb_info", S_IRUGO, root, cd, genwqe_init_debugfs()
369 file = debugfs_create_file("info", S_IRUGO, root, cd, genwqe_init_debugfs()
376 file = debugfs_create_x64("err_inject", 0666, root, &cd->err_inject); genwqe_init_debugfs()
383 &cd->ddcb_software_timeout); genwqe_init_debugfs()
390 &cd->kill_timeout); genwqe_init_debugfs()
397 if (!genwqe_is_privileged(cd)) { genwqe_init_debugfs()
398 cd->debugfs_root = root; genwqe_init_debugfs()
402 file = debugfs_create_file("curr_regs", S_IRUGO, root, cd, genwqe_init_debugfs()
409 file = debugfs_create_file("curr_dbg_uid0", S_IRUGO, root, cd, genwqe_init_debugfs()
416 file = debugfs_create_file("curr_dbg_uid1", S_IRUGO, root, cd, genwqe_init_debugfs()
423 file = debugfs_create_file("curr_dbg_uid2", S_IRUGO, root, cd, genwqe_init_debugfs()
430 file = debugfs_create_file("prev_regs", S_IRUGO, root, cd, genwqe_init_debugfs()
437 file = debugfs_create_file("prev_dbg_uid0", S_IRUGO, root, cd, genwqe_init_debugfs()
444 file = debugfs_create_file("prev_dbg_uid1", S_IRUGO, root, cd, genwqe_init_debugfs()
451 file = debugfs_create_file("prev_dbg_uid2", S_IRUGO, root, cd, genwqe_init_debugfs()
462 &cd->vf_jobtimeout_msec[i]); genwqe_init_debugfs()
469 file = debugfs_create_file("jobtimer", S_IRUGO, root, cd, genwqe_init_debugfs()
476 file = debugfs_create_file("queue_working_time", S_IRUGO, root, cd, genwqe_init_debugfs()
484 &cd->skip_recovery); genwqe_init_debugfs()
491 &cd->use_platform_recovery); genwqe_init_debugfs()
497 cd->debugfs_root = root; genwqe_init_debugfs()
505 void genqwe_exit_debugfs(struct genwqe_dev *cd) genqwe_exit_debugfs() argument
507 debugfs_remove_recursive(cd->debugfs_root); genqwe_exit_debugfs()
H A Dcard_dev.c40 static int genwqe_open_files(struct genwqe_dev *cd) genwqe_open_files() argument
45 spin_lock_irqsave(&cd->file_lock, flags); genwqe_open_files()
46 rc = list_empty(&cd->file_list); genwqe_open_files()
47 spin_unlock_irqrestore(&cd->file_lock, flags); genwqe_open_files()
51 static void genwqe_add_file(struct genwqe_dev *cd, struct genwqe_file *cfile) genwqe_add_file() argument
56 spin_lock_irqsave(&cd->file_lock, flags); genwqe_add_file()
57 list_add(&cfile->list, &cd->file_list); genwqe_add_file()
58 spin_unlock_irqrestore(&cd->file_lock, flags); genwqe_add_file()
61 static int genwqe_del_file(struct genwqe_dev *cd, struct genwqe_file *cfile) genwqe_del_file() argument
65 spin_lock_irqsave(&cd->file_lock, flags); genwqe_del_file()
67 spin_unlock_irqrestore(&cd->file_lock, flags); genwqe_del_file()
164 struct pci_dev *pci_dev = cfile->cd->pci_dev; __genwqe_search_mapping()
200 struct genwqe_dev *cd = cfile->cd; genwqe_remove_mappings() local
201 struct pci_dev *pci_dev = cfile->cd->pci_dev; genwqe_remove_mappings()
223 __genwqe_free_consistent(cd, dma_map->size, genwqe_remove_mappings()
229 genwqe_user_vunmap(cd, dma_map, NULL); genwqe_remove_mappings()
238 struct genwqe_dev *cd = cfile->cd; genwqe_remove_pinnings() local
252 genwqe_user_vunmap(cd, dma_map, NULL); genwqe_remove_pinnings()
260 * E.g. genwqe_send_signal(cd, SIGIO);
262 static int genwqe_kill_fasync(struct genwqe_dev *cd, int sig) genwqe_kill_fasync() argument
268 spin_lock_irqsave(&cd->file_lock, flags); genwqe_kill_fasync()
269 list_for_each_entry(cfile, &cd->file_list, list) { genwqe_kill_fasync()
274 spin_unlock_irqrestore(&cd->file_lock, flags); genwqe_kill_fasync()
278 static int genwqe_force_sig(struct genwqe_dev *cd, int sig) genwqe_force_sig() argument
284 spin_lock_irqsave(&cd->file_lock, flags); genwqe_force_sig()
285 list_for_each_entry(cfile, &cd->file_list, list) { genwqe_force_sig()
289 spin_unlock_irqrestore(&cd->file_lock, flags); genwqe_force_sig()
305 struct genwqe_dev *cd; genwqe_open() local
313 cd = container_of(inode->i_cdev, struct genwqe_dev, cdev_genwqe); genwqe_open()
314 pci_dev = cd->pci_dev; genwqe_open()
315 cfile->cd = cd; genwqe_open()
327 genwqe_add_file(cd, cfile); genwqe_open()
366 struct genwqe_dev *cd = cfile->cd; genwqe_release() local
376 * For this to work we must not release cd when this cfile is genwqe_release()
380 genwqe_del_file(cd, cfile); genwqe_release()
400 struct genwqe_dev *cd = container_of(inode->i_cdev, struct genwqe_dev, genwqe_vma_close() local
402 struct pci_dev *pci_dev = cd->pci_dev; genwqe_vma_close()
416 __genwqe_free_consistent(cd, dma_map->size, dma_map->k_vaddr, genwqe_vma_close()
443 struct genwqe_dev *cd = cfile->cd; genwqe_mmap() local
460 dma_map->k_vaddr = __genwqe_alloc_consistent(cd, vsize, genwqe_mmap()
488 __genwqe_free_consistent(cd, dma_map->size, genwqe_mmap()
498 * @cd: genwqe device
518 struct genwqe_dev *cd = cfile->cd; do_flash_update() local
520 struct pci_dev *pci_dev = cd->pci_dev; do_flash_update()
544 xbuf = __genwqe_alloc_consistent(cd, FLASH_BLOCK, &dma_addr); do_flash_update()
581 if (genwqe_get_slu_id(cd) <= 0x2) { do_flash_update()
614 rc = __genwqe_execute_raw_ddcb(cd, req, filp->f_flags); do_flash_update()
639 __genwqe_free_consistent(cd, FLASH_BLOCK, xbuf, dma_addr); do_flash_update()
653 struct genwqe_dev *cd = cfile->cd; do_flash_read() local
655 struct pci_dev *pci_dev = cd->pci_dev; do_flash_read()
680 xbuf = __genwqe_alloc_consistent(cd, FLASH_BLOCK, &dma_addr); do_flash_read()
707 if (genwqe_get_slu_id(cd) <= 0x2) { do_flash_read()
732 rc = __genwqe_execute_raw_ddcb(cd, cmd, filp->f_flags); do_flash_read()
769 __genwqe_free_consistent(cd, FLASH_BLOCK, xbuf, dma_addr); do_flash_read()
776 struct genwqe_dev *cd = cfile->cd; genwqe_pin_mem() local
777 struct pci_dev *pci_dev = cfile->cd->pci_dev; genwqe_pin_mem()
793 rc = genwqe_user_vmap(cd, dma_map, (void *)map_addr, map_size, NULL); genwqe_pin_mem()
807 struct genwqe_dev *cd = cfile->cd; genwqe_unpin_mem() local
823 genwqe_user_vunmap(cd, dma_map, NULL); genwqe_unpin_mem()
837 struct genwqe_dev *cd = cfile->cd; ddcb_cmd_cleanup() local
844 genwqe_user_vunmap(cd, dma_map, req); ddcb_cmd_cleanup()
847 genwqe_free_sync_sgl(cd, &req->sgls[i]); ddcb_cmd_cleanup()
864 struct genwqe_dev *cd = cfile->cd; ddcb_cmd_fixups() local
945 rc = genwqe_user_vmap(cd, m, (void *)u_addr, ddcb_cmd_fixups()
955 rc = genwqe_alloc_sync_sgl(cd, &req->sgls[i], ddcb_cmd_fixups()
961 genwqe_setup_sgl(cd, &req->sgls[i], ddcb_cmd_fixups()
992 struct genwqe_dev *cd = cfile->cd; genwqe_execute_ddcb() local
1000 rc = __genwqe_execute_raw_ddcb(cd, cmd, filp->f_flags); genwqe_execute_ddcb()
1011 struct genwqe_dev *cd = cfile->cd; do_execute_ddcb() local
1028 rc = __genwqe_execute_raw_ddcb(cd, cmd, filp->f_flags); do_execute_ddcb()
1055 struct genwqe_dev *cd = cfile->cd; genwqe_ioctl() local
1056 struct pci_dev *pci_dev = cd->pci_dev; genwqe_ioctl()
1071 put_user(cd->card_state, (enum genwqe_card_state __user *)arg); genwqe_ioctl()
1081 if ((reg_offs >= cd->mmio_len) || (reg_offs & 0x7)) genwqe_ioctl()
1084 val = __genwqe_readq(cd, reg_offs); genwqe_ioctl()
1101 if ((reg_offs >= cd->mmio_len) || (reg_offs & 0x7)) genwqe_ioctl()
1107 __genwqe_writeq(cd, reg_offs, val); genwqe_ioctl()
1117 if ((reg_offs >= cd->mmio_len) || (reg_offs & 0x3)) genwqe_ioctl()
1120 val = __genwqe_readl(cd, reg_offs); genwqe_ioctl()
1137 if ((reg_offs >= cd->mmio_len) || (reg_offs & 0x3)) genwqe_ioctl()
1143 __genwqe_writel(cd, reg_offs, val); genwqe_ioctl()
1151 if (!genwqe_is_privileged(cd)) genwqe_ioctl()
1172 if (!genwqe_is_privileged(cd)) genwqe_ioctl()
1175 if (genwqe_flash_readback_fails(cd)) genwqe_ioctl()
1258 static int genwqe_device_initialized(struct genwqe_dev *cd) genwqe_device_initialized() argument
1260 return cd->dev != NULL; genwqe_device_initialized()
1265 * @cd: genwqe device descriptor
1271 int genwqe_device_create(struct genwqe_dev *cd) genwqe_device_create() argument
1274 struct pci_dev *pci_dev = cd->pci_dev; genwqe_device_create()
1282 rc = alloc_chrdev_region(&cd->devnum_genwqe, 0, genwqe_device_create()
1289 cdev_init(&cd->cdev_genwqe, &genwqe_fops); genwqe_device_create()
1290 cd->cdev_genwqe.owner = THIS_MODULE; genwqe_device_create()
1292 rc = cdev_add(&cd->cdev_genwqe, cd->devnum_genwqe, 1); genwqe_device_create()
1302 cd->dev = device_create_with_groups(cd->class_genwqe, genwqe_device_create()
1303 &cd->pci_dev->dev, genwqe_device_create()
1304 cd->devnum_genwqe, cd, genwqe_device_create()
1307 cd->card_idx); genwqe_device_create()
1308 if (IS_ERR(cd->dev)) { genwqe_device_create()
1309 rc = PTR_ERR(cd->dev); genwqe_device_create()
1313 rc = genwqe_init_debugfs(cd); genwqe_device_create()
1320 device_destroy(cd->class_genwqe, cd->devnum_genwqe); genwqe_device_create()
1322 cdev_del(&cd->cdev_genwqe); genwqe_device_create()
1324 unregister_chrdev_region(cd->devnum_genwqe, GENWQE_MAX_MINOR); genwqe_device_create()
1326 cd->dev = NULL; genwqe_device_create()
1330 static int genwqe_inform_and_stop_processes(struct genwqe_dev *cd) genwqe_inform_and_stop_processes() argument
1334 struct pci_dev *pci_dev = cd->pci_dev; genwqe_inform_and_stop_processes()
1336 if (!genwqe_open_files(cd)) genwqe_inform_and_stop_processes()
1341 rc = genwqe_kill_fasync(cd, SIGIO); genwqe_inform_and_stop_processes()
1345 genwqe_open_files(cd); i++) { genwqe_inform_and_stop_processes()
1353 if (!genwqe_open_files(cd)) genwqe_inform_and_stop_processes()
1359 rc = genwqe_force_sig(cd, SIGKILL); /* force terminate */ genwqe_inform_and_stop_processes()
1363 genwqe_open_files(cd); i++) { genwqe_inform_and_stop_processes()
1383 int genwqe_device_remove(struct genwqe_dev *cd) genwqe_device_remove() argument
1386 struct pci_dev *pci_dev = cd->pci_dev; genwqe_device_remove()
1388 if (!genwqe_device_initialized(cd)) genwqe_device_remove()
1391 genwqe_inform_and_stop_processes(cd); genwqe_device_remove()
1399 rc = atomic_read(&cd->cdev_genwqe.kobj.kref.refcount); genwqe_device_remove()
1406 genqwe_exit_debugfs(cd); genwqe_device_remove()
1407 device_destroy(cd->class_genwqe, cd->devnum_genwqe); genwqe_device_remove()
1408 cdev_del(&cd->cdev_genwqe); genwqe_device_remove()
1409 unregister_chrdev_region(cd->devnum_genwqe, GENWQE_MAX_MINOR); genwqe_device_remove()
1410 cd->dev = NULL; genwqe_device_remove()
H A Dcard_utils.c48 * @cd: genwqe device descriptor
54 int __genwqe_writeq(struct genwqe_dev *cd, u64 byte_offs, u64 val) __genwqe_writeq() argument
56 struct pci_dev *pci_dev = cd->pci_dev; __genwqe_writeq()
58 if (cd->err_inject & GENWQE_INJECT_HARDWARE_FAILURE) __genwqe_writeq()
61 if (cd->mmio == NULL) __genwqe_writeq()
67 __raw_writeq((__force u64)cpu_to_be64(val), cd->mmio + byte_offs); __genwqe_writeq()
73 * @cd: genwqe device descriptor
78 u64 __genwqe_readq(struct genwqe_dev *cd, u64 byte_offs) __genwqe_readq() argument
80 if (cd->err_inject & GENWQE_INJECT_HARDWARE_FAILURE) __genwqe_readq()
83 if ((cd->err_inject & GENWQE_INJECT_GFIR_FATAL) && __genwqe_readq()
87 if ((cd->err_inject & GENWQE_INJECT_GFIR_INFO) && __genwqe_readq()
91 if (cd->mmio == NULL) __genwqe_readq()
94 return be64_to_cpu((__force __be64)__raw_readq(cd->mmio + byte_offs)); __genwqe_readq()
99 * @cd: genwqe device descriptor
105 int __genwqe_writel(struct genwqe_dev *cd, u64 byte_offs, u32 val) __genwqe_writel() argument
107 struct pci_dev *pci_dev = cd->pci_dev; __genwqe_writel()
109 if (cd->err_inject & GENWQE_INJECT_HARDWARE_FAILURE) __genwqe_writel()
112 if (cd->mmio == NULL) __genwqe_writel()
118 __raw_writel((__force u32)cpu_to_be32(val), cd->mmio + byte_offs); __genwqe_writel()
124 * @cd: genwqe device descriptor
129 u32 __genwqe_readl(struct genwqe_dev *cd, u64 byte_offs) __genwqe_readl() argument
131 if (cd->err_inject & GENWQE_INJECT_HARDWARE_FAILURE) __genwqe_readl()
134 if (cd->mmio == NULL) __genwqe_readl()
137 return be32_to_cpu((__force __be32)__raw_readl(cd->mmio + byte_offs)); __genwqe_readl()
145 int genwqe_read_app_id(struct genwqe_dev *cd, char *app_name, int len) genwqe_read_app_id() argument
148 u32 app_id = (u32)cd->app_unitcfg; genwqe_read_app_id()
217 void *__genwqe_alloc_consistent(struct genwqe_dev *cd, size_t size, __genwqe_alloc_consistent() argument
223 return pci_alloc_consistent(cd->pci_dev, size, dma_handle); __genwqe_alloc_consistent()
226 void __genwqe_free_consistent(struct genwqe_dev *cd, size_t size, __genwqe_free_consistent() argument
232 pci_free_consistent(cd->pci_dev, size, vaddr, dma_handle); __genwqe_free_consistent()
235 static void genwqe_unmap_pages(struct genwqe_dev *cd, dma_addr_t *dma_list, genwqe_unmap_pages() argument
239 struct pci_dev *pci_dev = cd->pci_dev; genwqe_unmap_pages()
248 static int genwqe_map_pages(struct genwqe_dev *cd, genwqe_map_pages() argument
253 struct pci_dev *pci_dev = cd->pci_dev; genwqe_map_pages()
277 genwqe_unmap_pages(cd, dma_list, num_pages); genwqe_map_pages()
297 int genwqe_alloc_sync_sgl(struct genwqe_dev *cd, struct genwqe_sgl *sgl, genwqe_alloc_sync_sgl() argument
301 struct pci_dev *pci_dev = cd->pci_dev; genwqe_alloc_sync_sgl()
322 sgl->sgl = __genwqe_alloc_consistent(cd, sgl->sgl_size, genwqe_alloc_sync_sgl()
332 sgl->fpage = __genwqe_alloc_consistent(cd, PAGE_SIZE, genwqe_alloc_sync_sgl()
345 sgl->lpage = __genwqe_alloc_consistent(cd, PAGE_SIZE, genwqe_alloc_sync_sgl()
360 __genwqe_free_consistent(cd, PAGE_SIZE, sgl->fpage, genwqe_alloc_sync_sgl()
363 __genwqe_free_consistent(cd, sgl->sgl_size, sgl->sgl, genwqe_alloc_sync_sgl()
368 int genwqe_setup_sgl(struct genwqe_dev *cd, struct genwqe_sgl *sgl, genwqe_setup_sgl() argument
465 int genwqe_free_sync_sgl(struct genwqe_dev *cd, struct genwqe_sgl *sgl) genwqe_free_sync_sgl() argument
468 struct pci_dev *pci_dev = cd->pci_dev; genwqe_free_sync_sgl()
477 __genwqe_free_consistent(cd, PAGE_SIZE, sgl->fpage, genwqe_free_sync_sgl()
490 __genwqe_free_consistent(cd, PAGE_SIZE, sgl->lpage, genwqe_free_sync_sgl()
495 __genwqe_free_consistent(cd, sgl->sgl_size, sgl->sgl, genwqe_free_sync_sgl()
536 * @cd: pointer to genwqe device
557 int genwqe_user_vmap(struct genwqe_dev *cd, struct dma_mapping *m, void *uaddr, genwqe_user_vmap() argument
562 struct pci_dev *pci_dev = cd->pci_dev; genwqe_user_vmap()
603 rc = genwqe_map_pages(cd, m->page_list, m->nr_pages, m->dma_list); genwqe_user_vmap()
625 * @cd: pointer to genwqe device
628 int genwqe_user_vunmap(struct genwqe_dev *cd, struct dma_mapping *m, genwqe_user_vunmap() argument
631 struct pci_dev *pci_dev = cd->pci_dev; genwqe_user_vunmap()
640 genwqe_unmap_pages(cd, m->dma_list, m->nr_pages); genwqe_user_vunmap()
658 * @cd: pointer to the genwqe device descriptor
664 u8 genwqe_card_type(struct genwqe_dev *cd) genwqe_card_type() argument
666 u64 card_type = cd->slu_unitcfg; genwqe_card_type()
673 * @cd: pointer to the genwqe device descriptor
675 int genwqe_card_reset(struct genwqe_dev *cd) genwqe_card_reset() argument
678 struct pci_dev *pci_dev = cd->pci_dev; genwqe_card_reset()
680 if (!genwqe_is_privileged(cd)) genwqe_card_reset()
684 __genwqe_writeq(cd, IO_SLC_CFGREG_SOFTRESET, 0x1ull); genwqe_card_reset()
686 __genwqe_readq(cd, IO_HSU_FIR_CLR); genwqe_card_reset()
687 __genwqe_readq(cd, IO_APP_FIR_CLR); genwqe_card_reset()
688 __genwqe_readq(cd, IO_SLU_FIR_CLR); genwqe_card_reset()
698 softrst = __genwqe_readq(cd, IO_SLC_CFGREG_SOFTRESET) & 0x3cull; genwqe_card_reset()
699 __genwqe_writeq(cd, IO_SLC_CFGREG_SOFTRESET, softrst | 0x2ull); genwqe_card_reset()
704 if (genwqe_need_err_masking(cd)) { genwqe_card_reset()
707 __genwqe_writeq(cd, IO_SLC_MISC_DEBUG, 0x0aull); genwqe_card_reset()
712 int genwqe_read_softreset(struct genwqe_dev *cd) genwqe_read_softreset() argument
716 if (!genwqe_is_privileged(cd)) genwqe_read_softreset()
719 bitstream = __genwqe_readq(cd, IO_SLU_BITSTREAM) & 0x1; genwqe_read_softreset()
720 cd->softreset = (bitstream == 0) ? 0x8ull : 0xcull; genwqe_read_softreset()
726 * @cd: pointer to the device
729 int genwqe_set_interrupt_capability(struct genwqe_dev *cd, int count) genwqe_set_interrupt_capability() argument
732 struct pci_dev *pci_dev = cd->pci_dev; genwqe_set_interrupt_capability()
738 cd->flags |= GENWQE_FLAG_MSI_ENABLED; genwqe_set_interrupt_capability()
744 * @cd: pointer to the device
746 void genwqe_reset_interrupt_capability(struct genwqe_dev *cd) genwqe_reset_interrupt_capability() argument
748 struct pci_dev *pci_dev = cd->pci_dev; genwqe_reset_interrupt_capability()
750 if (cd->flags & GENWQE_FLAG_MSI_ENABLED) { genwqe_reset_interrupt_capability()
752 cd->flags &= ~GENWQE_FLAG_MSI_ENABLED; genwqe_reset_interrupt_capability()
758 * @cd: card device
766 static int set_reg_idx(struct genwqe_dev *cd, struct genwqe_reg *r, set_reg_idx() argument
780 static int set_reg(struct genwqe_dev *cd, struct genwqe_reg *r, set_reg() argument
783 return set_reg_idx(cd, r, i, m, addr, 0, val); set_reg()
786 int genwqe_read_ffdc_regs(struct genwqe_dev *cd, struct genwqe_reg *regs, genwqe_read_ffdc_regs() argument
794 gfir = __genwqe_readq(cd, IO_SLC_CFGREG_GFIR); genwqe_read_ffdc_regs()
795 set_reg(cd, regs, &idx, max_regs, IO_SLC_CFGREG_GFIR, gfir); genwqe_read_ffdc_regs()
798 sluid = __genwqe_readq(cd, IO_SLU_UNITCFG); /* 0x00000000 */ genwqe_read_ffdc_regs()
799 set_reg(cd, regs, &idx, max_regs, IO_SLU_UNITCFG, sluid); genwqe_read_ffdc_regs()
802 appid = __genwqe_readq(cd, IO_APP_UNITCFG); /* 0x02000000 */ genwqe_read_ffdc_regs()
803 set_reg(cd, regs, &idx, max_regs, IO_APP_UNITCFG, appid); genwqe_read_ffdc_regs()
810 ufir = __genwqe_readq(cd, ufir_addr); genwqe_read_ffdc_regs()
811 set_reg(cd, regs, &idx, max_regs, ufir_addr, ufir); genwqe_read_ffdc_regs()
815 ufec = __genwqe_readq(cd, ufec_addr); genwqe_read_ffdc_regs()
816 set_reg(cd, regs, &idx, max_regs, ufec_addr, ufec); genwqe_read_ffdc_regs()
824 sfir = __genwqe_readq(cd, sfir_addr); genwqe_read_ffdc_regs()
825 set_reg(cd, regs, &idx, max_regs, sfir_addr, sfir); genwqe_read_ffdc_regs()
828 sfec = __genwqe_readq(cd, sfec_addr); genwqe_read_ffdc_regs()
829 set_reg(cd, regs, &idx, max_regs, sfec_addr, sfec); genwqe_read_ffdc_regs()
844 int genwqe_ffdc_buff_size(struct genwqe_dev *cd, int uid) genwqe_ffdc_buff_size() argument
851 eevptr = __genwqe_readq(cd, eevptr_addr); genwqe_ffdc_buff_size()
857 val = __genwqe_readq(cd, l_addr); genwqe_ffdc_buff_size()
880 val = __genwqe_readq(cd, addr); genwqe_ffdc_buff_size()
897 int genwqe_ffdc_buff_read(struct genwqe_dev *cd, int uid, genwqe_ffdc_buff_read() argument
906 eevptr = __genwqe_readq(cd, eevptr_addr); genwqe_ffdc_buff_read()
911 e = __genwqe_readq(cd, l_addr); genwqe_ffdc_buff_read()
922 val = __genwqe_readq(cd, d_addr); genwqe_ffdc_buff_read()
923 set_reg_idx(cd, regs, &idx, max_regs, genwqe_ffdc_buff_read()
929 val = __genwqe_readq(cd, d_addr); genwqe_ffdc_buff_read()
930 set_reg_idx(cd, regs, &idx, max_regs, genwqe_ffdc_buff_read()
945 val = __genwqe_readq(cd, addr); genwqe_ffdc_buff_read()
963 __genwqe_writeq(cd, addr, diag_sel); genwqe_ffdc_buff_read()
970 val = __genwqe_readq(cd, addr); genwqe_ffdc_buff_read()
971 set_reg_idx(cd, regs, &idx, max_regs, addr, genwqe_ffdc_buff_read()
985 int genwqe_write_vreg(struct genwqe_dev *cd, u32 reg, u64 val, int func) genwqe_write_vreg() argument
987 __genwqe_writeq(cd, IO_PF_SLC_VIRTUAL_WINDOW, func & 0xf); genwqe_write_vreg()
988 __genwqe_writeq(cd, reg, val); genwqe_write_vreg()
998 u64 genwqe_read_vreg(struct genwqe_dev *cd, u32 reg, int func) genwqe_read_vreg() argument
1000 __genwqe_writeq(cd, IO_PF_SLC_VIRTUAL_WINDOW, func & 0xf); genwqe_read_vreg()
1001 return __genwqe_readq(cd, reg); genwqe_read_vreg()
1016 int genwqe_base_clock_frequency(struct genwqe_dev *cd) genwqe_base_clock_frequency() argument
1021 speed = (u16)((cd->slu_unitcfg >> 28) & 0x0full); genwqe_base_clock_frequency()
1033 void genwqe_stop_traps(struct genwqe_dev *cd) genwqe_stop_traps() argument
1035 __genwqe_writeq(cd, IO_SLC_MISC_DEBUG_SET, 0xcull); genwqe_stop_traps()
1043 void genwqe_start_traps(struct genwqe_dev *cd) genwqe_start_traps() argument
1045 __genwqe_writeq(cd, IO_SLC_MISC_DEBUG_CLR, 0xcull); genwqe_start_traps()
1047 if (genwqe_need_err_masking(cd)) genwqe_start_traps()
1048 __genwqe_writeq(cd, IO_SLC_MISC_DEBUG, 0x0aull); genwqe_start_traps()
H A Dcard_sysfs.c50 struct genwqe_dev *cd = dev_get_drvdata(dev); status_show() local
53 return sprintf(buf, "%s\n", cs[cd->card_state]); status_show()
61 struct genwqe_dev *cd = dev_get_drvdata(dev); appid_show() local
63 genwqe_read_app_id(cd, app_name, sizeof(app_name)); appid_show()
72 struct genwqe_dev *cd = dev_get_drvdata(dev); version_show() local
74 slu_id = __genwqe_readq(cd, IO_SLU_UNITCFG); version_show()
75 app_id = __genwqe_readq(cd, IO_APP_UNITCFG); version_show()
85 struct genwqe_dev *cd = dev_get_drvdata(dev); type_show() local
87 card_type = genwqe_card_type(cd); type_show()
97 struct genwqe_dev *cd = dev_get_drvdata(dev); tempsens_show() local
99 tempsens = __genwqe_readq(cd, IO_SLU_TEMPERATURE_SENSOR); tempsens_show()
109 struct genwqe_dev *cd = dev_get_drvdata(dev); freerunning_timer_show() local
111 t = __genwqe_readq(cd, IO_SLC_FREE_RUNNING_TIMER); freerunning_timer_show()
121 struct genwqe_dev *cd = dev_get_drvdata(dev); queue_working_time_show() local
123 t = __genwqe_readq(cd, IO_SLC_QUEUE_WTIME); queue_working_time_show()
133 struct genwqe_dev *cd = dev_get_drvdata(dev); base_clock_show() local
135 base_clock = genwqe_base_clock_frequency(cd); base_clock_show()
160 struct genwqe_dev *cd = dev_get_drvdata(dev); curr_bitstream_show() local
162 curr_bitstream = __genwqe_readq(cd, IO_SLU_BITSTREAM) & 0x1; curr_bitstream_show()
176 struct genwqe_dev *cd = dev_get_drvdata(dev); next_bitstream_show() local
178 switch ((cd->softreset & 0xc) >> 2) { next_bitstream_show()
197 struct genwqe_dev *cd = dev_get_drvdata(dev); next_bitstream_store() local
204 cd->softreset = 0x78; next_bitstream_store()
207 cd->softreset = 0x7c; next_bitstream_store()
213 __genwqe_writeq(cd, IO_SLC_CFGREG_SOFTRESET, cd->softreset); next_bitstream_store()
223 struct genwqe_dev *cd = dev_get_drvdata(dev); reload_bitstream_store() local
229 if (cd->card_state == GENWQE_CARD_UNUSED || reload_bitstream_store()
230 cd->card_state == GENWQE_CARD_USED) reload_bitstream_store()
231 cd->card_state = GENWQE_CARD_RELOAD_BITSTREAM; reload_bitstream_store()
282 struct genwqe_dev *cd = dev_get_drvdata(dev); genwqe_is_visible() local
285 if (genwqe_is_privileged(cd)) genwqe_is_visible()
H A Dcard_ddcb.c172 static void print_ddcb_info(struct genwqe_dev *cd, struct ddcb_queue *queue) print_ddcb_info() argument
177 struct pci_dev *pci_dev = cd->pci_dev; print_ddcb_info()
179 spin_lock_irqsave(&cd->print_lock, flags); print_ddcb_info()
183 cd->card_idx, queue->ddcb_act, queue->ddcb_next); print_ddcb_info()
199 spin_unlock_irqrestore(&cd->print_lock, flags); print_ddcb_info()
238 * @cd: pointer to genwqe device descriptor
250 static int ddcb_requ_finished(struct genwqe_dev *cd, struct ddcb_requ *req) ddcb_requ_finished() argument
253 (cd->card_state != GENWQE_CARD_USED); ddcb_requ_finished()
258 * @cd: pointer to genwqe device descriptor
274 static int enqueue_ddcb(struct genwqe_dev *cd, struct ddcb_queue *queue, enqueue_ddcb() argument
321 __genwqe_writeq(cd, queue->IO_QUEUE_OFFSET, num); /* start queue */ enqueue_ddcb()
367 * @cd: pointer to genwqe device descriptor
371 static int genwqe_check_ddcb_queue(struct genwqe_dev *cd, genwqe_check_ddcb_queue() argument
376 struct pci_dev *pci_dev = cd->pci_dev; genwqe_check_ddcb_queue()
416 errcnts = __genwqe_readq(cd, queue->IO_QUEUE_ERRCNTS); genwqe_check_ddcb_queue()
417 status = __genwqe_readq(cd, queue->IO_QUEUE_STATUS); genwqe_check_ddcb_queue()
468 * @cd: pointer to genwqe device descriptor
483 int __genwqe_wait_ddcb(struct genwqe_dev *cd, struct ddcb_requ *req) __genwqe_wait_ddcb() argument
488 struct pci_dev *pci_dev = cd->pci_dev; __genwqe_wait_ddcb()
502 ddcb_requ_finished(cd, req), __genwqe_wait_ddcb()
520 genwqe_check_ddcb_queue(cd, req->queue); __genwqe_wait_ddcb()
521 if (ddcb_requ_finished(cd, req)) __genwqe_wait_ddcb()
530 __genwqe_readq(cd, queue->IO_QUEUE_STATUS)); __genwqe_wait_ddcb()
535 print_ddcb_info(cd, req->queue); __genwqe_wait_ddcb()
553 if (cd->card_state != GENWQE_CARD_USED) { __genwqe_wait_ddcb()
564 * @cd: pointer to genwqe device descriptor
571 static struct ddcb *get_next_ddcb(struct genwqe_dev *cd, get_next_ddcb() argument
611 * @cd: genwqe device descriptor
624 int __genwqe_purge_ddcb(struct genwqe_dev *cd, struct ddcb_requ *req) __genwqe_purge_ddcb() argument
630 struct pci_dev *pci_dev = cd->pci_dev; __genwqe_purge_ddcb()
714 queue_status = __genwqe_readq(cd, queue->IO_QUEUE_STATUS); __genwqe_purge_ddcb()
724 print_ddcb_info(cd, req->queue); __genwqe_purge_ddcb()
729 int genwqe_init_debug_data(struct genwqe_dev *cd, struct genwqe_debug_data *d) genwqe_init_debug_data() argument
732 struct pci_dev *pci_dev = cd->pci_dev; genwqe_init_debug_data()
743 d->slu_unitcfg = cd->slu_unitcfg; genwqe_init_debug_data()
744 d->app_unitcfg = cd->app_unitcfg; genwqe_init_debug_data()
750 * @cd: pointer to genwqe device descriptor
758 int __genwqe_enqueue_ddcb(struct genwqe_dev *cd, struct ddcb_requ *req, __genwqe_enqueue_ddcb() argument
764 struct pci_dev *pci_dev = cd->pci_dev; __genwqe_enqueue_ddcb()
768 if (cd->card_state != GENWQE_CARD_USED) { __genwqe_enqueue_ddcb()
776 queue = req->queue = &cd->queue; __genwqe_enqueue_ddcb()
782 genwqe_check_ddcb_queue(cd, queue); __genwqe_enqueue_ddcb()
791 pddcb = get_next_ddcb(cd, queue, &req->num); /* get ptr and num */ __genwqe_enqueue_ddcb()
836 if ((cd->slu_unitcfg & 0xFFFF0ull) > 0x34199ull) __genwqe_enqueue_ddcb()
859 if (genwqe_get_slu_id(cd) <= 0x2) { __genwqe_enqueue_ddcb()
891 genwqe_init_debug_data(cd, &req->debug_data); __genwqe_enqueue_ddcb()
896 enqueue_ddcb(cd, queue, pddcb, req->num); __genwqe_enqueue_ddcb()
904 wake_up_interruptible(&cd->queue_waitq); __genwqe_enqueue_ddcb()
911 * @cd: pointer to genwqe device descriptor
915 int __genwqe_execute_raw_ddcb(struct genwqe_dev *cd, __genwqe_execute_raw_ddcb() argument
920 struct pci_dev *pci_dev = cd->pci_dev; __genwqe_execute_raw_ddcb()
933 rc = __genwqe_enqueue_ddcb(cd, req, f_flags); __genwqe_execute_raw_ddcb()
937 rc = __genwqe_wait_ddcb(cd, req); __genwqe_execute_raw_ddcb()
963 __genwqe_purge_ddcb(cd, req); __genwqe_execute_raw_ddcb()
980 static int genwqe_next_ddcb_ready(struct genwqe_dev *cd) genwqe_next_ddcb_ready() argument
984 struct ddcb_queue *queue = &cd->queue; genwqe_next_ddcb_ready()
1010 int genwqe_ddcbs_in_flight(struct genwqe_dev *cd) genwqe_ddcbs_in_flight() argument
1014 struct ddcb_queue *queue = &cd->queue; genwqe_ddcbs_in_flight()
1023 static int setup_ddcb_queue(struct genwqe_dev *cd, struct ddcb_queue *queue) setup_ddcb_queue() argument
1029 struct pci_dev *pci_dev = cd->pci_dev; setup_ddcb_queue()
1044 queue->ddcb_vaddr = __genwqe_alloc_consistent(cd, queue_size, setup_ddcb_queue()
1083 __genwqe_writeq(cd, queue->IO_QUEUE_CONFIG, 0x07); /* iCRC/vCRC */ setup_ddcb_queue()
1084 __genwqe_writeq(cd, queue->IO_QUEUE_SEGMENT, queue->ddcb_daddr); setup_ddcb_queue()
1085 __genwqe_writeq(cd, queue->IO_QUEUE_INITSQN, queue->ddcb_seq); setup_ddcb_queue()
1086 __genwqe_writeq(cd, queue->IO_QUEUE_WRAP, val64); setup_ddcb_queue()
1093 __genwqe_free_consistent(cd, queue_size, queue->ddcb_vaddr, setup_ddcb_queue()
1106 static void free_ddcb_queue(struct genwqe_dev *cd, struct ddcb_queue *queue) free_ddcb_queue() argument
1116 __genwqe_free_consistent(cd, queue_size, queue->ddcb_vaddr, free_ddcb_queue()
1126 struct genwqe_dev *cd = (struct genwqe_dev *)dev_id; genwqe_pf_isr() local
1127 struct pci_dev *pci_dev = cd->pci_dev; genwqe_pf_isr()
1133 cd->irqs_processed++; genwqe_pf_isr()
1134 wake_up_interruptible(&cd->queue_waitq); genwqe_pf_isr()
1140 gfir = __genwqe_readq(cd, IO_SLC_CFGREG_GFIR); genwqe_pf_isr()
1144 if (cd->use_platform_recovery) { genwqe_pf_isr()
1150 readq(cd->mmio + IO_SLC_CFGREG_GFIR); genwqe_pf_isr()
1157 wake_up_interruptible(&cd->health_waitq); genwqe_pf_isr()
1174 struct genwqe_dev *cd = (struct genwqe_dev *)dev_id; genwqe_vf_isr() local
1176 cd->irqs_processed++; genwqe_vf_isr()
1177 wake_up_interruptible(&cd->queue_waitq); genwqe_vf_isr()
1193 struct genwqe_dev *cd = (struct genwqe_dev *)data; genwqe_card_thread() local
1197 genwqe_check_ddcb_queue(cd, &cd->queue); genwqe_card_thread()
1201 cd->queue_waitq, genwqe_card_thread()
1202 genwqe_ddcbs_in_flight(cd) || genwqe_card_thread()
1206 cd->queue_waitq, genwqe_card_thread()
1207 genwqe_next_ddcb_ready(cd) || genwqe_card_thread()
1224 * @cd: pointer to genwqe device descriptor
1230 int genwqe_setup_service_layer(struct genwqe_dev *cd) genwqe_setup_service_layer() argument
1234 struct pci_dev *pci_dev = cd->pci_dev; genwqe_setup_service_layer()
1236 if (genwqe_is_privileged(cd)) { genwqe_setup_service_layer()
1237 rc = genwqe_card_reset(cd); genwqe_setup_service_layer()
1243 genwqe_read_softreset(cd); genwqe_setup_service_layer()
1246 queue = &cd->queue; genwqe_setup_service_layer()
1257 rc = setup_ddcb_queue(cd, queue); genwqe_setup_service_layer()
1263 init_waitqueue_head(&cd->queue_waitq); genwqe_setup_service_layer()
1264 cd->card_thread = kthread_run(genwqe_card_thread, cd, genwqe_setup_service_layer()
1266 cd->card_idx); genwqe_setup_service_layer()
1267 if (IS_ERR(cd->card_thread)) { genwqe_setup_service_layer()
1268 rc = PTR_ERR(cd->card_thread); genwqe_setup_service_layer()
1269 cd->card_thread = NULL; genwqe_setup_service_layer()
1273 rc = genwqe_set_interrupt_capability(cd, GENWQE_MSI_IRQS); genwqe_setup_service_layer()
1282 init_waitqueue_head(&cd->health_waitq); genwqe_setup_service_layer()
1284 if (genwqe_is_privileged(cd)) { genwqe_setup_service_layer()
1286 GENWQE_DEVNAME, cd); genwqe_setup_service_layer()
1289 GENWQE_DEVNAME, cd); genwqe_setup_service_layer()
1296 cd->card_state = GENWQE_CARD_USED; genwqe_setup_service_layer()
1300 genwqe_reset_interrupt_capability(cd); genwqe_setup_service_layer()
1302 kthread_stop(cd->card_thread); genwqe_setup_service_layer()
1303 cd->card_thread = NULL; genwqe_setup_service_layer()
1305 free_ddcb_queue(cd, queue); genwqe_setup_service_layer()
1317 static int queue_wake_up_all(struct genwqe_dev *cd) queue_wake_up_all() argument
1321 struct ddcb_queue *queue = &cd->queue; queue_wake_up_all()
1342 int genwqe_finish_queue(struct genwqe_dev *cd) genwqe_finish_queue() argument
1346 struct pci_dev *pci_dev = cd->pci_dev; genwqe_finish_queue()
1347 struct ddcb_queue *queue = &cd->queue; genwqe_finish_queue()
1353 if (cd->card_state == GENWQE_CARD_USED) genwqe_finish_queue()
1354 cd->card_state = GENWQE_CARD_UNUSED; genwqe_finish_queue()
1358 queue_wake_up_all(cd); genwqe_finish_queue()
1362 in_flight = genwqe_ddcbs_in_flight(cd); genwqe_finish_queue()
1390 * @cd: genwqe device descriptor
1394 int genwqe_release_service_layer(struct genwqe_dev *cd) genwqe_release_service_layer() argument
1396 struct pci_dev *pci_dev = cd->pci_dev; genwqe_release_service_layer()
1398 if (!ddcb_queue_initialized(&cd->queue)) genwqe_release_service_layer()
1401 free_irq(pci_dev->irq, cd); genwqe_release_service_layer()
1402 genwqe_reset_interrupt_capability(cd); genwqe_release_service_layer()
1404 if (cd->card_thread != NULL) { genwqe_release_service_layer()
1405 kthread_stop(cd->card_thread); genwqe_release_service_layer()
1406 cd->card_thread = NULL; genwqe_release_service_layer()
1409 free_ddcb_queue(cd, &cd->queue); genwqe_release_service_layer()
H A Dcard_base.h372 int genwqe_alloc_sync_sgl(struct genwqe_dev *cd, struct genwqe_sgl *sgl,
375 int genwqe_setup_sgl(struct genwqe_dev *cd, struct genwqe_sgl *sgl,
378 int genwqe_free_sync_sgl(struct genwqe_dev *cd, struct genwqe_sgl *sgl);
402 struct genwqe_dev *cd; member in struct:genwqe_file
417 int genwqe_setup_service_layer(struct genwqe_dev *cd); /* for PF only */
418 int genwqe_finish_queue(struct genwqe_dev *cd);
419 int genwqe_release_service_layer(struct genwqe_dev *cd);
428 static inline int genwqe_get_slu_id(struct genwqe_dev *cd) genwqe_get_slu_id() argument
430 return (int)((cd->slu_unitcfg >> 32) & 0xff); genwqe_get_slu_id()
433 int genwqe_ddcbs_in_flight(struct genwqe_dev *cd);
435 u8 genwqe_card_type(struct genwqe_dev *cd);
436 int genwqe_card_reset(struct genwqe_dev *cd);
437 int genwqe_set_interrupt_capability(struct genwqe_dev *cd, int count);
438 void genwqe_reset_interrupt_capability(struct genwqe_dev *cd);
440 int genwqe_device_create(struct genwqe_dev *cd);
441 int genwqe_device_remove(struct genwqe_dev *cd);
444 int genwqe_init_debugfs(struct genwqe_dev *cd);
445 void genqwe_exit_debugfs(struct genwqe_dev *cd);
447 int genwqe_read_softreset(struct genwqe_dev *cd);
450 int genwqe_recovery_on_fatal_gfir_required(struct genwqe_dev *cd);
451 int genwqe_flash_readback_fails(struct genwqe_dev *cd);
455 * @cd: genwqe device
460 int genwqe_write_vreg(struct genwqe_dev *cd, u32 reg, u64 val, int func);
464 * @cd: genwqe device
470 u64 genwqe_read_vreg(struct genwqe_dev *cd, u32 reg, int func);
473 int genwqe_ffdc_buff_size(struct genwqe_dev *cd, int unit_id);
474 int genwqe_ffdc_buff_read(struct genwqe_dev *cd, int unit_id,
476 int genwqe_read_ffdc_regs(struct genwqe_dev *cd, struct genwqe_reg *regs,
478 int genwqe_ffdc_dump_dma(struct genwqe_dev *cd,
481 int genwqe_init_debug_data(struct genwqe_dev *cd,
485 int genwqe_read_app_id(struct genwqe_dev *cd, char *app_name, int len);
488 int genwqe_user_vmap(struct genwqe_dev *cd, struct dma_mapping *m,
492 int genwqe_user_vunmap(struct genwqe_dev *cd, struct dma_mapping *m,
511 int __genwqe_execute_ddcb(struct genwqe_dev *cd,
523 int __genwqe_execute_raw_ddcb(struct genwqe_dev *cd,
526 int __genwqe_enqueue_ddcb(struct genwqe_dev *cd,
530 int __genwqe_wait_ddcb(struct genwqe_dev *cd, struct ddcb_requ *req);
531 int __genwqe_purge_ddcb(struct genwqe_dev *cd, struct ddcb_requ *req);
534 int __genwqe_writeq(struct genwqe_dev *cd, u64 byte_offs, u64 val);
535 u64 __genwqe_readq(struct genwqe_dev *cd, u64 byte_offs);
536 int __genwqe_writel(struct genwqe_dev *cd, u64 byte_offs, u32 val);
537 u32 __genwqe_readl(struct genwqe_dev *cd, u64 byte_offs);
539 void *__genwqe_alloc_consistent(struct genwqe_dev *cd, size_t size,
541 void __genwqe_free_consistent(struct genwqe_dev *cd, size_t size,
545 int genwqe_base_clock_frequency(struct genwqe_dev *cd);
548 void genwqe_stop_traps(struct genwqe_dev *cd);
549 void genwqe_start_traps(struct genwqe_dev *cd);
552 bool genwqe_need_err_masking(struct genwqe_dev *cd);
573 * cd->is_privileged = 0;
575 * cd->is_privileged = (__genwqe_readq(cd, IO_SLU_BITSTREAM)
578 static inline int genwqe_is_privileged(struct genwqe_dev *cd) genwqe_is_privileged() argument
580 return cd->is_privileged; genwqe_is_privileged()
/linux-4.1.27/arch/mn10300/kernel/
H A Dcevt-mn10300.c55 struct clock_event_device *cd; timer_interrupt() local
63 cd = &per_cpu(mn10300_clockevent_device, cpu); timer_interrupt()
64 cd->event_handler(cd); timer_interrupt()
85 struct clock_event_device *cd; init_clockevents() local
89 cd = &per_cpu(mn10300_clockevent_device, cpu); init_clockevents()
93 cd->irq = TMJCIRQ; init_clockevents()
96 cd->irq = TMJC1IRQ; init_clockevents()
99 cd->name = "Timestamp"; init_clockevents()
100 cd->features = CLOCK_EVT_FEAT_ONESHOT; init_clockevents()
103 clockevents_calc_mult_shift(cd, MN10300_JCCLK, 1); init_clockevents()
106 cd->max_delta_ns = clockevent_delta2ns(TMJCBR_MAX, cd); init_clockevents()
107 cd->min_delta_ns = clockevent_delta2ns(100, cd); init_clockevents()
109 cd->rating = 200; init_clockevents()
110 cd->cpumask = cpumask_of(smp_processor_id()); init_clockevents()
111 cd->set_mode = set_clock_mode; init_clockevents()
112 cd->event_handler = event_handler; init_clockevents()
113 cd->set_next_event = next_event; init_clockevents()
119 clockevents_register_device(cd); init_clockevents()
125 data = irq_get_irq_data(cd->irq); init_clockevents()
139 setup_jiffies_interrupt(cd->irq, iact); init_clockevents()
/linux-4.1.27/fs/nfs/
H A Dcache_lib.h21 extern int nfs_cache_upcall(struct cache_detail *cd, char *entry_name);
26 extern int nfs_cache_register_net(struct net *net, struct cache_detail *cd);
27 extern void nfs_cache_unregister_net(struct net *net, struct cache_detail *cd);
29 struct cache_detail *cd);
31 struct cache_detail *cd);
H A Dcache_lib.c34 int nfs_cache_upcall(struct cache_detail *cd, char *entry_name) nfs_cache_upcall() argument
43 cd->name, nfs_cache_upcall()
115 int nfs_cache_register_sb(struct super_block *sb, struct cache_detail *cd) nfs_cache_register_sb() argument
121 ret = sunrpc_cache_register_pipefs(dir, cd->name, 0600, cd); nfs_cache_register_sb()
126 int nfs_cache_register_net(struct net *net, struct cache_detail *cd) nfs_cache_register_net() argument
131 sunrpc_init_cache_detail(cd); nfs_cache_register_net()
134 ret = nfs_cache_register_sb(pipefs_sb, cd); nfs_cache_register_net()
137 sunrpc_destroy_cache_detail(cd); nfs_cache_register_net()
142 void nfs_cache_unregister_sb(struct super_block *sb, struct cache_detail *cd) nfs_cache_unregister_sb() argument
144 if (cd->u.pipefs.dir) nfs_cache_unregister_sb()
145 sunrpc_cache_unregister_pipefs(cd); nfs_cache_unregister_sb()
148 void nfs_cache_unregister_net(struct net *net, struct cache_detail *cd) nfs_cache_unregister_net() argument
154 nfs_cache_unregister_sb(pipefs_sb, cd); nfs_cache_unregister_net()
157 sunrpc_destroy_cache_detail(cd); nfs_cache_unregister_net()
H A Ddns_resolve.c130 static void nfs_dns_request(struct cache_detail *cd, nfs_dns_request() argument
140 static int nfs_dns_upcall(struct cache_detail *cd, nfs_dns_upcall() argument
146 ret = nfs_cache_upcall(cd, key->hostname); nfs_dns_upcall()
148 ret = sunrpc_cache_pipe_upcall(cd, ch); nfs_dns_upcall()
166 static int nfs_dns_show(struct seq_file *m, struct cache_detail *cd, nfs_dns_show() argument
192 static struct nfs_dns_ent *nfs_dns_lookup(struct cache_detail *cd, nfs_dns_lookup() argument
197 ch = sunrpc_cache_lookup(cd, nfs_dns_lookup()
205 static struct nfs_dns_ent *nfs_dns_update(struct cache_detail *cd, nfs_dns_update() argument
211 ch = sunrpc_cache_update(cd, nfs_dns_update()
219 static int nfs_dns_parse(struct cache_detail *cd, char *buf, int buflen) nfs_dns_parse() argument
234 key.addrlen = rpc_pton(cd->net, buf1, len, nfs_dns_parse()
253 item = nfs_dns_lookup(cd, &key); nfs_dns_parse()
260 item = nfs_dns_update(cd, &key, item); nfs_dns_parse()
265 cache_put(&item->h, cd); nfs_dns_parse()
270 static int do_cache_lookup(struct cache_detail *cd, do_cache_lookup() argument
277 *item = nfs_dns_lookup(cd, key); do_cache_lookup()
279 ret = cache_check(cd, &(*item)->h, &dreq->req); do_cache_lookup()
286 static int do_cache_lookup_nowait(struct cache_detail *cd, do_cache_lookup_nowait() argument
292 *item = nfs_dns_lookup(cd, key); do_cache_lookup_nowait()
298 || cd->flush_time > (*item)->h.last_refresh) do_cache_lookup_nowait()
305 cache_put(&(*item)->h, cd); do_cache_lookup_nowait()
311 static int do_cache_lookup_wait(struct cache_detail *cd, do_cache_lookup_wait() argument
321 ret = do_cache_lookup(cd, key, item, dreq); do_cache_lookup_wait()
325 ret = do_cache_lookup_nowait(cd, key, item); do_cache_lookup_wait()
420 struct cache_detail *cd = nn->nfs_dns_resolve; rpc_pipefs_event() local
423 if (cd == NULL) rpc_pipefs_event()
431 ret = nfs_cache_register_sb(sb, cd); rpc_pipefs_event()
434 nfs_cache_unregister_sb(sb, cd); rpc_pipefs_event()
/linux-4.1.27/kernel/time/
H A Dposix-clock.c249 static int get_clock_desc(const clockid_t id, struct posix_clock_desc *cd) get_clock_desc() argument
260 cd->fp = fp; get_clock_desc()
261 cd->clk = get_posix_clock(fp); get_clock_desc()
263 err = cd->clk ? 0 : -ENODEV; get_clock_desc()
270 static void put_clock_desc(struct posix_clock_desc *cd) put_clock_desc() argument
272 put_posix_clock(cd->clk); put_clock_desc()
273 fput(cd->fp); put_clock_desc()
278 struct posix_clock_desc cd; pc_clock_adjtime() local
281 err = get_clock_desc(id, &cd); pc_clock_adjtime()
285 if ((cd.fp->f_mode & FMODE_WRITE) == 0) { pc_clock_adjtime()
290 if (cd.clk->ops.clock_adjtime) pc_clock_adjtime()
291 err = cd.clk->ops.clock_adjtime(cd.clk, tx); pc_clock_adjtime()
295 put_clock_desc(&cd); pc_clock_adjtime()
302 struct posix_clock_desc cd; pc_clock_gettime() local
305 err = get_clock_desc(id, &cd); pc_clock_gettime()
309 if (cd.clk->ops.clock_gettime) pc_clock_gettime()
310 err = cd.clk->ops.clock_gettime(cd.clk, ts); pc_clock_gettime()
314 put_clock_desc(&cd); pc_clock_gettime()
321 struct posix_clock_desc cd; pc_clock_getres() local
324 err = get_clock_desc(id, &cd); pc_clock_getres()
328 if (cd.clk->ops.clock_getres) pc_clock_getres()
329 err = cd.clk->ops.clock_getres(cd.clk, ts); pc_clock_getres()
333 put_clock_desc(&cd); pc_clock_getres()
340 struct posix_clock_desc cd; pc_clock_settime() local
343 err = get_clock_desc(id, &cd); pc_clock_settime()
347 if ((cd.fp->f_mode & FMODE_WRITE) == 0) { pc_clock_settime()
352 if (cd.clk->ops.clock_settime) pc_clock_settime()
353 err = cd.clk->ops.clock_settime(cd.clk, ts); pc_clock_settime()
357 put_clock_desc(&cd); pc_clock_settime()
365 struct posix_clock_desc cd; pc_timer_create() local
368 err = get_clock_desc(id, &cd); pc_timer_create()
372 if (cd.clk->ops.timer_create) pc_timer_create()
373 err = cd.clk->ops.timer_create(cd.clk, kit); pc_timer_create()
377 put_clock_desc(&cd); pc_timer_create()
385 struct posix_clock_desc cd; pc_timer_delete() local
388 err = get_clock_desc(id, &cd); pc_timer_delete()
392 if (cd.clk->ops.timer_delete) pc_timer_delete()
393 err = cd.clk->ops.timer_delete(cd.clk, kit); pc_timer_delete()
397 put_clock_desc(&cd); pc_timer_delete()
405 struct posix_clock_desc cd; pc_timer_gettime() local
407 if (get_clock_desc(id, &cd)) pc_timer_gettime()
410 if (cd.clk->ops.timer_gettime) pc_timer_gettime()
411 cd.clk->ops.timer_gettime(cd.clk, kit, ts); pc_timer_gettime()
413 put_clock_desc(&cd); pc_timer_gettime()
420 struct posix_clock_desc cd; pc_timer_settime() local
423 err = get_clock_desc(id, &cd); pc_timer_settime()
427 if (cd.clk->ops.timer_settime) pc_timer_settime()
428 err = cd.clk->ops.timer_settime(cd.clk, kit, flags, ts, old); pc_timer_settime()
432 put_clock_desc(&cd); pc_timer_settime()
H A Dsched_clock.c85 static struct clock_data cd ____cacheline_aligned = {
103 seq = raw_read_seqcount(&cd.seq); sched_clock()
104 rd = cd.read_data + (seq & 1); sched_clock()
109 } while (read_seqcount_retry(&cd.seq, seq)); sched_clock()
127 cd.read_data[1] = *rd; update_clock_read_data()
130 raw_write_seqcount_latch(&cd.seq); update_clock_read_data()
133 cd.read_data[0] = *rd; update_clock_read_data()
136 raw_write_seqcount_latch(&cd.seq); update_clock_read_data()
148 rd = cd.read_data[0]; update_sched_clock()
150 cyc = cd.actual_read_sched_clock(); update_sched_clock()
162 hrtimer_forward_now(hrt, cd.wrap_kt); sched_clock_poll()
176 if (cd.rate > rate) sched_clock_register()
185 cd.rate = rate; sched_clock_register()
189 cd.wrap_kt = ns_to_ktime(wrap); sched_clock_register()
191 rd = cd.read_data[0]; sched_clock_register()
195 cyc = cd.actual_read_sched_clock(); sched_clock_register()
197 cd.actual_read_sched_clock = read; sched_clock_register()
240 if (cd.actual_read_sched_clock == jiffy_sched_clock_read) sched_clock_postinit()
251 hrtimer_start(&sched_clock_timer, cd.wrap_kt, HRTIMER_MODE_REL); sched_clock_postinit()
267 unsigned long seq = raw_read_seqcount(&cd.seq); suspended_sched_clock_read()
269 return cd.read_data[seq & 1].epoch_cyc; suspended_sched_clock_read()
274 struct clock_read_data *rd = &cd.read_data[0]; sched_clock_suspend()
285 struct clock_read_data *rd = &cd.read_data[0]; sched_clock_resume()
287 rd->epoch_cyc = cd.actual_read_sched_clock(); sched_clock_resume()
288 hrtimer_start(&sched_clock_timer, cd.wrap_kt, HRTIMER_MODE_REL); sched_clock_resume()
289 rd->read_sched_clock = cd.actual_read_sched_clock; sched_clock_resume()
/linux-4.1.27/sound/soc/au1x/
H A Ddbdma2.c80 static void au1x_pcm_queue_tx(struct au1xpsc_audio_dmadata *cd) au1x_pcm_queue_tx() argument
82 au1xxx_dbdma_put_source(cd->ddma_chan, cd->dma_area, au1x_pcm_queue_tx()
83 cd->period_bytes, DDMA_FLAGS_IE); au1x_pcm_queue_tx()
86 ++cd->q_period; au1x_pcm_queue_tx()
87 cd->dma_area += cd->period_bytes; au1x_pcm_queue_tx()
88 if (cd->q_period >= cd->periods) { au1x_pcm_queue_tx()
89 cd->q_period = 0; au1x_pcm_queue_tx()
90 cd->dma_area = cd->dma_area_s; au1x_pcm_queue_tx()
94 static void au1x_pcm_queue_rx(struct au1xpsc_audio_dmadata *cd) au1x_pcm_queue_rx() argument
96 au1xxx_dbdma_put_dest(cd->ddma_chan, cd->dma_area, au1x_pcm_queue_rx()
97 cd->period_bytes, DDMA_FLAGS_IE); au1x_pcm_queue_rx()
100 ++cd->q_period; au1x_pcm_queue_rx()
101 cd->dma_area += cd->period_bytes; au1x_pcm_queue_rx()
102 if (cd->q_period >= cd->periods) { au1x_pcm_queue_rx()
103 cd->q_period = 0; au1x_pcm_queue_rx()
104 cd->dma_area = cd->dma_area_s; au1x_pcm_queue_rx()
110 struct au1xpsc_audio_dmadata *cd = dev_id; au1x_pcm_dmatx_cb() local
112 cd->pos += cd->period_bytes; au1x_pcm_dmatx_cb()
113 if (++cd->curr_period >= cd->periods) { au1x_pcm_dmatx_cb()
114 cd->pos = 0; au1x_pcm_dmatx_cb()
115 cd->curr_period = 0; au1x_pcm_dmatx_cb()
117 snd_pcm_period_elapsed(cd->substream); au1x_pcm_dmatx_cb()
118 au1x_pcm_queue_tx(cd); au1x_pcm_dmatx_cb()
123 struct au1xpsc_audio_dmadata *cd = dev_id; au1x_pcm_dmarx_cb() local
125 cd->pos += cd->period_bytes; au1x_pcm_dmarx_cb()
126 if (++cd->curr_period >= cd->periods) { au1x_pcm_dmarx_cb()
127 cd->pos = 0; au1x_pcm_dmarx_cb()
128 cd->curr_period = 0; au1x_pcm_dmarx_cb()
130 snd_pcm_period_elapsed(cd->substream); au1x_pcm_dmarx_cb()
131 au1x_pcm_queue_rx(cd); au1x_pcm_dmarx_cb()
/linux-4.1.27/drivers/dca/
H A Ddca-sysfs.c38 struct device *cd; dca_sysfs_add_req() local
41 cd = device_create(dca_class, dca->cd, MKDEV(0, slot + 1), NULL, dca_sysfs_add_req()
43 if (IS_ERR(cd)) dca_sysfs_add_req()
44 return PTR_ERR(cd); dca_sysfs_add_req()
55 struct device *cd; dca_sysfs_add_provider() local
70 cd = device_create(dca_class, dev, MKDEV(0, 0), NULL, "dca%d", dca->id); dca_sysfs_add_provider()
71 if (IS_ERR(cd)) { dca_sysfs_add_provider()
75 return PTR_ERR(cd); dca_sysfs_add_provider()
77 dca->cd = cd; dca_sysfs_add_provider()
83 device_unregister(dca->cd); dca_sysfs_remove_provider()
84 dca->cd = NULL; dca_sysfs_remove_provider()
/linux-4.1.27/arch/mips/kernel/
H A Dcevt-ds1287.c99 struct clock_event_device *cd = &ds1287_clockevent; ds1287_interrupt() local
104 cd->event_handler(cd); ds1287_interrupt()
117 struct clock_event_device *cd; ds1287_clockevent_init() local
119 cd = &ds1287_clockevent; ds1287_clockevent_init()
120 cd->rating = 100; ds1287_clockevent_init()
121 cd->irq = irq; ds1287_clockevent_init()
122 clockevent_set_clock(cd, 32768); ds1287_clockevent_init()
123 cd->max_delta_ns = clockevent_delta2ns(0x7fffffff, cd); ds1287_clockevent_init()
124 cd->min_delta_ns = clockevent_delta2ns(0x300, cd); ds1287_clockevent_init()
125 cd->cpumask = cpumask_of(0); ds1287_clockevent_init()
H A Dcevt-gt641xx.c108 struct clock_event_device *cd = &gt641xx_timer0_clockevent; gt641xx_timer0_interrupt() local
110 cd->event_handler(cd); gt641xx_timer0_interrupt()
123 struct clock_event_device *cd; gt641xx_timer0_clockevent_init() local
130 cd = &gt641xx_timer0_clockevent; gt641xx_timer0_clockevent_init()
131 cd->rating = 200 + gt641xx_base_clock / 10000000; gt641xx_timer0_clockevent_init()
132 clockevent_set_clock(cd, gt641xx_base_clock); gt641xx_timer0_clockevent_init()
133 cd->max_delta_ns = clockevent_delta2ns(0x7fffffff, cd); gt641xx_timer0_clockevent_init()
134 cd->min_delta_ns = clockevent_delta2ns(0x300, cd); gt641xx_timer0_clockevent_init()
135 cd->cpumask = cpumask_of(0); gt641xx_timer0_clockevent_init()
H A Dcevt-bcm1480.c72 static int sibyte_next_event(unsigned long delta, struct clock_event_device *cd) sibyte_next_event() argument
90 struct clock_event_device *cd = dev_id; sibyte_counter_handler() local
94 if (cd->mode == CLOCK_EVT_MODE_PERIODIC) sibyte_counter_handler()
103 cd->event_handler(cd); sibyte_counter_handler()
117 struct clock_event_device *cd = &per_cpu(sibyte_hpt_clockevent, cpu); sb1480_clockevent_init() local
123 cd->name = name; sb1480_clockevent_init()
124 cd->features = CLOCK_EVT_FEAT_PERIODIC | sb1480_clockevent_init()
126 clockevent_set_clock(cd, V_SCD_TIMER_FREQ); sb1480_clockevent_init()
127 cd->max_delta_ns = clockevent_delta2ns(0x7fffff, cd); sb1480_clockevent_init()
128 cd->min_delta_ns = clockevent_delta2ns(2, cd); sb1480_clockevent_init()
129 cd->rating = 200; sb1480_clockevent_init()
130 cd->irq = irq; sb1480_clockevent_init()
131 cd->cpumask = cpumask_of(cpu); sb1480_clockevent_init()
132 cd->set_next_event = sibyte_next_event; sb1480_clockevent_init()
133 cd->set_mode = sibyte_set_mode; sb1480_clockevent_init()
134 clockevents_register_device(cd); sb1480_clockevent_init()
150 action->dev_id = cd; sb1480_clockevent_init()
H A Dcevt-r4k.c61 struct clock_event_device *cd; c0_compare_interrupt() local
81 cd = &per_cpu(mips_clockevent_device, cpu); c0_compare_interrupt()
82 cd->event_handler(cd); c0_compare_interrupt()
180 struct clock_event_device *cd; r4k_clockevent_init() local
198 cd = &per_cpu(mips_clockevent_device, cpu); r4k_clockevent_init()
200 cd->name = "MIPS"; r4k_clockevent_init()
201 cd->features = CLOCK_EVT_FEAT_ONESHOT | r4k_clockevent_init()
205 clockevent_set_clock(cd, mips_hpt_frequency); r4k_clockevent_init()
208 cd->max_delta_ns = clockevent_delta2ns(0x7fffffff, cd); r4k_clockevent_init()
209 cd->min_delta_ns = clockevent_delta2ns(0x300, cd); r4k_clockevent_init()
211 cd->rating = 300; r4k_clockevent_init()
212 cd->irq = irq; r4k_clockevent_init()
213 cd->cpumask = cpumask_of(cpu); r4k_clockevent_init()
214 cd->set_next_event = mips_next_event; r4k_clockevent_init()
215 cd->set_mode = mips_set_clock_mode; r4k_clockevent_init()
216 cd->event_handler = mips_event_handler; r4k_clockevent_init()
218 clockevents_register_device(cd); r4k_clockevent_init()
H A Dcevt-sb1250.c70 static int sibyte_next_event(unsigned long delta, struct clock_event_device *cd) sibyte_next_event() argument
88 struct clock_event_device *cd = dev_id; sibyte_counter_handler() local
92 if (cd->mode == CLOCK_EVT_MODE_PERIODIC) sibyte_counter_handler()
101 cd->event_handler(cd); sibyte_counter_handler()
115 struct clock_event_device *cd = &per_cpu(sibyte_hpt_clockevent, cpu); sb1250_clockevent_init() local
122 cd->name = name; sb1250_clockevent_init()
123 cd->features = CLOCK_EVT_FEAT_PERIODIC | sb1250_clockevent_init()
125 clockevent_set_clock(cd, V_SCD_TIMER_FREQ); sb1250_clockevent_init()
126 cd->max_delta_ns = clockevent_delta2ns(0x7fffff, cd); sb1250_clockevent_init()
127 cd->min_delta_ns = clockevent_delta2ns(2, cd); sb1250_clockevent_init()
128 cd->rating = 200; sb1250_clockevent_init()
129 cd->irq = irq; sb1250_clockevent_init()
130 cd->cpumask = cpumask_of(cpu); sb1250_clockevent_init()
131 cd->set_next_event = sibyte_next_event; sb1250_clockevent_init()
132 cd->set_mode = sibyte_set_mode; sb1250_clockevent_init()
133 clockevents_register_device(cd); sb1250_clockevent_init()
149 action->dev_id = cd; sb1250_clockevent_init()
H A Dcevt-txx9.c76 struct clock_event_device cd; member in struct:txx9_clock_event_device
92 container_of(evt, struct txx9_clock_event_device, cd); txx9tmr_set_mode()
124 container_of(evt, struct txx9_clock_event_device, cd); txx9tmr_set_next_event()
135 .cd = {
148 struct clock_event_device *cd = &txx9_cd->cd; txx9tmr_interrupt() local
152 cd->event_handler(cd); txx9tmr_interrupt()
166 struct clock_event_device *cd = &txx9_clock_event_device.cd; txx9_clockevent_init() local
175 clockevent_set_clock(cd, TIMER_CLK(imbusclk)); txx9_clockevent_init()
176 cd->max_delta_ns = txx9_clockevent_init()
177 clockevent_delta2ns(0xffffffff >> (32 - TXX9_TIMER_BITS), cd); txx9_clockevent_init()
178 cd->min_delta_ns = clockevent_delta2ns(0xf, cd); txx9_clockevent_init()
179 cd->irq = irq; txx9_clockevent_init()
180 cd->cpumask = cpumask_of(0), txx9_clockevent_init()
181 clockevents_register_device(cd); txx9_clockevent_init()
H A Dvpe-cmp.c40 static ssize_t ntcs_show(struct device *cd, struct device_attribute *attr, ntcs_show() argument
76 static void vpe_device_release(struct device *cd) vpe_device_release() argument
78 kfree(cd); vpe_device_release()
H A Dvpe-mt.c279 static ssize_t ntcs_show(struct device *cd, struct device_attribute *attr, ntcs_show() argument
314 static void vpe_device_release(struct device *cd) vpe_device_release() argument
316 kfree(cd); vpe_device_release()
/linux-4.1.27/drivers/scsi/
H A Dsr.c145 struct scsi_cd *cd = dev_get_drvdata(dev); sr_runtime_suspend() local
147 if (!cd) /* E.g.: runtime suspend following sr_remove() */ sr_runtime_suspend()
150 if (cd->media_present) sr_runtime_suspend()
162 struct scsi_cd *cd = NULL; scsi_cd_get() local
167 cd = scsi_cd(disk); scsi_cd_get()
168 kref_get(&cd->kref); scsi_cd_get()
169 if (scsi_device_get(cd->device)) { scsi_cd_get()
170 kref_put(&cd->kref, sr_kref_release); scsi_cd_get()
171 cd = NULL; scsi_cd_get()
175 return cd; scsi_cd_get()
178 static void scsi_cd_put(struct scsi_cd *cd) scsi_cd_put() argument
180 struct scsi_device *sdev = cd->device; scsi_cd_put()
183 kref_put(&cd->kref, sr_kref_release); scsi_cd_put()
232 struct scsi_cd *cd = cdi->handle; sr_check_events() local
242 events = sr_get_events(cd->device); sr_check_events()
243 cd->get_event_changed |= events & DISK_EVENT_MEDIA_CHANGE; sr_check_events()
251 if (cd->ignore_get_event) { sr_check_events()
261 if (cd->device->changed) { sr_check_events()
263 cd->device->changed = 0; sr_check_events()
264 cd->tur_changed = true; sr_check_events()
271 last_present = cd->media_present; sr_check_events()
272 ret = scsi_test_unit_ready(cd->device, SR_TIMEOUT, MAX_RETRIES, &sshdr); sr_check_events()
279 cd->media_present = scsi_status_is_good(ret) || sr_check_events()
282 if (last_present != cd->media_present) sr_check_events()
283 cd->device->changed = 1; sr_check_events()
285 if (cd->device->changed) { sr_check_events()
287 cd->device->changed = 0; sr_check_events()
288 cd->tur_changed = true; sr_check_events()
291 if (cd->ignore_get_event) sr_check_events()
295 if (!cd->tur_changed) { sr_check_events()
296 if (cd->get_event_changed) { sr_check_events()
297 if (cd->tur_mismatch++ > 8) { sr_check_events()
298 sr_printk(KERN_WARNING, cd, sr_check_events()
300 cd->ignore_get_event = true; sr_check_events()
303 cd->tur_mismatch = 0; sr_check_events()
306 cd->tur_changed = false; sr_check_events()
307 cd->get_event_changed = false; sr_check_events()
325 struct scsi_cd *cd = scsi_cd(SCpnt->request->rq_disk); sr_done() local
354 if (cd->device->sector_size == 2048) sr_done()
369 if (error_sector < get_capacity(cd->disk) && sr_done()
370 cd->capacity - error_sector < 4 * 75) sr_done()
371 set_capacity(cd->disk, error_sector); sr_done()
389 struct scsi_cd *cd; sr_init_command() local
397 cd = scsi_cd(rq->rq_disk); sr_init_command()
406 if (!cd->device || !scsi_device_online(cd->device)) { sr_init_command()
414 if (cd->device->changed) { sr_init_command()
426 s_size = cd->device->sector_size; sr_init_command()
429 sr_set_blocklength(cd, 2048); sr_init_command()
441 if (!cd->writeable) sr_init_command()
444 cd->cdi.media_written = 1; sr_init_command()
507 SCpnt->transfersize = cd->device->sector_size; sr_init_command()
522 struct scsi_cd *cd; sr_block_open() local
526 cd = scsi_cd_get(bdev->bd_disk); sr_block_open()
527 if (cd) { sr_block_open()
528 ret = cdrom_open(&cd->cdi, bdev, mode); sr_block_open()
530 scsi_cd_put(cd); sr_block_open()
538 struct scsi_cd *cd = scsi_cd(disk); sr_block_release() local
540 cdrom_release(&cd->cdi, mode); sr_block_release()
541 scsi_cd_put(cd); sr_block_release()
548 struct scsi_cd *cd = scsi_cd(bdev->bd_disk); sr_block_ioctl() local
549 struct scsi_device *sdev = cd->device; sr_block_ioctl()
571 ret = cdrom_ioctl(&cd->cdi, bdev, mode, cmd, arg); sr_block_ioctl()
585 struct scsi_cd *cd = scsi_cd(disk); sr_block_check_events() local
587 if (atomic_read(&cd->device->disk_events_disable_depth)) sr_block_check_events()
590 return cdrom_check_events(&cd->cdi, clearing); sr_block_check_events()
595 struct scsi_cd *cd = scsi_cd(disk); sr_block_revalidate_disk() local
599 if (scsi_test_unit_ready(cd->device, SR_TIMEOUT, MAX_RETRIES, &sshdr)) sr_block_revalidate_disk()
602 sr_cd_check(&cd->cdi); sr_block_revalidate_disk()
603 get_sectorsize(cd); sr_block_revalidate_disk()
624 struct scsi_cd *cd = cdi->handle; sr_open() local
625 struct scsi_device *sdev = cd->device; sr_open()
644 struct scsi_cd *cd = cdi->handle; sr_release() local
646 if (cd->device->sector_size > 2048) sr_release()
647 sr_set_blocklength(cd, 2048); sr_release()
655 struct scsi_cd *cd; sr_probe() local
664 cd = kzalloc(sizeof(*cd), GFP_KERNEL); sr_probe()
665 if (!cd) sr_probe()
668 kref_init(&cd->kref); sr_probe()
693 cd->device = sdev; sr_probe()
694 cd->disk = disk; sr_probe()
695 cd->driver = &sr_template; sr_probe()
696 cd->disk = disk; sr_probe()
697 cd->capacity = 0x1fffff; sr_probe()
698 cd->device->changed = 1; /* force recheck CD type */ sr_probe()
699 cd->media_present = 1; sr_probe()
700 cd->use = 1; sr_probe()
701 cd->readcd_known = 0; sr_probe()
702 cd->readcd_cdda = 0; sr_probe()
704 cd->cdi.ops = &sr_dops; sr_probe()
705 cd->cdi.handle = cd; sr_probe()
706 cd->cdi.mask = 0; sr_probe()
707 cd->cdi.capacity = 1; sr_probe()
708 sprintf(cd->cdi.name, "sr%d", minor); sr_probe()
713 get_capabilities(cd); sr_probe()
714 sr_vendor_init(cd); sr_probe()
717 set_capacity(disk, cd->capacity); sr_probe()
718 disk->private_data = &cd->driver; sr_probe()
720 cd->cdi.disk = disk; sr_probe()
722 if (register_cdrom(&cd->cdi)) sr_probe()
731 dev_set_drvdata(dev, cd); sr_probe()
736 "Attached scsi CD-ROM %s\n", cd->cdi.name); sr_probe()
737 scsi_autopm_put_device(cd->device); sr_probe()
744 kfree(cd); sr_probe()
751 static void get_sectorsize(struct scsi_cd *cd) get_sectorsize() argument
765 the_result = scsi_execute_req(cd->device, cmd, DMA_FROM_DEVICE, get_sectorsize()
775 cd->capacity = 0x1fffff; get_sectorsize()
780 cd->capacity = 1 + ((buffer[0] << 24) | (buffer[1] << 16) | get_sectorsize()
789 if (!cdrom_get_last_written(&cd->cdi, &last_written)) get_sectorsize()
790 cd->capacity = max_t(long, cd->capacity, last_written); get_sectorsize()
807 cd->capacity *= 4; get_sectorsize()
812 sr_printk(KERN_INFO, cd, get_sectorsize()
814 cd->capacity = 0; get_sectorsize()
817 cd->device->sector_size = sector_size; get_sectorsize()
823 set_capacity(cd->disk, cd->capacity); get_sectorsize()
826 queue = cd->device->request_queue; get_sectorsize()
832 static void get_capabilities(struct scsi_cd *cd) get_capabilities() argument
855 sr_printk(KERN_ERR, cd, "out of memory.\n"); get_capabilities()
860 scsi_test_unit_ready(cd->device, SR_TIMEOUT, MAX_RETRIES, &sshdr); get_capabilities()
863 rc = scsi_mode_sense(cd->device, 0, 0x2a, buffer, 128, get_capabilities()
868 cd->cdi.speed = 1; get_capabilities()
869 cd->cdi.mask |= (CDC_CD_R | CDC_CD_RW | CDC_DVD_R | get_capabilities()
874 sr_printk(KERN_INFO, cd, "scsi-1 drive"); get_capabilities()
879 cd->cdi.speed = ((buffer[n + 8] << 8) + buffer[n + 9]) / 176; get_capabilities()
880 cd->readcd_known = 1; get_capabilities()
881 cd->readcd_cdda = buffer[n + 5] & 0x01; get_capabilities()
883 sr_printk(KERN_INFO, cd, get_capabilities()
886 cd->cdi.speed, get_capabilities()
889 buffer[n + 2] & 0x02 ? "cd/rw " : "", /* can read rewriteable */ get_capabilities()
895 cd->cdi.mask |= CDC_CLOSE_TRAY; get_capabilities()
898 cd->cdi.mask |= CDC_DVD; get_capabilities()
901 cd->cdi.mask |= CDC_DVD_RAM; get_capabilities()
904 cd->cdi.mask |= CDC_DVD_R; get_capabilities()
907 cd->cdi.mask |= CDC_CD_RW; get_capabilities()
910 cd->cdi.mask |= CDC_CD_R; get_capabilities()
913 cd->cdi.mask |= CDC_OPEN_TRAY; get_capabilities()
917 cd->cdi.capacity = get_capabilities()
918 cdrom_number_of_slots(&cd->cdi); get_capabilities()
919 if (cd->cdi.capacity <= 1) get_capabilities()
921 cd->cdi.mask |= CDC_SELECT_DISC; get_capabilities()
923 cd->cdi.mask |= CDC_CLOSE_TRAY; */ get_capabilities()
928 if ((cd->cdi.mask & (CDC_DVD_RAM | CDC_MRW_W | CDC_RAM | CDC_CD_RW)) != get_capabilities()
930 cd->writeable = 1; get_capabilities()
943 struct scsi_cd *cd = cdi->handle; sr_packet() local
944 struct scsi_device *sdev = cd->device; sr_packet()
952 sr_do_ioctl(cd, cgc); sr_packet()
968 struct scsi_cd *cd = container_of(kref, struct scsi_cd, kref); sr_kref_release() local
969 struct gendisk *disk = cd->disk; sr_kref_release()
975 unregister_cdrom(&cd->cdi); sr_kref_release()
981 kfree(cd); sr_kref_release()
986 struct scsi_cd *cd = dev_get_drvdata(dev); sr_remove() local
988 scsi_autopm_get_device(cd->device); sr_remove()
990 del_gendisk(cd->disk); sr_remove()
994 kref_put(&cd->kref, sr_kref_release); sr_remove()
H A Dsr_vendor.c66 void sr_vendor_init(Scsi_CD *cd) sr_vendor_init() argument
69 cd->vendor = VENDOR_SCSI3; sr_vendor_init()
71 const char *vendor = cd->device->vendor; sr_vendor_init()
72 const char *model = cd->device->model; sr_vendor_init()
75 cd->vendor = VENDOR_SCSI3; sr_vendor_init()
76 if (cd->readcd_known) sr_vendor_init()
80 if (cd->device->type == TYPE_WORM) { sr_vendor_init()
81 cd->vendor = VENDOR_WRITER; sr_vendor_init()
84 cd->vendor = VENDOR_NEC; sr_vendor_init()
96 cd->cdi.mask |= CDC_MULTI_SESSION; sr_vendor_init()
99 cd->vendor = VENDOR_TOSHIBA; sr_vendor_init()
109 int sr_set_blocklength(Scsi_CD *cd, int blocklength) sr_set_blocklength() argument
117 if (cd->vendor == VENDOR_TOSHIBA) sr_set_blocklength()
126 sr_printk(KERN_INFO, cd, "MODE SELECT 0x%x/%d\n", density, blocklength); sr_set_blocklength()
142 if (0 == (rc = sr_do_ioctl(cd, &cgc))) { sr_set_blocklength()
143 cd->device->sector_size = blocklength; sr_set_blocklength()
147 sr_printk(KERN_INFO, cd, sr_set_blocklength()
160 Scsi_CD *cd = cdi->handle; sr_cd_check() local
166 if (cd->cdi.mask & CDC_MULTI_SESSION) sr_cd_check()
179 switch (cd->vendor) { sr_cd_check()
190 rc = sr_do_ioctl(cd, &cgc); sr_cd_check()
194 sr_printk(KERN_INFO, cd, "Hmm, seems the drive " sr_cd_check()
218 rc = sr_do_ioctl(cd, &cgc); sr_cd_check()
222 sr_printk(KERN_INFO, cd, "Hmm, seems the cdrom " sr_cd_check()
247 rc = sr_do_ioctl(cd, &cgc); sr_cd_check()
249 sr_printk(KERN_INFO, cd, "Hmm, seems the drive " sr_cd_check()
262 sr_set_blocklength(cd, 2048); sr_cd_check()
275 rc = sr_do_ioctl(cd, &cgc); sr_cd_check()
280 sr_printk(KERN_WARNING, cd, sr_cd_check()
293 rc = sr_do_ioctl(cd, &cgc); sr_cd_check()
304 sr_printk(KERN_WARNING, cd, sr_cd_check()
306 cd->vendor); sr_cd_check()
311 cd->ms_offset = sector; sr_cd_check()
312 cd->xa_flag = 0; sr_cd_check()
313 if (CDS_AUDIO != sr_disk_status(cdi) && 1 == sr_is_xa(cd)) sr_cd_check()
314 cd->xa_flag = 1; sr_cd_check()
316 if (2048 != cd->device->sector_size) { sr_cd_check()
317 sr_set_blocklength(cd, 2048); sr_cd_check()
324 sr_printk(KERN_DEBUG, cd, "multisession offset=%lu\n", sr_cd_check()
H A Dsr_ioctl.c37 #define SR_GFP_DMA(cd) (((cd)->device->host->unchecked_isa_dma) ? GFP_DMA : 0)
42 struct scsi_cd *cd = cdi->handle; sr_read_tochdr() local
47 buffer = kmalloc(32, GFP_KERNEL | SR_GFP_DMA(cd)); sr_read_tochdr()
60 result = sr_do_ioctl(cd, &cgc); sr_read_tochdr()
72 struct scsi_cd *cd = cdi->handle; sr_read_tocentry() local
77 buffer = kmalloc(32, GFP_KERNEL | SR_GFP_DMA(cd)); sr_read_tocentry()
91 result = sr_do_ioctl(cd, &cgc); sr_read_tocentry()
161 struct scsi_cd *cd = cdi->handle; sr_play_trkind() local
174 result = sr_do_ioctl(cd, &cgc); sr_play_trkind()
185 int sr_do_ioctl(Scsi_CD *cd, struct packet_command *cgc) sr_do_ioctl() argument
192 SDev = cd->device; sr_do_ioctl()
221 sr_printk(KERN_INFO, cd, sr_do_ioctl()
232 sr_printk(KERN_INFO, cd, sr_do_ioctl()
245 sr_printk(KERN_INFO, cd, sr_do_ioctl()
275 Scsi_CD *cd = cdi->handle; sr_tray_move() local
283 return sr_do_ioctl(cd, &cgc); sr_tray_move()
288 Scsi_CD *cd = cdi->handle; sr_lock_door() local
290 return scsi_set_medium_removal(cd->device, lock ? sr_lock_door()
296 struct scsi_cd *cd = cdi->handle; sr_drive_status() local
304 if (!scsi_test_unit_ready(cd->device, SR_TIMEOUT, MAX_RETRIES, &sshdr)) sr_drive_status()
353 Scsi_CD *cd = cdi->handle; sr_disk_status() local
376 if (cd->xa_flag) sr_disk_status()
385 Scsi_CD *cd = cdi->handle; sr_get_last_session() local
387 ms_info->addr.lba = cd->ms_offset; sr_get_last_session()
388 ms_info->xa_flag = cd->xa_flag || cd->ms_offset > 0; sr_get_last_session()
395 Scsi_CD *cd = cdi->handle; sr_get_mcn() local
397 char *buffer = kmalloc(32, GFP_KERNEL | SR_GFP_DMA(cd)); sr_get_mcn()
412 result = sr_do_ioctl(cd, &cgc); sr_get_mcn()
428 Scsi_CD *cd = cdi->handle; sr_select_speed() local
443 if (sr_do_ioctl(cd, &cgc)) sr_select_speed()
482 static int sr_read_cd(Scsi_CD *cd, unsigned char *dest, int lba, int format, int blksize) sr_read_cd() argument
487 sr_printk(KERN_INFO, cd, "sr_read_cd lba=%d format=%d blksize=%d\n", sr_read_cd()
517 return sr_do_ioctl(cd, &cgc); sr_read_cd()
524 static int sr_read_sector(Scsi_CD *cd, int lba, int blksize, unsigned char *dest) sr_read_sector() argument
530 if (cd->readcd_known) { sr_read_sector()
531 rc = sr_read_cd(cd, dest, lba, 0, blksize); sr_read_sector()
534 cd->readcd_known = 0; sr_read_sector()
535 sr_printk(KERN_INFO, cd, sr_read_sector()
540 if (blksize != cd->device->sector_size) { sr_read_sector()
541 if (0 != (rc = sr_set_blocklength(cd, blksize))) sr_read_sector()
545 sr_printk(KERN_INFO, cd, "sr_read_sector lba=%d blksize=%d\n", sr_read_sector()
560 rc = sr_do_ioctl(cd, &cgc); sr_read_sector()
570 int sr_is_xa(Scsi_CD *cd) sr_is_xa() argument
578 raw_sector = kmalloc(2048, GFP_KERNEL | SR_GFP_DMA(cd)); sr_is_xa()
581 if (0 == sr_read_sector(cd, cd->ms_offset + 16, sr_is_xa()
590 sr_printk(KERN_INFO, cd, "sr_is_xa: %d\n", is_xa); sr_is_xa()
H A Dsr.h59 #define sr_printk(prefix, cd, fmt, a...) \
60 sdev_prefix_printk(prefix, (cd)->device, (cd)->cdi.name, fmt, ##a)
H A Dnsp32_debug.c40 /* 42-48 */ "Read Sub-Ch(cd)", "Read TOC", "Read Header(cd)", "Play Audio(cd)", unknown, "Play Audio MSF(cd)", "Play Audio Track/Index(cd)",
41 /* 49-4f */ "Play Track Relative(10)(cd)", unknown, "Pause/Resume(cd)", "Log Select", "Log Sense", unknown, unknown,
H A Dconstants.c101 "Redundancy group (out), Set cd-rom speed", "Spare (in), Play cd",
102 /* bd-bf */ "Spare (out), Mechanism status", "Volume set (in), Read cd",
/linux-4.1.27/net/sunrpc/
H A Dcache.c192 static int cache_make_upcall(struct cache_detail *cd, struct cache_head *h) cache_make_upcall() argument
194 if (cd->cache_upcall) cache_make_upcall()
195 return cd->cache_upcall(cd, h); cache_make_upcall()
196 return sunrpc_cache_pipe_upcall(cd, h); cache_make_upcall()
339 void sunrpc_init_cache_detail(struct cache_detail *cd) sunrpc_init_cache_detail() argument
341 rwlock_init(&cd->hash_lock); sunrpc_init_cache_detail()
342 INIT_LIST_HEAD(&cd->queue); sunrpc_init_cache_detail()
344 cd->nextcheck = 0; sunrpc_init_cache_detail()
345 cd->entries = 0; sunrpc_init_cache_detail()
346 atomic_set(&cd->readers, 0); sunrpc_init_cache_detail()
347 cd->last_close = 0; sunrpc_init_cache_detail()
348 cd->last_warn = -1; sunrpc_init_cache_detail()
349 list_add(&cd->others, &cache_list); sunrpc_init_cache_detail()
357 void sunrpc_destroy_cache_detail(struct cache_detail *cd) sunrpc_destroy_cache_detail() argument
359 cache_purge(cd); sunrpc_destroy_cache_detail()
361 write_lock(&cd->hash_lock); sunrpc_destroy_cache_detail()
362 if (cd->entries || atomic_read(&cd->inuse)) { sunrpc_destroy_cache_detail()
363 write_unlock(&cd->hash_lock); sunrpc_destroy_cache_detail()
367 if (current_detail == cd) sunrpc_destroy_cache_detail()
369 list_del_init(&cd->others); sunrpc_destroy_cache_detail()
370 write_unlock(&cd->hash_lock); sunrpc_destroy_cache_detail()
378 printk(KERN_ERR "RPC: failed to unregister %s cache\n", cd->name); sunrpc_destroy_cache_detail()
757 loff_t *ppos, struct cache_detail *cd) cache_read()
772 while (rp->q.list.next != &cd->queue && cache_read()
778 if (rp->q.list.next == &cd->queue) { cache_read()
791 err = cache_request(cd, rq); cache_read()
826 cache_put(rq->item, cd); cache_read()
839 size_t count, struct cache_detail *cd) cache_do_downcall()
848 ret = cd->cache_parse(cd, kaddr, count); cache_do_downcall()
855 size_t count, struct cache_detail *cd) cache_slow_downcall()
863 ret = cache_do_downcall(write_buf, buf, count, cd); cache_slow_downcall()
871 size_t count, struct cache_detail *cd) cache_downcall()
885 ret = cache_do_downcall(kaddr, buf, count, cd); cache_downcall()
891 return cache_slow_downcall(buf, count, cd); cache_downcall()
896 struct cache_detail *cd) cache_write()
902 if (!cd->cache_parse) cache_write()
906 ret = cache_downcall(mapping, buf, count, cd); cache_write()
915 struct cache_detail *cd) cache_poll()
931 for (cq= &rp->q; &cq->list != &cd->queue; cache_poll()
943 struct cache_detail *cd) cache_ioctl()
957 for (cq= &rp->q; &cq->list != &cd->queue; cache_ioctl()
971 struct cache_detail *cd) cache_open()
975 if (!cd || !try_module_get(cd->owner)) cache_open()
981 module_put(cd->owner); cache_open()
986 atomic_inc(&cd->readers); cache_open()
988 list_add(&rp->q.list, &cd->queue); cache_open()
996 struct cache_detail *cd) cache_release()
1004 for (cq= &rp->q; &cq->list != &cd->queue; cache_release()
1019 cd->last_close = seconds_since_boot(); cache_release()
1020 atomic_dec(&cd->readers); cache_release()
1022 module_put(cd->owner); cache_release()
1274 struct cache_detail *cd; member in struct:handle
1278 __acquires(cd->hash_lock)
1283 struct cache_detail *cd = ((struct handle*)m->private)->cd; variable in typeref:struct:cache_detail
1286 read_lock(&cd->hash_lock);
1292 for (ch=cd->hash_table[hash]; ch; ch=ch->next)
1299 } while(hash < cd->hash_size &&
1300 cd->hash_table[hash]==NULL);
1301 if (hash >= cd->hash_size)
1304 return cd->hash_table[hash];
1311 struct cache_detail *cd = ((struct handle*)m->private)->cd; c_next() local
1323 while (hash < cd->hash_size && c_next()
1324 cd->hash_table[hash] == NULL) { c_next()
1328 if (hash >= cd->hash_size) c_next()
1331 return cd->hash_table[hash]; c_next()
1335 __releases(cd->hash_lock)
1337 struct cache_detail *cd = ((struct handle*)m->private)->cd; variable in typeref:struct:cache_detail
1338 read_unlock(&cd->hash_lock);
1344 struct cache_detail *cd = ((struct handle*)m->private)->cd; c_show() local
1347 return cd->cache_show(m, cd, NULL); c_show()
1354 if (cache_check(cd, cp, NULL)) c_show()
1358 if (cache_is_expired(cd, cp)) c_show()
1360 cache_put(cp, cd); c_show()
1363 return cd->cache_show(m, cd, cp); c_show()
1374 struct cache_detail *cd) content_open()
1378 if (!cd || !try_module_get(cd->owner)) content_open()
1382 module_put(cd->owner); content_open()
1386 han->cd = cd; content_open()
1391 struct cache_detail *cd) content_release()
1394 module_put(cd->owner); content_release()
1399 struct cache_detail *cd) open_flush()
1401 if (!cd || !try_module_get(cd->owner)) open_flush()
1407 struct cache_detail *cd) release_flush()
1409 module_put(cd->owner); release_flush()
1415 struct cache_detail *cd) read_flush()
1421 snprintf(tbuf, sizeof(tbuf), "%lu\n", convert_to_wallclock(cd->flush_time)); read_flush()
1436 struct cache_detail *cd) write_flush()
1451 cd->flush_time = get_expiry(&bp); write_flush()
1452 cd->nextcheck = seconds_since_boot(); write_flush()
1462 struct cache_detail *cd = PDE_DATA(file_inode(filp)); cache_read_procfs() local
1464 return cache_read(filp, buf, count, ppos, cd); cache_read_procfs()
1470 struct cache_detail *cd = PDE_DATA(file_inode(filp)); cache_write_procfs() local
1472 return cache_write(filp, buf, count, ppos, cd); cache_write_procfs()
1477 struct cache_detail *cd = PDE_DATA(file_inode(filp)); cache_poll_procfs() local
1479 return cache_poll(filp, wait, cd); cache_poll_procfs()
1486 struct cache_detail *cd = PDE_DATA(inode); cache_ioctl_procfs() local
1488 return cache_ioctl(inode, filp, cmd, arg, cd); cache_ioctl_procfs()
1493 struct cache_detail *cd = PDE_DATA(inode); cache_open_procfs() local
1495 return cache_open(inode, filp, cd); cache_open_procfs()
1500 struct cache_detail *cd = PDE_DATA(inode); cache_release_procfs() local
1502 return cache_release(inode, filp, cd); cache_release_procfs()
1518 struct cache_detail *cd = PDE_DATA(inode); content_open_procfs() local
1520 return content_open(inode, filp, cd); content_open_procfs()
1525 struct cache_detail *cd = PDE_DATA(inode); content_release_procfs() local
1527 return content_release(inode, filp, cd); content_release_procfs()
1539 struct cache_detail *cd = PDE_DATA(inode); open_flush_procfs() local
1541 return open_flush(inode, filp, cd); open_flush_procfs()
1546 struct cache_detail *cd = PDE_DATA(inode); release_flush_procfs() local
1548 return release_flush(inode, filp, cd); release_flush_procfs()
1554 struct cache_detail *cd = PDE_DATA(file_inode(filp)); read_flush_procfs() local
1556 return read_flush(filp, buf, count, ppos, cd); read_flush_procfs()
1563 struct cache_detail *cd = PDE_DATA(file_inode(filp)); write_flush_procfs() local
1565 return write_flush(filp, buf, count, ppos, cd); write_flush_procfs()
1576 static void remove_cache_proc_entries(struct cache_detail *cd, struct net *net) remove_cache_proc_entries() argument
1580 if (cd->u.procfs.proc_ent == NULL) remove_cache_proc_entries()
1582 if (cd->u.procfs.flush_ent) remove_cache_proc_entries()
1583 remove_proc_entry("flush", cd->u.procfs.proc_ent); remove_cache_proc_entries()
1584 if (cd->u.procfs.channel_ent) remove_cache_proc_entries()
1585 remove_proc_entry("channel", cd->u.procfs.proc_ent); remove_cache_proc_entries()
1586 if (cd->u.procfs.content_ent) remove_cache_proc_entries()
1587 remove_proc_entry("content", cd->u.procfs.proc_ent); remove_cache_proc_entries()
1588 cd->u.procfs.proc_ent = NULL; remove_cache_proc_entries()
1590 remove_proc_entry(cd->name, sn->proc_net_rpc); remove_cache_proc_entries()
1594 static int create_cache_proc_entries(struct cache_detail *cd, struct net *net) create_cache_proc_entries() argument
1600 cd->u.procfs.proc_ent = proc_mkdir(cd->name, sn->proc_net_rpc); create_cache_proc_entries()
1601 if (cd->u.procfs.proc_ent == NULL) create_cache_proc_entries()
1603 cd->u.procfs.channel_ent = NULL; create_cache_proc_entries()
1604 cd->u.procfs.content_ent = NULL; create_cache_proc_entries()
1607 cd->u.procfs.proc_ent, create_cache_proc_entries()
1608 &cache_flush_operations_procfs, cd); create_cache_proc_entries()
1609 cd->u.procfs.flush_ent = p; create_cache_proc_entries()
1613 if (cd->cache_request || cd->cache_parse) { create_cache_proc_entries()
1615 cd->u.procfs.proc_ent, create_cache_proc_entries()
1616 &cache_file_operations_procfs, cd); create_cache_proc_entries()
1617 cd->u.procfs.channel_ent = p; create_cache_proc_entries()
1621 if (cd->cache_show) { create_cache_proc_entries()
1623 cd->u.procfs.proc_ent, create_cache_proc_entries()
1624 &content_file_operations_procfs, cd); create_cache_proc_entries()
1625 cd->u.procfs.content_ent = p; create_cache_proc_entries()
1631 remove_cache_proc_entries(cd, net); create_cache_proc_entries()
1635 static int create_cache_proc_entries(struct cache_detail *cd, struct net *net) create_cache_proc_entries() argument
1646 int cache_register_net(struct cache_detail *cd, struct net *net) cache_register_net() argument
1650 sunrpc_init_cache_detail(cd); cache_register_net()
1651 ret = create_cache_proc_entries(cd, net); cache_register_net()
1653 sunrpc_destroy_cache_detail(cd); cache_register_net()
1658 void cache_unregister_net(struct cache_detail *cd, struct net *net) cache_unregister_net() argument
1660 remove_cache_proc_entries(cd, net); cache_unregister_net()
1661 sunrpc_destroy_cache_detail(cd); cache_unregister_net()
1667 struct cache_detail *cd; cache_create_net() local
1669 cd = kmemdup(tmpl, sizeof(struct cache_detail), GFP_KERNEL); cache_create_net()
1670 if (cd == NULL) cache_create_net()
1673 cd->hash_table = kzalloc(cd->hash_size * sizeof(struct cache_head *), cache_create_net()
1675 if (cd->hash_table == NULL) { cache_create_net()
1676 kfree(cd); cache_create_net()
1679 cd->net = net; cache_create_net()
1680 return cd; cache_create_net()
1684 void cache_destroy_net(struct cache_detail *cd, struct net *net) cache_destroy_net() argument
1686 kfree(cd->hash_table); cache_destroy_net()
1687 kfree(cd); cache_destroy_net()
1694 struct cache_detail *cd = RPC_I(file_inode(filp))->private; cache_read_pipefs() local
1696 return cache_read(filp, buf, count, ppos, cd); cache_read_pipefs()
1702 struct cache_detail *cd = RPC_I(file_inode(filp))->private; cache_write_pipefs() local
1704 return cache_write(filp, buf, count, ppos, cd); cache_write_pipefs()
1709 struct cache_detail *cd = RPC_I(file_inode(filp))->private; cache_poll_pipefs() local
1711 return cache_poll(filp, wait, cd); cache_poll_pipefs()
1718 struct cache_detail *cd = RPC_I(inode)->private; cache_ioctl_pipefs() local
1720 return cache_ioctl(inode, filp, cmd, arg, cd); cache_ioctl_pipefs()
1725 struct cache_detail *cd = RPC_I(inode)->private; cache_open_pipefs() local
1727 return cache_open(inode, filp, cd); cache_open_pipefs()
1732 struct cache_detail *cd = RPC_I(inode)->private; cache_release_pipefs() local
1734 return cache_release(inode, filp, cd); cache_release_pipefs()
1750 struct cache_detail *cd = RPC_I(inode)->private; content_open_pipefs() local
1752 return content_open(inode, filp, cd); content_open_pipefs()
1757 struct cache_detail *cd = RPC_I(inode)->private; content_release_pipefs() local
1759 return content_release(inode, filp, cd); content_release_pipefs()
1771 struct cache_detail *cd = RPC_I(inode)->private; open_flush_pipefs() local
1773 return open_flush(inode, filp, cd); open_flush_pipefs()
1778 struct cache_detail *cd = RPC_I(inode)->private; release_flush_pipefs() local
1780 return release_flush(inode, filp, cd); release_flush_pipefs()
1786 struct cache_detail *cd = RPC_I(file_inode(filp))->private; read_flush_pipefs() local
1788 return read_flush(filp, buf, count, ppos, cd); read_flush_pipefs()
1795 struct cache_detail *cd = RPC_I(file_inode(filp))->private; write_flush_pipefs() local
1797 return write_flush(filp, buf, count, ppos, cd); write_flush_pipefs()
1810 struct cache_detail *cd) sunrpc_cache_register_pipefs()
1812 struct dentry *dir = rpc_create_cache_dir(parent, name, umode, cd); sunrpc_cache_register_pipefs()
1815 cd->u.pipefs.dir = dir; sunrpc_cache_register_pipefs()
1820 void sunrpc_cache_unregister_pipefs(struct cache_detail *cd) sunrpc_cache_unregister_pipefs() argument
1822 rpc_remove_cache_dir(cd->u.pipefs.dir); sunrpc_cache_unregister_pipefs()
1823 cd->u.pipefs.dir = NULL; sunrpc_cache_unregister_pipefs()
756 cache_read(struct file *filp, char __user *buf, size_t count, loff_t *ppos, struct cache_detail *cd) cache_read() argument
838 cache_do_downcall(char *kaddr, const char __user *buf, size_t count, struct cache_detail *cd) cache_do_downcall() argument
854 cache_slow_downcall(const char __user *buf, size_t count, struct cache_detail *cd) cache_slow_downcall() argument
869 cache_downcall(struct address_space *mapping, const char __user *buf, size_t count, struct cache_detail *cd) cache_downcall() argument
894 cache_write(struct file *filp, const char __user *buf, size_t count, loff_t *ppos, struct cache_detail *cd) cache_write() argument
914 cache_poll(struct file *filp, poll_table *wait, struct cache_detail *cd) cache_poll() argument
941 cache_ioctl(struct inode *ino, struct file *filp, unsigned int cmd, unsigned long arg, struct cache_detail *cd) cache_ioctl() argument
970 cache_open(struct inode *inode, struct file *filp, struct cache_detail *cd) cache_open() argument
995 cache_release(struct inode *inode, struct file *filp, struct cache_detail *cd) cache_release() argument
1373 content_open(struct inode *inode, struct file *file, struct cache_detail *cd) content_open() argument
1390 content_release(struct inode *inode, struct file *file, struct cache_detail *cd) content_release() argument
1398 open_flush(struct inode *inode, struct file *file, struct cache_detail *cd) open_flush() argument
1406 release_flush(struct inode *inode, struct file *file, struct cache_detail *cd) release_flush() argument
1413 read_flush(struct file *file, char __user *buf, size_t count, loff_t *ppos, struct cache_detail *cd) read_flush() argument
1434 write_flush(struct file *file, const char __user *buf, size_t count, loff_t *ppos, struct cache_detail *cd) write_flush() argument
1808 sunrpc_cache_register_pipefs(struct dentry *parent, const char *name, umode_t umode, struct cache_detail *cd) sunrpc_cache_register_pipefs() argument
H A Dsvcauth_unix.c143 static void ip_map_request(struct cache_detail *cd, ip_map_request() argument
160 static struct ip_map *__ip_map_lookup(struct cache_detail *cd, char *class, struct in6_addr *addr);
161 static int __ip_map_update(struct cache_detail *cd, struct ip_map *ipm, struct unix_domain *udom, time_t expiry);
163 static int ip_map_parse(struct cache_detail *cd, ip_map_parse() argument
196 if (rpc_pton(cd->net, buf, len, &address.sa, sizeof(address)) == 0) ip_map_parse()
230 ipmp = __ip_map_lookup(cd, class, &sin6.sin6_addr); ip_map_parse()
232 err = __ip_map_update(cd, ipmp, ip_map_parse()
246 struct cache_detail *cd, ip_map_show()
275 static struct ip_map *__ip_map_lookup(struct cache_detail *cd, char *class, __ip_map_lookup() argument
283 ch = sunrpc_cache_lookup(cd, &ip.h, __ip_map_lookup()
302 static int __ip_map_update(struct cache_detail *cd, struct ip_map *ipm, __ip_map_update() argument
313 ch = sunrpc_cache_update(cd, &ip.h, &ipm->h, __ip_map_update()
318 cache_put(ch, cd); __ip_map_update()
461 static void unix_gid_request(struct cache_detail *cd, unix_gid_request() argument
473 static struct unix_gid *unix_gid_lookup(struct cache_detail *cd, kuid_t uid);
475 static int unix_gid_parse(struct cache_detail *cd, unix_gid_parse() argument
523 ugp = unix_gid_lookup(cd, uid); unix_gid_parse()
528 ch = sunrpc_cache_update(cd, unix_gid_parse()
535 cache_put(ch, cd); unix_gid_parse()
546 struct cache_detail *cd, unix_gid_show()
589 struct cache_detail *cd; unix_gid_cache_create() local
592 cd = cache_create_net(&unix_gid_cache_template, net); unix_gid_cache_create()
593 if (IS_ERR(cd)) unix_gid_cache_create()
594 return PTR_ERR(cd); unix_gid_cache_create()
595 err = cache_register_net(cd, net); unix_gid_cache_create()
597 cache_destroy_net(cd, net); unix_gid_cache_create()
600 sn->unix_gid_cache = cd; unix_gid_cache_create()
607 struct cache_detail *cd = sn->unix_gid_cache; unix_gid_cache_destroy() local
610 cache_purge(cd); unix_gid_cache_destroy()
611 cache_unregister_net(cd, net); unix_gid_cache_destroy()
612 cache_destroy_net(cd, net); unix_gid_cache_destroy()
615 static struct unix_gid *unix_gid_lookup(struct cache_detail *cd, kuid_t uid) unix_gid_lookup() argument
621 ch = sunrpc_cache_lookup(cd, &ug.h, unix_gid_hash(uid)); unix_gid_lookup()
890 struct cache_detail *cd; ip_map_cache_create() local
893 cd = cache_create_net(&ip_map_cache_template, net); ip_map_cache_create()
894 if (IS_ERR(cd)) ip_map_cache_create()
895 return PTR_ERR(cd); ip_map_cache_create()
896 err = cache_register_net(cd, net); ip_map_cache_create()
898 cache_destroy_net(cd, net); ip_map_cache_create()
901 sn->ip_map_cache = cd; ip_map_cache_create()
908 struct cache_detail *cd = sn->ip_map_cache; ip_map_cache_destroy() local
911 cache_purge(cd); ip_map_cache_destroy()
912 cache_unregister_net(cd, net); ip_map_cache_destroy()
913 cache_destroy_net(cd, net); ip_map_cache_destroy()
245 ip_map_show(struct seq_file *m, struct cache_detail *cd, struct cache_head *h) ip_map_show() argument
545 unix_gid_show(struct seq_file *m, struct cache_detail *cd, struct cache_head *h) unix_gid_show() argument
H A Drpc_pipe.c1126 umode_t umode, struct cache_detail *cd) rpc_create_cache_dir()
1129 rpc_cachedir_populate, cd); rpc_create_cache_dir()
1125 rpc_create_cache_dir(struct dentry *parent, const char *name, umode_t umode, struct cache_detail *cd) rpc_create_cache_dir() argument
/linux-4.1.27/arch/mips/cavium-octeon/
H A Docteon-irq.c63 struct octeon_ciu_chip_data *cd; octeon_irq_set_ciu_mapping() local
65 cd = kzalloc(sizeof(*cd), GFP_KERNEL); octeon_irq_set_ciu_mapping()
66 if (!cd) octeon_irq_set_ciu_mapping()
71 cd->line = line; octeon_irq_set_ciu_mapping()
72 cd->bit = bit; octeon_irq_set_ciu_mapping()
73 cd->gpio_line = gpio_line; octeon_irq_set_ciu_mapping()
75 irq_set_chip_data(irq, cd); octeon_irq_set_ciu_mapping()
83 struct octeon_ciu_chip_data *cd = irq_data_get_irq_chip_data(data); octeon_irq_free_cd() local
86 kfree(cd); octeon_irq_free_cd()
115 struct octeon_core_chip_data *cd = irq_data_get_irq_chip_data(data); octeon_irq_core_ack() local
116 unsigned int bit = cd->bit; octeon_irq_core_ack()
131 struct octeon_core_chip_data *cd = irq_data_get_irq_chip_data(data); octeon_irq_core_eoi() local
138 set_c0_status(0x100 << cd->bit); octeon_irq_core_eoi()
144 struct octeon_core_chip_data *cd = irq_data_get_irq_chip_data(data); octeon_irq_core_set_enable_local() local
145 unsigned int mask = 0x100 << cd->bit; octeon_irq_core_set_enable_local()
150 if (cd->desired_en) octeon_irq_core_set_enable_local()
159 struct octeon_core_chip_data *cd = irq_data_get_irq_chip_data(data); octeon_irq_core_disable() local
160 cd->desired_en = false; octeon_irq_core_disable()
165 struct octeon_core_chip_data *cd = irq_data_get_irq_chip_data(data); octeon_irq_core_enable() local
166 cd->desired_en = true; octeon_irq_core_enable()
171 struct octeon_core_chip_data *cd = irq_data_get_irq_chip_data(data); octeon_irq_core_bus_lock() local
173 mutex_lock(&cd->core_irq_mutex); octeon_irq_core_bus_lock()
178 struct octeon_core_chip_data *cd = irq_data_get_irq_chip_data(data); octeon_irq_core_bus_sync_unlock() local
180 if (cd->desired_en != cd->current_en) { octeon_irq_core_bus_sync_unlock()
183 cd->current_en = cd->desired_en; octeon_irq_core_bus_sync_unlock()
186 mutex_unlock(&cd->core_irq_mutex); octeon_irq_core_bus_sync_unlock()
207 struct octeon_core_chip_data *cd; octeon_irq_init_core() local
210 cd = &octeon_irq_core_chip_data[i]; octeon_irq_init_core()
211 cd->current_en = false; octeon_irq_init_core()
212 cd->desired_en = false; octeon_irq_init_core()
213 cd->bit = i; octeon_irq_init_core()
214 mutex_init(&cd->core_irq_mutex); octeon_irq_init_core()
217 irq_set_chip_data(irq, cd); octeon_irq_init_core()
229 struct octeon_ciu_chip_data *cd = irq_data_get_irq_chip_data(data); next_cpu_for_irq() local
232 cpu = cd->current_cpu; next_cpu_for_irq()
247 cd->current_cpu = cpu; next_cpu_for_irq()
260 struct octeon_ciu_chip_data *cd; octeon_irq_ciu_enable() local
263 cd = irq_data_get_irq_chip_data(data); octeon_irq_ciu_enable()
266 if (cd->line == 0) { octeon_irq_ciu_enable()
268 __set_bit(cd->bit, pen); octeon_irq_ciu_enable()
277 __set_bit(cd->bit, pen); octeon_irq_ciu_enable()
292 struct octeon_ciu_chip_data *cd; octeon_irq_ciu_enable_local() local
295 cd = irq_data_get_irq_chip_data(data); octeon_irq_ciu_enable_local()
298 if (cd->line == 0) { octeon_irq_ciu_enable_local()
300 __set_bit(cd->bit, pen); octeon_irq_ciu_enable_local()
309 __set_bit(cd->bit, pen); octeon_irq_ciu_enable_local()
324 struct octeon_ciu_chip_data *cd; octeon_irq_ciu_disable_local() local
327 cd = irq_data_get_irq_chip_data(data); octeon_irq_ciu_disable_local()
330 if (cd->line == 0) { octeon_irq_ciu_disable_local()
332 __clear_bit(cd->bit, pen); octeon_irq_ciu_disable_local()
341 __clear_bit(cd->bit, pen); octeon_irq_ciu_disable_local()
357 struct octeon_ciu_chip_data *cd; octeon_irq_ciu_disable_all() local
360 cd = irq_data_get_irq_chip_data(data); octeon_irq_ciu_disable_all()
365 if (cd->line == 0) for_each_online_cpu()
371 __clear_bit(cd->bit, pen); for_each_online_cpu()
377 if (cd->line == 0) for_each_online_cpu()
390 struct octeon_ciu_chip_data *cd; octeon_irq_ciu_enable_all() local
393 cd = irq_data_get_irq_chip_data(data); octeon_irq_ciu_enable_all()
398 if (cd->line == 0) for_each_online_cpu()
404 __set_bit(cd->bit, pen); for_each_online_cpu()
410 if (cd->line == 0) for_each_online_cpu()
426 struct octeon_ciu_chip_data *cd; octeon_irq_ciu_enable_v2() local
428 cd = irq_data_get_irq_chip_data(data); octeon_irq_ciu_enable_v2()
429 mask = 1ull << (cd->bit); octeon_irq_ciu_enable_v2()
435 if (cd->line == 0) { octeon_irq_ciu_enable_v2()
437 set_bit(cd->bit, &per_cpu(octeon_irq_ciu0_en_mirror, cpu)); octeon_irq_ciu_enable_v2()
441 set_bit(cd->bit, &per_cpu(octeon_irq_ciu1_en_mirror, cpu)); octeon_irq_ciu_enable_v2()
454 struct octeon_ciu_chip_data *cd; octeon_irq_ciu_enable_sum2() local
456 cd = irq_data_get_irq_chip_data(data); octeon_irq_ciu_enable_sum2()
457 mask = 1ull << (cd->bit); octeon_irq_ciu_enable_sum2()
470 struct octeon_ciu_chip_data *cd; octeon_irq_ciu_disable_local_sum2() local
472 cd = irq_data_get_irq_chip_data(data); octeon_irq_ciu_disable_local_sum2()
473 mask = 1ull << (cd->bit); octeon_irq_ciu_disable_local_sum2()
483 struct octeon_ciu_chip_data *cd; octeon_irq_ciu_ack_sum2() local
485 cd = irq_data_get_irq_chip_data(data); octeon_irq_ciu_ack_sum2()
486 mask = 1ull << (cd->bit); octeon_irq_ciu_ack_sum2()
494 struct octeon_ciu_chip_data *cd; octeon_irq_ciu_disable_all_sum2() local
497 cd = irq_data_get_irq_chip_data(data); octeon_irq_ciu_disable_all_sum2()
498 mask = 1ull << (cd->bit); octeon_irq_ciu_disable_all_sum2()
514 struct octeon_ciu_chip_data *cd; octeon_irq_ciu_enable_local_v2() local
516 cd = irq_data_get_irq_chip_data(data); octeon_irq_ciu_enable_local_v2()
517 mask = 1ull << (cd->bit); octeon_irq_ciu_enable_local_v2()
519 if (cd->line == 0) { octeon_irq_ciu_enable_local_v2()
521 set_bit(cd->bit, this_cpu_ptr(&octeon_irq_ciu0_en_mirror)); octeon_irq_ciu_enable_local_v2()
525 set_bit(cd->bit, this_cpu_ptr(&octeon_irq_ciu1_en_mirror)); octeon_irq_ciu_enable_local_v2()
533 struct octeon_ciu_chip_data *cd; octeon_irq_ciu_disable_local_v2() local
535 cd = irq_data_get_irq_chip_data(data); octeon_irq_ciu_disable_local_v2()
536 mask = 1ull << (cd->bit); octeon_irq_ciu_disable_local_v2()
538 if (cd->line == 0) { octeon_irq_ciu_disable_local_v2()
540 clear_bit(cd->bit, this_cpu_ptr(&octeon_irq_ciu0_en_mirror)); octeon_irq_ciu_disable_local_v2()
544 clear_bit(cd->bit, this_cpu_ptr(&octeon_irq_ciu1_en_mirror)); octeon_irq_ciu_disable_local_v2()
555 struct octeon_ciu_chip_data *cd; octeon_irq_ciu_ack() local
557 cd = irq_data_get_irq_chip_data(data); octeon_irq_ciu_ack()
558 mask = 1ull << (cd->bit); octeon_irq_ciu_ack()
560 if (cd->line == 0) { octeon_irq_ciu_ack()
576 struct octeon_ciu_chip_data *cd; octeon_irq_ciu_disable_all_v2() local
578 cd = irq_data_get_irq_chip_data(data); octeon_irq_ciu_disable_all_v2()
579 mask = 1ull << (cd->bit); octeon_irq_ciu_disable_all_v2()
581 if (cd->line == 0) { for_each_online_cpu()
584 clear_bit(cd->bit, for_each_online_cpu()
591 clear_bit(cd->bit, for_each_online_cpu()
606 struct octeon_ciu_chip_data *cd; octeon_irq_ciu_enable_all_v2() local
608 cd = irq_data_get_irq_chip_data(data); octeon_irq_ciu_enable_all_v2()
609 mask = 1ull << (cd->bit); octeon_irq_ciu_enable_all_v2()
611 if (cd->line == 0) { for_each_online_cpu()
614 set_bit(cd->bit, for_each_online_cpu()
621 set_bit(cd->bit, for_each_online_cpu()
631 struct octeon_ciu_chip_data *cd; octeon_irq_gpio_setup() local
634 cd = irq_data_get_irq_chip_data(data); octeon_irq_gpio_setup()
645 cvmx_write_csr(CVMX_GPIO_BIT_CFGX(cd->gpio_line), cfg.u64); octeon_irq_gpio_setup()
670 struct octeon_ciu_chip_data *cd; octeon_irq_ciu_disable_gpio_v2() local
672 cd = irq_data_get_irq_chip_data(data); octeon_irq_ciu_disable_gpio_v2()
673 cvmx_write_csr(CVMX_GPIO_BIT_CFGX(cd->gpio_line), 0); octeon_irq_ciu_disable_gpio_v2()
680 struct octeon_ciu_chip_data *cd; octeon_irq_ciu_disable_gpio() local
682 cd = irq_data_get_irq_chip_data(data); octeon_irq_ciu_disable_gpio()
683 cvmx_write_csr(CVMX_GPIO_BIT_CFGX(cd->gpio_line), 0); octeon_irq_ciu_disable_gpio()
690 struct octeon_ciu_chip_data *cd; octeon_irq_ciu_gpio_ack() local
693 cd = irq_data_get_irq_chip_data(data); octeon_irq_ciu_gpio_ack()
694 mask = 1ull << (cd->gpio_line); octeon_irq_ciu_gpio_ack()
738 struct octeon_ciu_chip_data *cd; octeon_irq_ciu_set_affinity() local
742 cd = irq_data_get_irq_chip_data(data); octeon_irq_ciu_set_affinity()
762 if (cd->line == 0) for_each_online_cpu()
769 __set_bit(cd->bit, pen); for_each_online_cpu()
771 __clear_bit(cd->bit, pen); for_each_online_cpu()
779 if (cd->line == 0) for_each_online_cpu()
800 struct octeon_ciu_chip_data *cd; octeon_irq_ciu_set_affinity_v2() local
805 cd = irq_data_get_irq_chip_data(data); octeon_irq_ciu_set_affinity_v2()
806 mask = 1ull << cd->bit; octeon_irq_ciu_set_affinity_v2()
808 if (cd->line == 0) { for_each_online_cpu()
814 set_bit(cd->bit, pen); for_each_online_cpu()
817 clear_bit(cd->bit, pen); for_each_online_cpu()
827 set_bit(cd->bit, pen); for_each_online_cpu()
830 clear_bit(cd->bit, pen); for_each_online_cpu()
845 struct octeon_ciu_chip_data *cd; octeon_irq_ciu_set_affinity_sum2() local
850 cd = irq_data_get_irq_chip_data(data); octeon_irq_ciu_set_affinity_sum2()
851 mask = 1ull << cd->bit; octeon_irq_ciu_set_affinity_sum2()
1597 struct octeon_ciu_chip_data *cd; octeon_irq_ciu2_wd_enable() local
1599 cd = irq_data_get_irq_chip_data(data); octeon_irq_ciu2_wd_enable()
1600 mask = 1ull << (cd->bit); octeon_irq_ciu2_wd_enable()
1603 (0x1000ull * cd->line); octeon_irq_ciu2_wd_enable()
1614 struct octeon_ciu_chip_data *cd; octeon_irq_ciu2_enable() local
1616 cd = irq_data_get_irq_chip_data(data); octeon_irq_ciu2_enable()
1617 mask = 1ull << (cd->bit); octeon_irq_ciu2_enable()
1620 (0x1000ull * cd->line); octeon_irq_ciu2_enable()
1629 struct octeon_ciu_chip_data *cd; octeon_irq_ciu2_enable_local() local
1631 cd = irq_data_get_irq_chip_data(data); octeon_irq_ciu2_enable_local()
1632 mask = 1ull << (cd->bit); octeon_irq_ciu2_enable_local()
1635 (0x1000ull * cd->line); octeon_irq_ciu2_enable_local()
1645 struct octeon_ciu_chip_data *cd; octeon_irq_ciu2_disable_local() local
1647 cd = irq_data_get_irq_chip_data(data); octeon_irq_ciu2_disable_local()
1648 mask = 1ull << (cd->bit); octeon_irq_ciu2_disable_local()
1651 (0x1000ull * cd->line); octeon_irq_ciu2_disable_local()
1661 struct octeon_ciu_chip_data *cd; octeon_irq_ciu2_ack() local
1663 cd = irq_data_get_irq_chip_data(data); octeon_irq_ciu2_ack()
1664 mask = 1ull << (cd->bit); octeon_irq_ciu2_ack()
1666 en_addr = CVMX_CIU2_RAW_PPX_IP2_WRKQ(coreid) + (0x1000ull * cd->line); octeon_irq_ciu2_ack()
1675 struct octeon_ciu_chip_data *cd; octeon_irq_ciu2_disable_all() local
1677 cd = irq_data_get_irq_chip_data(data); octeon_irq_ciu2_disable_all()
1678 mask = 1ull << (cd->bit); octeon_irq_ciu2_disable_all()
1682 octeon_coreid_for_cpu(cpu)) + (0x1000ull * cd->line); for_each_online_cpu()
1744 struct octeon_ciu_chip_data *cd; octeon_irq_ciu2_set_affinity() local
1749 cd = irq_data_get_irq_chip_data(data); octeon_irq_ciu2_set_affinity()
1750 mask = 1ull << cd->bit; octeon_irq_ciu2_set_affinity()
1758 (0x1000ull * cd->line); for_each_online_cpu()
1762 (0x1000ull * cd->line); for_each_online_cpu()
1779 struct octeon_ciu_chip_data *cd; octeon_irq_ciu2_disable_gpio() local
1781 cd = irq_data_get_irq_chip_data(data); octeon_irq_ciu2_disable_gpio()
1783 cvmx_write_csr(CVMX_GPIO_BIT_CFGX(cd->gpio_line), 0); octeon_irq_ciu2_disable_gpio()
2086 struct octeon_irq_cib_chip_data *cd = irq_data_get_irq_chip_data(data); octeon_irq_cib_enable() local
2087 struct octeon_irq_cib_host_data *host_data = cd->host_data; octeon_irq_cib_enable()
2091 en |= 1ull << cd->bit; octeon_irq_cib_enable()
2100 struct octeon_irq_cib_chip_data *cd = irq_data_get_irq_chip_data(data); octeon_irq_cib_disable() local
2101 struct octeon_irq_cib_host_data *host_data = cd->host_data; octeon_irq_cib_disable()
2105 en &= ~(1ull << cd->bit); octeon_irq_cib_disable()
2158 struct octeon_irq_cib_chip_data *cd; octeon_irq_cib_map() local
2166 cd = kzalloc(sizeof(*cd), GFP_KERNEL); octeon_irq_cib_map()
2167 cd->host_data = host_data; octeon_irq_cib_map()
2168 cd->bit = hw; octeon_irq_cib_map()
2172 irq_set_chip_data(virq, cd); octeon_irq_cib_map()
/linux-4.1.27/drivers/net/wireless/ath/
H A Ddfs_pattern_detector.c158 struct channel_detector *cd) channel_detector_reset()
161 if (cd == NULL) channel_detector_reset()
164 cd->detectors[i]->reset(cd->detectors[i], dpd->last_pulse_ts); channel_detector_reset()
169 struct channel_detector *cd) channel_detector_exit()
172 if (cd == NULL) channel_detector_exit()
174 list_del(&cd->head); channel_detector_exit()
176 struct pri_detector *de = cd->detectors[i]; channel_detector_exit()
180 kfree(cd->detectors); channel_detector_exit()
181 kfree(cd); channel_detector_exit()
188 struct channel_detector *cd; channel_detector_create() local
190 cd = kmalloc(sizeof(*cd), GFP_ATOMIC); channel_detector_create()
191 if (cd == NULL) channel_detector_create()
194 INIT_LIST_HEAD(&cd->head); channel_detector_create()
195 cd->freq = freq; channel_detector_create()
196 sz = sizeof(cd->detectors) * dpd->num_radar_types; channel_detector_create()
197 cd->detectors = kzalloc(sz, GFP_ATOMIC); channel_detector_create()
198 if (cd->detectors == NULL) channel_detector_create()
206 cd->detectors[i] = de; channel_detector_create()
208 list_add(&cd->head, &dpd->channel_detectors); channel_detector_create()
209 return cd; channel_detector_create()
214 channel_detector_exit(dpd, cd); channel_detector_create()
230 struct channel_detector *cd; channel_detector_get() local
231 list_for_each_entry(cd, &dpd->channel_detectors, head) { channel_detector_get()
232 if (cd->freq == freq) channel_detector_get()
233 return cd; channel_detector_get()
245 struct channel_detector *cd; dpd_reset() local
247 list_for_each_entry(cd, &dpd->channel_detectors, head) dpd_reset()
248 channel_detector_reset(dpd, cd); dpd_reset()
253 struct channel_detector *cd, *cd0; dpd_exit() local
255 list_for_each_entry_safe(cd, cd0, &dpd->channel_detectors, head) dpd_exit()
256 channel_detector_exit(dpd, cd); dpd_exit()
264 struct channel_detector *cd; dpd_add_pulse() local
273 cd = channel_detector_get(dpd, event->freq); dpd_add_pulse()
274 if (cd == NULL) dpd_add_pulse()
284 struct pri_detector *pd = cd->detectors[i]; dpd_add_pulse()
309 struct channel_detector *cd, *cd0; dpd_set_domain() local
322 list_for_each_entry_safe(cd, cd0, &dpd->channel_detectors, head) dpd_set_domain()
323 channel_detector_exit(dpd, cd); dpd_set_domain()
157 channel_detector_reset(struct dfs_pattern_detector *dpd, struct channel_detector *cd) channel_detector_reset() argument
168 channel_detector_exit(struct dfs_pattern_detector *dpd, struct channel_detector *cd) channel_detector_exit() argument
/linux-4.1.27/drivers/zorro/
H A Dzorro-sysfs.c70 struct ConfigDev cd; zorro_read_config() local
73 memset(&cd, 0, sizeof(cd)); zorro_read_config()
74 cd.cd_Rom = z->rom; zorro_read_config()
75 cd.cd_SlotAddr = cpu_to_be16(z->slotaddr); zorro_read_config()
76 cd.cd_SlotSize = cpu_to_be16(z->slotsize); zorro_read_config()
77 cd.cd_BoardAddr = cpu_to_be32(zorro_resource_start(z)); zorro_read_config()
78 cd.cd_BoardSize = cpu_to_be32(zorro_resource_len(z)); zorro_read_config()
80 return memory_read_from_buffer(buf, count, &off, &cd, sizeof(cd)); zorro_read_config()
H A Dproc.c33 struct ConfigDev cd; proc_bus_zorro_read() local
44 memset(&cd, 0, sizeof(cd)); proc_bus_zorro_read()
45 cd.cd_Rom = z->rom; proc_bus_zorro_read()
46 cd.cd_SlotAddr = cpu_to_be16(z->slotaddr); proc_bus_zorro_read()
47 cd.cd_SlotSize = cpu_to_be16(z->slotsize); proc_bus_zorro_read()
48 cd.cd_BoardAddr = cpu_to_be32(zorro_resource_start(z)); proc_bus_zorro_read()
49 cd.cd_BoardSize = cpu_to_be32(zorro_resource_len(z)); proc_bus_zorro_read()
51 if (copy_to_user(buf, (void *)&cd + pos, nbytes)) proc_bus_zorro_read()
H A DMakefile19 cmd_devlist = ( cd $(obj); ./gen-devlist ) < $<
/linux-4.1.27/drivers/clocksource/
H A Dmips-gic-timer.c44 struct clock_event_device *cd = dev_id; gic_compare_interrupt() local
47 cd->event_handler(cd); gic_compare_interrupt()
58 static void gic_clockevent_cpu_init(struct clock_event_device *cd) gic_clockevent_cpu_init() argument
62 cd->name = "MIPS GIC"; gic_clockevent_cpu_init()
63 cd->features = CLOCK_EVT_FEAT_ONESHOT | gic_clockevent_cpu_init()
66 cd->rating = 350; gic_clockevent_cpu_init()
67 cd->irq = gic_timer_irq; gic_clockevent_cpu_init()
68 cd->cpumask = cpumask_of(cpu); gic_clockevent_cpu_init()
69 cd->set_next_event = gic_next_event; gic_clockevent_cpu_init()
70 cd->set_mode = gic_set_clock_mode; gic_clockevent_cpu_init()
72 clockevents_config_and_register(cd, gic_frequency, 0x300, 0x7fffffff); gic_clockevent_cpu_init()
77 static void gic_clockevent_cpu_exit(struct clock_event_device *cd) gic_clockevent_cpu_exit() argument
/linux-4.1.27/arch/mips/loongson/loongson-3/
H A Dhpet.c149 struct clock_event_device *cd; hpet_irq_handler() local
156 cd = &per_cpu(hpet_clockevent_device, cpu); hpet_irq_handler()
157 cd->event_handler(cd); hpet_irq_handler()
201 struct clock_event_device *cd; setup_hpet_timer() local
205 cd = &per_cpu(hpet_clockevent_device, cpu); setup_hpet_timer()
206 cd->name = "hpet"; setup_hpet_timer()
207 cd->rating = 320; setup_hpet_timer()
208 cd->features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT; setup_hpet_timer()
209 cd->set_mode = hpet_set_mode; setup_hpet_timer()
210 cd->set_next_event = hpet_next_event; setup_hpet_timer()
211 cd->irq = HPET_T0_IRQ; setup_hpet_timer()
212 cd->cpumask = cpumask_of(cpu); setup_hpet_timer()
213 clockevent_set_clock(cd, HPET_FREQ); setup_hpet_timer()
214 cd->max_delta_ns = clockevent_delta2ns(0x7fffffff, cd); setup_hpet_timer()
215 cd->min_delta_ns = 5000; setup_hpet_timer()
217 clockevents_register_device(cd); setup_hpet_timer()
/linux-4.1.27/arch/mips/sgi-ip27/
H A Dip27-timer.c81 struct clock_event_device *cd = &per_cpu(hub_rt_clockevent, cpu); hub_rt_counter_handler() local
88 cd->event_handler(cd); hub_rt_counter_handler()
113 struct clock_event_device *cd = &per_cpu(hub_rt_clockevent, cpu); hub_rt_clock_event_init() local
118 cd->name = name; hub_rt_clock_event_init()
119 cd->features = CLOCK_EVT_FEAT_ONESHOT; hub_rt_clock_event_init()
120 clockevent_set_clock(cd, CYCLES_PER_SEC); hub_rt_clock_event_init()
121 cd->max_delta_ns = clockevent_delta2ns(0xfffffffffffff, cd); hub_rt_clock_event_init()
122 cd->min_delta_ns = clockevent_delta2ns(0x300, cd); hub_rt_clock_event_init()
123 cd->rating = 200; hub_rt_clock_event_init()
124 cd->irq = irq; hub_rt_clock_event_init()
125 cd->cpumask = cpumask_of(cpu); hub_rt_clock_event_init()
126 cd->set_next_event = rt_next_event; hub_rt_clock_event_init()
127 cd->set_mode = rt_set_mode; hub_rt_clock_event_init()
128 clockevents_register_device(cd); hub_rt_clock_event_init()
/linux-4.1.27/fs/
H A Dchar_dev.c50 struct char_device_struct *cd; chrdev_show() local
54 for (cd = chrdevs[offset]; cd; cd = cd->next) chrdev_show()
55 seq_printf(f, "%3d %s\n", cd->major, cd->name); chrdev_show()
77 struct char_device_struct *cd, **cp; __register_chrdev_region() local
81 cd = kzalloc(sizeof(struct char_device_struct), GFP_KERNEL); __register_chrdev_region()
82 if (cd == NULL) __register_chrdev_region()
101 cd->major = major; __register_chrdev_region()
102 cd->baseminor = baseminor; __register_chrdev_region()
103 cd->minorct = minorct; __register_chrdev_region()
104 strlcpy(cd->name, name, sizeof(cd->name)); __register_chrdev_region()
135 cd->next = *cp; __register_chrdev_region()
136 *cp = cd; __register_chrdev_region()
138 return cd; __register_chrdev_region()
141 kfree(cd); __register_chrdev_region()
148 struct char_device_struct *cd = NULL, **cp; __unregister_chrdev_region() local
158 cd = *cp; __unregister_chrdev_region()
159 *cp = cd->next; __unregister_chrdev_region()
162 return cd; __unregister_chrdev_region()
176 struct char_device_struct *cd; register_chrdev_region() local
184 cd = __register_chrdev_region(MAJOR(n), MINOR(n), register_chrdev_region()
186 if (IS_ERR(cd)) register_chrdev_region()
196 return PTR_ERR(cd); register_chrdev_region()
213 struct char_device_struct *cd; alloc_chrdev_region() local
214 cd = __register_chrdev_region(0, baseminor, count, name); alloc_chrdev_region()
215 if (IS_ERR(cd)) alloc_chrdev_region()
216 return PTR_ERR(cd); alloc_chrdev_region()
217 *dev = MKDEV(cd->major, cd->baseminor); alloc_chrdev_region()
246 struct char_device_struct *cd; __register_chrdev() local
250 cd = __register_chrdev_region(major, baseminor, count, name); __register_chrdev()
251 if (IS_ERR(cd)) __register_chrdev()
252 return PTR_ERR(cd); __register_chrdev()
262 err = cdev_add(cdev, MKDEV(cd->major, baseminor), count); __register_chrdev()
266 cd->cdev = cdev; __register_chrdev()
268 return major ? 0 : cd->major; __register_chrdev()
272 kfree(__unregister_chrdev_region(cd->major, baseminor, count)); __register_chrdev()
312 struct char_device_struct *cd; __unregister_chrdev() local
314 cd = __unregister_chrdev_region(major, baseminor, count); __unregister_chrdev()
315 if (cd && cd->cdev) __unregister_chrdev()
316 cdev_del(cd->cdev); __unregister_chrdev()
317 kfree(cd); __unregister_chrdev()
/linux-4.1.27/arch/mips/paravirt/
H A Dparavirt-irq.c38 struct core_chip_data *cd = irq_data_get_irq_chip_data(data); irq_core_ack() local
39 unsigned int bit = cd->bit; irq_core_ack()
54 struct core_chip_data *cd = irq_data_get_irq_chip_data(data); irq_core_eoi() local
61 set_c0_status(0x100 << cd->bit); irq_core_eoi()
67 struct core_chip_data *cd = irq_data_get_irq_chip_data(data); irq_core_set_enable_local() local
68 unsigned int mask = 0x100 << cd->bit; irq_core_set_enable_local()
73 if (cd->desired_en) irq_core_set_enable_local()
82 struct core_chip_data *cd = irq_data_get_irq_chip_data(data); irq_core_disable() local
83 cd->desired_en = false; irq_core_disable()
88 struct core_chip_data *cd = irq_data_get_irq_chip_data(data); irq_core_enable() local
89 cd->desired_en = true; irq_core_enable()
94 struct core_chip_data *cd = irq_data_get_irq_chip_data(data); irq_core_bus_lock() local
96 mutex_lock(&cd->core_irq_mutex); irq_core_bus_lock()
101 struct core_chip_data *cd = irq_data_get_irq_chip_data(data); irq_core_bus_sync_unlock() local
103 if (cd->desired_en != cd->current_en) { irq_core_bus_sync_unlock()
105 cd->current_en = cd->desired_en; irq_core_bus_sync_unlock()
108 mutex_unlock(&cd->core_irq_mutex); irq_core_bus_sync_unlock()
129 struct core_chip_data *cd; irq_init_core() local
136 cd = irq_core_chip_data + i; irq_init_core()
137 cd->current_en = false; irq_init_core()
138 cd->desired_en = false; irq_init_core()
139 cd->bit = i; irq_init_core()
140 mutex_init(&cd->core_irq_mutex); irq_init_core()
150 irq_set_chip_data(irq, cd); irq_init_core()
/linux-4.1.27/scripts/gdb/linux/
H A DMakefile3 SRCTREE := $(shell cd $(srctree) && /bin/pwd)
/linux-4.1.27/arch/arm/mach-spear/
H A Dpl080.h18 int pl080_get_signal(const struct pl08x_channel_data *cd);
19 void pl080_put_signal(const struct pl08x_channel_data *cd, int signal);
H A Dpl080.c30 int pl080_get_signal(const struct pl08x_channel_data *cd) pl080_get_signal() argument
32 unsigned int signal = cd->min_signal, val; pl080_get_signal()
39 (signals[signal].val != cd->muxval)) { pl080_get_signal()
54 val |= cd->muxval << (signal * 2); pl080_get_signal()
59 signals[signal].val = cd->muxval; pl080_get_signal()
65 void pl080_put_signal(const struct pl08x_channel_data *cd, int signal) pl080_put_signal() argument
/linux-4.1.27/arch/c6x/platforms/
H A Dtimer64.c162 struct clock_event_device *cd = &t64_clockevent_device; timer_interrupt() local
164 cd->event_handler(cd); timer_interrupt()
178 struct clock_event_device *cd = &t64_clockevent_device; timer64_init() local
210 cd->irq = irq_of_parse_and_map(np, 0); timer64_init()
211 if (cd->irq == NO_IRQ) { timer64_init()
230 pr_debug("%s: Timer irq=%d.\n", np->full_name, cd->irq); timer64_init()
232 clockevents_calc_mult_shift(cd, c6x_core_freq / TIMER_DIVISOR, 5); timer64_init()
234 cd->max_delta_ns = clockevent_delta2ns(0x7fffffff, cd); timer64_init()
235 cd->min_delta_ns = clockevent_delta2ns(250, cd); timer64_init()
237 cd->cpumask = cpumask_of(smp_processor_id()); timer64_init()
239 clockevents_register_device(cd); timer64_init()
240 setup_irq(cd->irq, &timer_iact); timer64_init()
/linux-4.1.27/arch/mips/alchemy/common/
H A Dtime.c61 struct clock_event_device *cd) au1x_rtcmatch2_set_next_event()
73 struct clock_event_device *cd) au1x_rtcmatch2_set_mode()
79 struct clock_event_device *cd = dev_id; au1x_rtcmatch2_irq() local
80 cd->event_handler(cd); au1x_rtcmatch2_irq()
102 struct clock_event_device *cd = &au1x_rtcmatch2_clockdev; alchemy_time_init() local
144 cd->shift = 32; alchemy_time_init()
145 cd->mult = div_sc(32768, NSEC_PER_SEC, cd->shift); alchemy_time_init()
146 cd->max_delta_ns = clockevent_delta2ns(0xffffffff, cd); alchemy_time_init()
147 cd->min_delta_ns = clockevent_delta2ns(9, cd); /* ~0.28ms */ alchemy_time_init()
148 clockevents_register_device(cd); alchemy_time_init()
60 au1x_rtcmatch2_set_next_event(unsigned long delta, struct clock_event_device *cd) au1x_rtcmatch2_set_next_event() argument
72 au1x_rtcmatch2_set_mode(enum clock_event_mode mode, struct clock_event_device *cd) au1x_rtcmatch2_set_mode() argument
/linux-4.1.27/arch/mips/loongson1/common/
H A Dtime.c121 struct clock_event_device *cd = devid; ls1x_clockevent_isr() local
124 cd->event_handler(cd); ls1x_clockevent_isr()
130 struct clock_event_device *cd) ls1x_clockevent_set_mode()
152 struct clock_event_device *cd) ls1x_clockevent_set_next()
180 struct clock_event_device *cd = &ls1x_clockevent; ls1x_time_init() local
188 clockevent_set_clock(cd, mips_hpt_frequency); ls1x_time_init()
189 cd->max_delta_ns = clockevent_delta2ns(0xffffff, cd); ls1x_time_init()
190 cd->min_delta_ns = clockevent_delta2ns(0x000300, cd); ls1x_time_init()
191 cd->cpumask = cpumask_of(smp_processor_id()); ls1x_time_init()
192 clockevents_register_device(cd); ls1x_time_init()
129 ls1x_clockevent_set_mode(enum clock_event_mode mode, struct clock_event_device *cd) ls1x_clockevent_set_mode() argument
151 ls1x_clockevent_set_next(unsigned long evt, struct clock_event_device *cd) ls1x_clockevent_set_next() argument
/linux-4.1.27/arch/mips/jz4740/
H A Dtime.c54 struct clock_event_device *cd = devid; jz4740_clockevent_irq() local
58 if (cd->mode != CLOCK_EVT_MODE_PERIODIC) jz4740_clockevent_irq()
61 cd->event_handler(cd); jz4740_clockevent_irq()
67 struct clock_event_device *cd) jz4740_clockevent_set_mode()
87 struct clock_event_device *cd) jz4740_clockevent_set_next()
66 jz4740_clockevent_set_mode(enum clock_event_mode mode, struct clock_event_device *cd) jz4740_clockevent_set_mode() argument
86 jz4740_clockevent_set_next(unsigned long evt, struct clock_event_device *cd) jz4740_clockevent_set_next() argument
/linux-4.1.27/arch/mips/jazz/
H A Dirq.c129 struct clock_event_device *cd = dev_id; r4030_timer_interrupt() local
131 cd->event_handler(cd); r4030_timer_interrupt()
143 struct clock_event_device *cd = &r4030_clockevent; plat_time_init() local
149 cd->cpumask = cpumask_of(cpu); plat_time_init()
150 clockevents_register_device(cd); plat_time_init()
151 action->dev_id = cd; plat_time_init()
/linux-4.1.27/arch/arm/mach-omap2/
H A Dclockdomain.c104 struct clkdm_dep *cd; _clkdm_deps_lookup() local
109 for (cd = deps; cd->clkdm_name; cd++) { _clkdm_deps_lookup()
110 if (!cd->clkdm && cd->clkdm_name) _clkdm_deps_lookup()
111 cd->clkdm = _clkdm_lookup(cd->clkdm_name); _clkdm_deps_lookup()
113 if (cd->clkdm == clkdm) _clkdm_deps_lookup()
117 if (!cd->clkdm_name) _clkdm_deps_lookup()
120 return cd; _clkdm_deps_lookup()
167 struct clkdm_dep *cd; _resolve_clkdm_deps() local
169 for (cd = clkdm_deps; cd && cd->clkdm_name; cd++) { _resolve_clkdm_deps()
170 if (cd->clkdm) _resolve_clkdm_deps()
172 cd->clkdm = _clkdm_lookup(cd->clkdm_name); _resolve_clkdm_deps()
174 WARN(!cd->clkdm, "clockdomain: %s: could not find clkdm %s while resolving dependencies - should never happen", _resolve_clkdm_deps()
175 clkdm->name, cd->clkdm_name); _resolve_clkdm_deps()
194 struct clkdm_dep *cd; _clkdm_add_wkdep() local
200 cd = _clkdm_deps_lookup(clkdm2, clkdm1->wkdep_srcs); _clkdm_add_wkdep()
201 if (IS_ERR(cd)) _clkdm_add_wkdep()
202 ret = PTR_ERR(cd); _clkdm_add_wkdep()
213 cd->wkdep_usecount++; _clkdm_add_wkdep()
214 if (cd->wkdep_usecount == 1) { _clkdm_add_wkdep()
237 struct clkdm_dep *cd; _clkdm_del_wkdep() local
243 cd = _clkdm_deps_lookup(clkdm2, clkdm1->wkdep_srcs); _clkdm_del_wkdep()
244 if (IS_ERR(cd)) _clkdm_del_wkdep()
245 ret = PTR_ERR(cd); _clkdm_del_wkdep()
256 cd->wkdep_usecount--; _clkdm_del_wkdep()
257 if (cd->wkdep_usecount == 0) { _clkdm_del_wkdep()
282 struct clkdm_dep *cd; _clkdm_add_sleepdep() local
288 cd = _clkdm_deps_lookup(clkdm2, clkdm1->sleepdep_srcs); _clkdm_add_sleepdep()
289 if (IS_ERR(cd)) _clkdm_add_sleepdep()
290 ret = PTR_ERR(cd); _clkdm_add_sleepdep()
301 cd->sleepdep_usecount++; _clkdm_add_sleepdep()
302 if (cd->sleepdep_usecount == 1) { _clkdm_add_sleepdep()
327 struct clkdm_dep *cd; _clkdm_del_sleepdep() local
333 cd = _clkdm_deps_lookup(clkdm2, clkdm1->sleepdep_srcs); _clkdm_del_sleepdep()
334 if (IS_ERR(cd)) _clkdm_del_sleepdep()
335 ret = PTR_ERR(cd); _clkdm_del_sleepdep()
346 cd->sleepdep_usecount--; _clkdm_del_sleepdep()
347 if (cd->sleepdep_usecount == 0) { _clkdm_del_sleepdep()
574 struct clkdm_dep *cd; clkdm_add_wkdep() local
580 cd = _clkdm_deps_lookup(clkdm2, clkdm1->wkdep_srcs); clkdm_add_wkdep()
581 if (IS_ERR(cd)) clkdm_add_wkdep()
582 return PTR_ERR(cd); clkdm_add_wkdep()
584 pwrdm_lock(cd->clkdm->pwrdm.ptr); clkdm_add_wkdep()
586 pwrdm_unlock(cd->clkdm->pwrdm.ptr); clkdm_add_wkdep()
603 struct clkdm_dep *cd; clkdm_del_wkdep() local
609 cd = _clkdm_deps_lookup(clkdm2, clkdm1->wkdep_srcs); clkdm_del_wkdep()
610 if (IS_ERR(cd)) clkdm_del_wkdep()
611 return PTR_ERR(cd); clkdm_del_wkdep()
613 pwrdm_lock(cd->clkdm->pwrdm.ptr); clkdm_del_wkdep()
615 pwrdm_unlock(cd->clkdm->pwrdm.ptr); clkdm_del_wkdep()
636 struct clkdm_dep *cd; clkdm_read_wkdep() local
642 cd = _clkdm_deps_lookup(clkdm2, clkdm1->wkdep_srcs); clkdm_read_wkdep()
643 if (IS_ERR(cd)) clkdm_read_wkdep()
644 ret = PTR_ERR(cd); clkdm_read_wkdep()
694 struct clkdm_dep *cd; clkdm_add_sleepdep() local
700 cd = _clkdm_deps_lookup(clkdm2, clkdm1->wkdep_srcs); clkdm_add_sleepdep()
701 if (IS_ERR(cd)) clkdm_add_sleepdep()
702 return PTR_ERR(cd); clkdm_add_sleepdep()
704 pwrdm_lock(cd->clkdm->pwrdm.ptr); clkdm_add_sleepdep()
706 pwrdm_unlock(cd->clkdm->pwrdm.ptr); clkdm_add_sleepdep()
725 struct clkdm_dep *cd; clkdm_del_sleepdep() local
731 cd = _clkdm_deps_lookup(clkdm2, clkdm1->wkdep_srcs); clkdm_del_sleepdep()
732 if (IS_ERR(cd)) clkdm_del_sleepdep()
733 return PTR_ERR(cd); clkdm_del_sleepdep()
735 pwrdm_lock(cd->clkdm->pwrdm.ptr); clkdm_del_sleepdep()
737 pwrdm_unlock(cd->clkdm->pwrdm.ptr); clkdm_del_sleepdep()
760 struct clkdm_dep *cd; clkdm_read_sleepdep() local
766 cd = _clkdm_deps_lookup(clkdm2, clkdm1->sleepdep_srcs); clkdm_read_sleepdep()
767 if (IS_ERR(cd)) clkdm_read_sleepdep()
768 ret = PTR_ERR(cd); clkdm_read_sleepdep()
H A Dprm2xxx_3xxx.c224 struct clkdm_dep *cd; omap2_clkdm_clear_all_wkdeps() local
227 for (cd = clkdm->wkdep_srcs; cd && cd->clkdm_name; cd++) { omap2_clkdm_clear_all_wkdeps()
228 if (!cd->clkdm) omap2_clkdm_clear_all_wkdeps()
232 mask |= 1 << cd->clkdm->dep_bit; omap2_clkdm_clear_all_wkdeps()
233 cd->wkdep_usecount = 0; omap2_clkdm_clear_all_wkdeps()
H A Dcm3xxx.c181 struct clkdm_dep *cd; omap3xxx_clkdm_clear_all_sleepdeps() local
184 for (cd = clkdm->sleepdep_srcs; cd && cd->clkdm_name; cd++) { omap3xxx_clkdm_clear_all_sleepdeps()
185 if (!cd->clkdm) omap3xxx_clkdm_clear_all_sleepdeps()
188 mask |= 1 << cd->clkdm->dep_bit; omap3xxx_clkdm_clear_all_sleepdeps()
189 cd->sleepdep_usecount = 0; omap3xxx_clkdm_clear_all_sleepdeps()
H A Dcminst44xx.c390 struct clkdm_dep *cd; omap4_clkdm_clear_all_wkup_sleep_deps() local
396 for (cd = clkdm->wkdep_srcs; cd && cd->clkdm_name; cd++) { omap4_clkdm_clear_all_wkup_sleep_deps()
397 if (!cd->clkdm) omap4_clkdm_clear_all_wkup_sleep_deps()
400 mask |= 1 << cd->clkdm->dep_bit; omap4_clkdm_clear_all_wkup_sleep_deps()
401 cd->wkdep_usecount = 0; omap4_clkdm_clear_all_wkup_sleep_deps()
/linux-4.1.27/fs/nfsd/
H A Dexport.c51 static void expkey_request(struct cache_detail *cd, expkey_request() argument
66 static struct svc_expkey *svc_expkey_update(struct cache_detail *cd, struct svc_expkey *new,
68 static struct svc_expkey *svc_expkey_lookup(struct cache_detail *cd, struct svc_expkey *);
70 static int expkey_parse(struct cache_detail *cd, char *mesg, int mlen) expkey_parse() argument
126 ek = svc_expkey_lookup(cd, &key); expkey_parse()
140 ek = svc_expkey_update(cd, &key, ek); expkey_parse()
150 ek = svc_expkey_update(cd, &key, ek); expkey_parse()
158 cache_put(&ek->h, cd); expkey_parse()
166 struct cache_detail *cd, expkey_show()
262 svc_expkey_lookup(struct cache_detail *cd, struct svc_expkey *item) svc_expkey_lookup() argument
267 ch = sunrpc_cache_lookup(cd, &item->h, hash); svc_expkey_lookup()
275 svc_expkey_update(struct cache_detail *cd, struct svc_expkey *new, svc_expkey_update() argument
281 ch = sunrpc_cache_update(cd, &new->h, &old->h, hash); svc_expkey_update()
319 static void svc_export_request(struct cache_detail *cd, svc_export_request() argument
509 static int svc_export_parse(struct cache_detail *cd, char *mesg, int mlen) svc_export_parse() argument
548 exp.cd = cd; svc_export_parse()
657 struct cache_detail *cd, svc_export_show()
711 new->cd = item->cd; svc_export_init()
781 ch = sunrpc_cache_lookup(exp->cd, &exp->h, hash); svc_export_lookup()
794 ch = sunrpc_cache_update(old->cd, &new->h, &old->h, hash); svc_export_update()
803 exp_find_key(struct cache_detail *cd, struct auth_domain *clp, int fsid_type, exp_find_key() argument
816 ek = svc_expkey_lookup(cd, &key); exp_find_key()
819 err = cache_check(cd, &ek->h, reqp); exp_find_key()
826 exp_get_by_name(struct cache_detail *cd, struct auth_domain *clp, exp_get_by_name() argument
837 key.cd = cd; exp_get_by_name()
842 err = cache_check(cd, &exp->h, reqp); exp_get_by_name()
852 exp_parent(struct cache_detail *cd, struct auth_domain *clp, struct path *path) exp_parent() argument
855 struct svc_export *exp = exp_get_by_name(cd, clp, path, NULL); exp_parent()
861 exp = exp_get_by_name(cd, clp, path, NULL); exp_parent()
885 struct cache_detail *cd = nn->svc_export_cache; exp_rootfh() local
898 exp = exp_parent(cd, clp, &path); exp_rootfh()
920 static struct svc_export *exp_find(struct cache_detail *cd, exp_find() argument
925 struct nfsd_net *nn = net_generic(cd->net, nfsd_net_id); exp_find()
930 exp = exp_get_by_name(cd, clp, &ek->ek_path, reqp); exp_find()
974 struct cache_detail *cd = nn->svc_export_cache; rqst_exp_get_by_name() local
980 exp = exp_get_by_name(cd, rqstp->rq_client, path, &rqstp->rq_chandle); rqst_exp_get_by_name()
992 gssexp = exp_get_by_name(cd, rqstp->rq_gssclient, path, &rqstp->rq_chandle); rqst_exp_get_by_name()
1005 struct cache_detail *cd = nn->svc_export_cache; rqst_exp_find() local
1011 exp = exp_find(cd, rqstp->rq_client, fsid_type, rqst_exp_find()
1024 gssexp = exp_find(cd, rqstp->rq_gssclient, fsid_type, fsidv, rqst_exp_find()
1086 struct cache_detail *cd = m->private; __acquires() local
1087 struct cache_head **export_table = cd->hash_table; __acquires()
1089 read_lock(&cd->hash_lock); __acquires()
1114 struct cache_detail *cd = m->private; e_next() local
1115 struct cache_head **export_table = cd->hash_table; e_next()
1140 struct cache_detail *cd = m->private; __releases() local
1142 read_unlock(&cd->hash_lock); __releases()
1257 struct cache_detail *cd = m->private; e_show() local
1266 if (cache_check(cd, &exp->h, NULL)) e_show()
1269 return svc_export_show(m, cd, cp); e_show()
165 expkey_show(struct seq_file *m, struct cache_detail *cd, struct cache_head *h) expkey_show() argument
656 svc_export_show(struct seq_file *m, struct cache_detail *cd, struct cache_head *h) svc_export_show() argument
H A Dnfs3xdr.c793 encode_entry_baggage(struct nfsd3_readdirres *cd, __be32 *p, const char *name, encode_entry_baggage() argument
800 cd->offset = p; /* remember pointer */ encode_entry_baggage()
807 compose_entry_fh(struct nfsd3_readdirres *cd, struct svc_fh *fhp, compose_entry_fh() argument
814 dparent = cd->fh.fh_dentry; compose_entry_fh()
815 exp = cd->fh.fh_export; compose_entry_fh()
833 rv = fh_compose(fhp, exp, dchild, &cd->fh); compose_entry_fh()
839 static __be32 *encode_entryplus_baggage(struct nfsd3_readdirres *cd, __be32 *p, const char *name, int namlen) encode_entryplus_baggage() argument
841 struct svc_fh *fh = &cd->scratch; encode_entryplus_baggage()
845 err = compose_entry_fh(cd, fh, name, namlen); encode_entryplus_baggage()
851 p = encode_post_op_attr(cd->rqstp, p, fh); encode_entryplus_baggage()
875 struct nfsd3_readdirres *cd = container_of(ccd, struct nfsd3_readdirres, encode_entry() local
877 __be32 *p = cd->buffer; encode_entry()
884 if (cd->offset) { encode_entry()
887 if (unlikely(cd->offset1)) { encode_entry()
889 *cd->offset = htonl(offset64 >> 32); encode_entry()
890 *cd->offset1 = htonl(offset64 & 0xffffffff); encode_entry()
891 cd->offset1 = NULL; encode_entry()
893 xdr_encode_hyper(cd->offset, offset64); encode_entry()
909 if (cd->buflen < elen) { encode_entry()
910 cd->common.err = nfserr_toosmall; encode_entry()
915 for (page = cd->rqstp->rq_respages + 1; encode_entry()
916 page < cd->rqstp->rq_next_page; page++) { encode_entry()
919 if (((caddr_t)cd->buffer >= curr_page_addr) && encode_entry()
920 ((caddr_t)cd->buffer < curr_page_addr + PAGE_SIZE)) encode_entry()
924 if ((caddr_t)(cd->buffer + elen) < (curr_page_addr + PAGE_SIZE)) { encode_entry()
927 p = encode_entry_baggage(cd, p, name, namlen, ino); encode_entry()
930 p = encode_entryplus_baggage(cd, p, name, namlen); encode_entry()
931 num_entry_words = p - cd->buffer; encode_entry()
941 p1 = encode_entry_baggage(cd, p1, name, namlen, ino); encode_entry()
944 p1 = encode_entryplus_baggage(cd, p1, name, namlen); encode_entry()
948 len1 = curr_page_addr + PAGE_SIZE - (caddr_t)cd->buffer; encode_entry()
957 cd->offset = cd->buffer + (cd->offset - tmp); encode_entry()
959 unsigned int offset_r = (cd->offset - tmp) << 2; encode_entry()
969 cd->offset = p + (cd->offset - tmp); encode_entry()
971 cd->offset -= len1 >> 2; encode_entry()
975 cd->offset = p + (cd->offset - tmp); encode_entry()
976 cd->offset1 = tmp; encode_entry()
989 cd->common.err = nfserr_toosmall; encode_entry()
993 cd->buflen -= num_entry_words; encode_entry()
994 cd->buffer = p; encode_entry()
995 cd->common.err = nfs_ok; encode_entry()
1001 nfs3svc_encode_entry(void *cd, const char *name, nfs3svc_encode_entry() argument
1004 return encode_entry(cd, name, namlen, offset, ino, d_type, 0); nfs3svc_encode_entry()
1008 nfs3svc_encode_entry_plus(void *cd, const char *name, nfs3svc_encode_entry_plus() argument
1012 return encode_entry(cd, name, namlen, offset, ino, d_type, 1); nfs3svc_encode_entry_plus()
H A Dnfs4idmap.c128 idtoname_request(struct cache_detail *cd, struct cache_head *ch, char **bpp, idtoname_request() argument
153 idtoname_show(struct seq_file *m, struct cache_detail *cd, struct cache_head *h) idtoname_show() argument
200 idtoname_parse(struct cache_detail *cd, char *buf, int buflen) idtoname_parse() argument
242 res = idtoname_lookup(cd, &ent); idtoname_parse()
256 res = idtoname_update(cd, &ent, res); idtoname_parse()
260 cache_put(&res->h, cd); idtoname_parse()
268 idtoname_lookup(struct cache_detail *cd, struct ent *item) idtoname_lookup() argument
270 struct cache_head *ch = sunrpc_cache_lookup(cd, &item->h, idtoname_lookup()
279 idtoname_update(struct cache_detail *cd, struct ent *new, struct ent *old) idtoname_update() argument
281 struct cache_head *ch = sunrpc_cache_update(cd, &new->h, &old->h, idtoname_update()
301 nametoid_request(struct cache_detail *cd, struct cache_head *ch, char **bpp, nametoid_request() argument
324 nametoid_show(struct seq_file *m, struct cache_detail *cd, struct cache_head *h) nametoid_show() argument
363 nametoid_parse(struct cache_detail *cd, char *buf, int buflen) nametoid_parse() argument
410 res = nametoid_lookup(cd, &ent); nametoid_parse()
413 res = nametoid_update(cd, &ent, res); nametoid_parse()
417 cache_put(&res->h, cd); nametoid_parse()
426 nametoid_lookup(struct cache_detail *cd, struct ent *item) nametoid_lookup() argument
428 struct cache_head *ch = sunrpc_cache_lookup(cd, &item->h, nametoid_lookup()
437 nametoid_update(struct cache_detail *cd, struct ent *new, struct ent *old) nametoid_update() argument
439 struct cache_head *ch = sunrpc_cache_update(cd, &new->h, &old->h, nametoid_update()
H A Dnfsxdr.c501 struct nfsd_readdirres *cd = container_of(ccd, struct nfsd_readdirres, common); nfssvc_encode_entry() local
502 __be32 *p = cd->buffer; nfssvc_encode_entry()
511 cd->common.err = nfserr_fbig; nfssvc_encode_entry()
514 if (cd->offset) nfssvc_encode_entry()
515 *cd->offset = htonl(offset); nfssvc_encode_entry()
521 if ((buflen = cd->buflen - slen - 4) < 0) { nfssvc_encode_entry()
522 cd->common.err = nfserr_toosmall; nfssvc_encode_entry()
526 cd->common.err = nfserr_fbig; nfssvc_encode_entry()
532 cd->offset = p; /* remember pointer */ nfssvc_encode_entry()
535 cd->buflen = buflen; nfssvc_encode_entry()
536 cd->buffer = p; nfssvc_encode_entry()
537 cd->common.err = nfs_ok; nfssvc_encode_entry()
H A Dexport.h61 struct cache_detail *cd; member in struct:svc_export
103 cache_put(&exp->h, exp->cd); exp_put()
H A Dnfs4xdr.c2820 nfsd4_encode_dirent_fattr(struct xdr_stream *xdr, struct nfsd4_readdir *cd, nfsd4_encode_dirent_fattr() argument
2823 struct svc_export *exp = cd->rd_fhp->fh_export; nfsd4_encode_dirent_fattr()
2828 dentry = lookup_one_len(name, cd->rd_fhp->fh_dentry, namlen); nfsd4_encode_dirent_fattr()
2853 && !attributes_need_mount(cd->rd_bmval)) { nfsd4_encode_dirent_fattr()
2862 err = nfsd_cross_mnt(cd->rd_rqstp, &dentry, &exp); nfsd4_encode_dirent_fattr()
2867 nfserr = check_nfsd_access(exp, cd->rd_rqstp); nfsd4_encode_dirent_fattr()
2873 nfserr = nfsd4_encode_fattr(xdr, NULL, exp, dentry, cd->rd_bmval, nfsd4_encode_dirent_fattr()
2874 cd->rd_rqstp, ignore_crossmnt); nfsd4_encode_dirent_fattr()
2903 struct nfsd4_readdir *cd = container_of(ccd, struct nfsd4_readdir, common); nfsd4_encode_dirent() local
2904 struct xdr_stream *xdr = cd->xdr; nfsd4_encode_dirent()
2915 cd->common.err = nfs_ok; nfsd4_encode_dirent()
2919 if (cd->cookie_offset) { nfsd4_encode_dirent()
2921 write_bytes_to_xdr_buf(xdr->buf, cd->cookie_offset, nfsd4_encode_dirent()
2936 nfserr = nfsd4_encode_dirent_fattr(xdr, cd, name, namlen); nfsd4_encode_dirent()
2954 if (!(cd->rd_bmval[0] & FATTR4_WORD0_RDATTR_ERROR)) nfsd4_encode_dirent()
2964 if (entry_bytes > cd->rd_maxcount) nfsd4_encode_dirent()
2966 cd->rd_maxcount -= entry_bytes; nfsd4_encode_dirent()
2971 if (!cd->rd_dircount) nfsd4_encode_dirent()
2974 if (name_and_cookie > cd->rd_dircount && cd->cookie_offset) nfsd4_encode_dirent()
2976 cd->rd_dircount -= min(cd->rd_dircount, name_and_cookie); nfsd4_encode_dirent()
2978 cd->cookie_offset = cookie_offset; nfsd4_encode_dirent()
2980 cd->common.err = nfs_ok; nfsd4_encode_dirent()
2984 cd->common.err = nfserr; nfsd4_encode_dirent()
/linux-4.1.27/arch/mips/loongson/common/cs5536/
H A Dcs5536_mfgpt.c124 struct clock_event_device *cd = &mfgpt_clockevent; setup_mfgpt0_timer() local
127 cd->cpumask = cpumask_of(cpu); setup_mfgpt0_timer()
128 clockevent_set_clock(cd, MFGPT_TICK_RATE); setup_mfgpt0_timer()
129 cd->max_delta_ns = clockevent_delta2ns(0xffff, cd); setup_mfgpt0_timer()
130 cd->min_delta_ns = clockevent_delta2ns(0xf, cd); setup_mfgpt0_timer()
141 clockevents_register_device(cd); setup_mfgpt0_timer()
/linux-4.1.27/include/linux/sunrpc/
H A Dcache.h87 void (*cache_request)(struct cache_detail *cd,
95 struct cache_detail *cd,
97 void (*warn_no_listener)(struct cache_detail *cd,
195 static inline void cache_put(struct cache_head *h, struct cache_detail *cd) cache_put() argument
198 h->expiry_time < cd->nextcheck) cache_put()
199 cd->nextcheck = h->expiry_time; cache_put()
200 kref_put(&h->ref, cd->cache_put); cache_put()
215 extern int cache_register_net(struct cache_detail *cd, struct net *net);
216 extern void cache_unregister_net(struct cache_detail *cd, struct net *net);
219 extern void cache_destroy_net(struct cache_detail *cd, struct net *net);
221 extern void sunrpc_init_cache_detail(struct cache_detail *cd);
222 extern void sunrpc_destroy_cache_detail(struct cache_detail *cd);
/linux-4.1.27/tools/testing/selftests/
H A DMakefile74 echo "cd \$$(dirname \$$0)" >> $(ALL_SCRIPT)
80 echo "cd $$TARGET" >> $(ALL_SCRIPT); \
82 echo "cd \$$ROOT" >> $(ALL_SCRIPT); \
/linux-4.1.27/drivers/s390/cio/
H A Dchsc_sch.c463 struct chsc_chp_cd *cd; chsc_ioctl_info_channel_path() local
484 cd = kzalloc(sizeof(*cd), GFP_KERNEL); chsc_ioctl_info_channel_path()
485 if (!cd) { chsc_ioctl_info_channel_path()
489 if (copy_from_user(cd, user_cd, sizeof(*cd))) { chsc_ioctl_info_channel_path()
495 scpcd_area->m = cd->m; chsc_ioctl_info_channel_path()
496 scpcd_area->fmt1 = cd->fmt; chsc_ioctl_info_channel_path()
497 scpcd_area->cssid = cd->chpid.cssid; chsc_ioctl_info_channel_path()
498 scpcd_area->first_chpid = cd->chpid.id; chsc_ioctl_info_channel_path()
499 scpcd_area->last_chpid = cd->chpid.id; chsc_ioctl_info_channel_path()
512 memcpy(&cd->cpcb, &scpcd_area->response, scpcd_area->response.length); chsc_ioctl_info_channel_path()
513 if (copy_to_user(user_cd, cd, sizeof(*cd))) chsc_ioctl_info_channel_path()
518 kfree(cd); chsc_ioctl_info_channel_path()
525 struct chsc_cu_cd *cd; chsc_ioctl_info_cu() local
546 cd = kzalloc(sizeof(*cd), GFP_KERNEL); chsc_ioctl_info_cu()
547 if (!cd) { chsc_ioctl_info_cu()
551 if (copy_from_user(cd, user_cd, sizeof(*cd))) { chsc_ioctl_info_cu()
557 scucd_area->m = cd->m; chsc_ioctl_info_cu()
558 scucd_area->fmt1 = cd->fmt; chsc_ioctl_info_cu()
559 scucd_area->cssid = cd->cssid; chsc_ioctl_info_cu()
560 scucd_area->first_cun = cd->cun; chsc_ioctl_info_cu()
561 scucd_area->last_cun = cd->cun; chsc_ioctl_info_cu()
574 memcpy(&cd->cucb, &scucd_area->response, scucd_area->response.length); chsc_ioctl_info_cu()
575 if (copy_to_user(user_cd, cd, sizeof(*cd))) chsc_ioctl_info_cu()
580 kfree(cd); chsc_ioctl_info_cu()
H A Dfcx.c282 * @cd: pointer to control data for this dcw or NULL if none is required
287 * by @cmd, @flags, @cd, @cd_count and @count to the tca of the tccb. Return
295 void *cd, u8 cd_count, u32 count) tccb_add_dcw()
314 if (cd) tccb_add_dcw()
315 memcpy(&dcw->cd[0], cd, cd_count); tccb_add_dcw()
294 tccb_add_dcw(struct tccb *tccb, size_t tccb_size, u8 cmd, u8 flags, void *cd, u8 cd_count, u32 count) tccb_add_dcw() argument
H A Ditcw.c280 * @cd: address of control data for this dcw or NULL if none is required
285 * by @cmd, @flags, @cd, @cd_count and @count to the tca of the tccb. Return
292 struct dcw *itcw_add_dcw(struct itcw *itcw, u8 cmd, u8 flags, void *cd, itcw_add_dcw() argument
296 flags, cd, cd_count, count); itcw_add_dcw()
/linux-4.1.27/drivers/scsi/pcmcia/
H A Dnsp_debug.c42 /* 42-48 */ "Read Sub-Ch(cd)", "Read TOC", "Read Header(cd)", "Play Audio(cd)", unknown, "Play Audio MSF(cd)", "Play Audio Track/Index(cd)",
43 /* 49-4f */ "Play Track Relative(10)(cd)", unknown, "Pause/Resume(cd)", "Log Select", "Log Sense", unknown, unknown,
/linux-4.1.27/arch/mips/sni/
H A Dtime.c59 struct clock_event_device *cd = dev_id; a20r_interrupt() local
64 cd->event_handler(cd); a20r_interrupt()
81 struct clock_event_device *cd = &a20r_clockevent_device; sni_a20r_timer_setup() local
85 cd->cpumask = cpumask_of(cpu); sni_a20r_timer_setup()
86 clockevents_register_device(cd); sni_a20r_timer_setup()
87 action->dev_id = cd; sni_a20r_timer_setup()
/linux-4.1.27/arch/x86/crypto/
H A Dcamellia-x86_64-asm_64.S104 #define roundsm(ab, subkey, cd) \
107 xor2ror16(sp00444404, sp03303033, RT0, RT1, ab ## 0, cd ## 0); \
109 xor2ror16(sp11101110, sp44044404, RT0, RT1, ab ## 0, cd ## 0); \
112 xorq RT2, cd ## 0;
281 #define roundsm2(ab, subkey, cd) \
283 xorq RT2, cd ## 1; \
285 xor2ror16(sp00444404, sp03303033, RT0, RT1, ab ## 0, cd ## 0); \
287 xor2ror16(sp11101110, sp44044404, RT0, RT1, ab ## 0, cd ## 0); \
290 xor2ror16(sp00444404, sp03303033, RT0, RT1, ab ## 1, cd ## 1); \
291 xorq RT2, cd ## 0; \
292 xor2ror16(sp22000222, sp10011110, RT0, RT1, ab ## 1, cd ## 1); \
293 xor2ror16(sp11101110, sp44044404, RT0, RT1, ab ## 1, cd ## 1); \
294 xor2ror16(sp30333033, sp02220222, RT0, RT1, ab ## 1, cd ## 1);
H A Dtwofish-x86_64-asm_64-3way.S99 #define g1g2_3(ab, cd, Tx0, Tx1, Tx2, Tx3, Ty0, Ty1, Ty2, Ty3, x, y) \
113 xchgq cd ## 0, ab ## 0; \
117 xchgq cd ## 1, ab ## 1; \
121 xchgq cd ## 2, ab ## 2;
149 #define encrypt_round3(ab, cd, n) \
150 g1g2_3(ab, cd, s0, s1, s2, s3, s0, s1, s2, s3, RX, RY); \
163 #define encrypt_cycle3(ab, cd, n) \
164 encrypt_round3(ab, cd, n*2); \
165 encrypt_round3(ab, cd, (n*2)+1);
H A Dglue_helper-asm-avx2.S63 vpsrldq $8, t0, t0; /* ab: -1:0 ; cd: -1:0 */ \
64 vpaddq t0, t0, t4; /* ab: -2:0 ; cd: -2:0 */\
71 vinserti128 $1, t2x, t3, t2; /* ab: le0 ; cd: le1 */ \
75 add2_le128(t2, t0, t4, t3, t5); /* ab: le2 ; cd: le3 */ \
H A Dcamellia-aesni-avx2-asm_64.S1090 vpsrldq $8, %ymm15, %ymm15; /* ab: -1:0 ; cd: -1:0 */
1091 vpaddq %ymm15, %ymm15, %ymm12; /* ab: -2:0 ; cd: -2:0 */
1103 add2_le128(%ymm0, %ymm15, %ymm12, %ymm11, %ymm13); /* ab:le2 ; cd:le3 */
/linux-4.1.27/drivers/hwtracing/coresight/
H A Dcoresight.c241 struct coresight_device *cd; coresight_enable_path() local
243 list_for_each_entry(cd, path, path_link) { list_for_each_entry()
244 if (cd == list_first_entry(path, struct coresight_device, list_for_each_entry()
246 ret = coresight_enable_sink(cd); list_for_each_entry()
247 } else if (list_is_last(&cd->path_link, path)) { list_for_each_entry()
255 ret = coresight_enable_link(cd); list_for_each_entry()
263 list_for_each_entry_continue_reverse(cd, path, path_link) { list_for_each_entry_continue_reverse()
264 if (cd == list_first_entry(path, struct coresight_device, list_for_each_entry_continue_reverse()
266 coresight_disable_sink(cd); list_for_each_entry_continue_reverse()
267 } else if (list_is_last(&cd->path_link, path)) { list_for_each_entry_continue_reverse()
270 coresight_disable_link(cd); list_for_each_entry_continue_reverse()
279 struct coresight_device *cd; coresight_disable_path() local
281 list_for_each_entry_reverse(cd, path, path_link) { list_for_each_entry_reverse()
282 if (cd == list_first_entry(path, struct coresight_device, list_for_each_entry_reverse()
284 coresight_disable_sink(cd); list_for_each_entry_reverse()
285 } else if (list_is_last(&cd->path_link, path)) { list_for_each_entry_reverse()
292 coresight_disable_link(cd); list_for_each_entry_reverse()
/linux-4.1.27/lib/
H A Dearlycpio.c71 struct cpio_data cd = { NULL, 0, "" }; find_cpio_data() local
134 strlcpy(cd.name, p + mypathsize, MAX_CPIO_FILE_NAME); find_cpio_data()
136 cd.data = (void *)dptr; find_cpio_data()
137 cd.size = ch[C_FILESIZE]; find_cpio_data()
138 return cd; /* Found it! */ find_cpio_data()
145 return cd; find_cpio_data()
H A Dglob.c243 "0" "*a*b*[ef]*[cd]*g*\0" "abacadaeafag\0"
245 "1" "*ab*cd*\0" "abcabcabcabcdefg\0"
248 "0" "*ab*cd*\0" "abcabcabcabcefg\0";
/linux-4.1.27/drivers/ide/
H A Dide-cd_ioctl.c2 * cdrom.c IOCTLs handling for ide-cd driver.
15 #include "ide-cd.h"
38 * status. this should be supported by newer cd-r/w and all DVD etc
83 * ide-cd always generates media changed event if media is missing, which
110 struct cdrom_info *cd = drive->driver_data; cdrom_eject() local
111 struct cdrom_device_info *cdi = &cd->devinfo; cdrom_eject()
214 struct cdrom_info *cd = drive->driver_data; ide_cdrom_select_speed() local
242 cdi->speed = cd->current_speed; ide_cdrom_select_speed()
301 struct cdrom_info *cd = drive->driver_data; ide_cdrom_reset() local
309 ret = blk_execute_rq(drive->queue, cd->disk, rq, 0); ide_cdrom_reset()
386 struct cdrom_info *cd = drive->driver_data; ide_cd_read_tochdr() local
396 toc = cd->toc; ide_cd_read_tochdr()
H A Dide-cd.c12 * See Documentation/cdrom/ide-cd for usage information.
20 * Documentation/ide/ChangeLog.ide-cd.1994-2004
23 #define DRV_NAME "ide-cd"
51 #include "ide-cd.h"
60 struct cdrom_info *cd = NULL; ide_cd_get() local
63 cd = ide_drv_g(disk, cdrom_info); ide_cd_get()
64 if (cd) { ide_cd_get()
65 if (ide_device_get(cd->drive)) ide_cd_get()
66 cd = NULL; ide_cd_get()
68 get_device(&cd->dev); ide_cd_get()
72 return cd; ide_cd_get()
75 static void ide_cd_put(struct cdrom_info *cd) ide_cd_put() argument
77 ide_drive_t *drive = cd->drive; ide_cd_put()
80 put_device(&cd->dev); ide_cd_put()
703 struct cdrom_info *cd = drive->driver_data; cdrom_start_rw() local
715 if (get_disk_ro(cd->disk)) cdrom_start_rw()
734 cd->devinfo.media_written = 1; cdrom_start_rw()
1142 struct cdrom_info *cd = drive->driver_data; ide_cdrom_update_speed() local
1158 cd->current_speed = DIV_ROUND_CLOSEST(curspeed, 176); ide_cdrom_update_speed()
1159 cd->max_speed = DIV_ROUND_CLOSEST(maxspeed, 176); ide_cdrom_update_speed()
1207 struct cdrom_info *cd = drive->driver_data; ide_cdrom_probe_capabilities() local
1208 struct cdrom_device_info *cdi = &cd->devinfo; ide_cdrom_probe_capabilities()
1283 if (cd->max_speed) ide_cdrom_probe_capabilities()
1284 printk(KERN_CONT " %dX", cd->max_speed); ide_cdrom_probe_capabilities()
1497 struct cdrom_info *cd = drive->driver_data; ide_cdrom_setup() local
1498 struct cdrom_device_info *cdi = &cd->devinfo; ide_cdrom_setup()
1531 cd->devinfo.handle = NULL; ide_cdrom_setup()
1535 ide_proc_register_driver(drive, cd->driver); ide_cdrom_setup()
1806 MODULE_ALIAS("ide-cd");
H A DMakefile84 ide-cd_mod-y += ide-cd.o ide-cd_ioctl.o ide-cd_verbose.o
H A Dide-cd.h102 /* ide-cd.c functions used by ide-cd_ioctl.c */
H A Dide.c40 * Scott Snyder (snyder@fnald0.fnal.gov) (ATAPI IDE cd-rom)
H A Dide-cd_verbose.c14 #include "ide-cd.h"
/linux-4.1.27/drivers/net/ethernet/renesas/
H A Dsh_eth.c851 static void sh_eth_set_default_cpu_data(struct sh_eth_cpu_data *cd) sh_eth_set_default_cpu_data() argument
853 if (!cd->ecsr_value) sh_eth_set_default_cpu_data()
854 cd->ecsr_value = DEFAULT_ECSR_INIT; sh_eth_set_default_cpu_data()
856 if (!cd->ecsipr_value) sh_eth_set_default_cpu_data()
857 cd->ecsipr_value = DEFAULT_ECSIPR_INIT; sh_eth_set_default_cpu_data()
859 if (!cd->fcftr_value) sh_eth_set_default_cpu_data()
860 cd->fcftr_value = DEFAULT_FIFO_F_D_RFF | sh_eth_set_default_cpu_data()
863 if (!cd->fdr_value) sh_eth_set_default_cpu_data()
864 cd->fdr_value = DEFAULT_FDR_INIT; sh_eth_set_default_cpu_data()
866 if (!cd->tx_check) sh_eth_set_default_cpu_data()
867 cd->tx_check = DEFAULT_TX_CHECK; sh_eth_set_default_cpu_data()
869 if (!cd->eesr_err_check) sh_eth_set_default_cpu_data()
870 cd->eesr_err_check = DEFAULT_EESR_ERR_CHECK; sh_eth_set_default_cpu_data()
872 if (!cd->trscer_err_mask) sh_eth_set_default_cpu_data()
873 cd->trscer_err_mask = DEFAULT_TRSCER_ERR_MASK; sh_eth_set_default_cpu_data()
919 if (mdp->cd->hw_crc) sh_eth_reset()
923 if (mdp->cd->select_mii) sh_eth_reset()
1211 if (mdp->cd->rpadir) sh_eth_ring_init()
1293 if (mdp->cd->rmiimode) sh_eth_dev_init()
1298 if (mdp->cd->rpadir) sh_eth_dev_init()
1299 sh_eth_write(ndev, mdp->cd->rpadir_value, RPADIR); sh_eth_dev_init()
1305 if (mdp->cd->hw_swap) sh_eth_dev_init()
1312 sh_eth_write(ndev, mdp->cd->fdr_value, FDR); sh_eth_dev_init()
1318 sh_eth_write(ndev, mdp->cd->trscer_err_mask, TRSCER); sh_eth_dev_init()
1320 if (mdp->cd->bculr) sh_eth_dev_init()
1323 sh_eth_write(ndev, mdp->cd->fcftr_value, FCFTR); sh_eth_dev_init()
1325 if (!mdp->cd->no_trimd) sh_eth_dev_init()
1335 sh_eth_write(ndev, mdp->cd->eesipr_value, EESIPR); sh_eth_dev_init()
1344 if (mdp->cd->set_rate) sh_eth_dev_init()
1345 mdp->cd->set_rate(ndev); sh_eth_dev_init()
1348 sh_eth_write(ndev, mdp->cd->ecsr_value, ECSR); sh_eth_dev_init()
1352 sh_eth_write(ndev, mdp->cd->ecsipr_value, ECSIPR); sh_eth_dev_init()
1358 if (mdp->cd->apr) sh_eth_dev_init()
1360 if (mdp->cd->mpr) sh_eth_dev_init()
1362 if (mdp->cd->tpauser) sh_eth_dev_init()
1481 if (mdp->cd->shift_rd0) sh_eth_rx()
1501 if (!mdp->cd->hw_swap) sh_eth_rx()
1506 if (mdp->cd->rpadir) sh_eth_rx()
1605 if (mdp->cd->no_psr || mdp->no_ether_link) { sh_eth_error()
1668 if (!mdp->cd->no_ade && (intr_status & EESR_ADE)) { sh_eth_error()
1675 if (mdp->cd->no_ade) sh_eth_error()
1702 struct sh_eth_cpu_data *cd = mdp->cd; sh_eth_interrupt() local
1717 if (intr_status & (EESR_RX_CHECK | cd->tx_check | cd->eesr_err_check)) sh_eth_interrupt()
1741 if (intr_status & cd->tx_check) { sh_eth_interrupt()
1743 sh_eth_write(ndev, intr_status & cd->tx_check, EESR); sh_eth_interrupt()
1749 if (intr_status & cd->eesr_err_check) { sh_eth_interrupt()
1751 sh_eth_write(ndev, intr_status & cd->eesr_err_check, EESR); sh_eth_interrupt()
1785 sh_eth_write(ndev, mdp->cd->eesipr_value, EESIPR); sh_eth_poll()
1801 if (mdp->cd->set_duplex) sh_eth_adjust_link()
1802 mdp->cd->set_duplex(ndev); sh_eth_adjust_link()
1808 if (mdp->cd->set_rate) sh_eth_adjust_link()
1809 mdp->cd->set_rate(ndev); sh_eth_adjust_link()
1817 if (mdp->cd->no_psr || mdp->no_ether_link) sh_eth_adjust_link()
1825 if (mdp->cd->no_psr || mdp->no_ether_link) sh_eth_adjust_link()
1934 if (mdp->cd->set_duplex) sh_eth_set_settings()
1935 mdp->cd->set_duplex(ndev); sh_eth_set_settings()
1959 struct sh_eth_cpu_data *cd = mdp->cd; __sh_eth_get_regs() local
2015 if (cd->rmiimode) __sh_eth_get_regs()
2018 if (cd->rpadir) __sh_eth_get_regs()
2020 if (!cd->no_trimd) __sh_eth_get_regs()
2026 if (!cd->no_psr) __sh_eth_get_regs()
2031 if (cd->apr) __sh_eth_get_regs()
2033 if (cd->mpr) __sh_eth_get_regs()
2037 if (cd->tpauser) __sh_eth_get_regs()
2041 if (cd->bculr) __sh_eth_get_regs()
2056 if (cd->rtrate) __sh_eth_get_regs()
2058 if (cd->hw_crc) __sh_eth_get_regs()
2060 if (cd->select_mii) __sh_eth_get_regs()
2063 if (cd->tsu) { __sh_eth_get_regs()
2267 sh_eth_write(ndev, mdp->cd->eesipr_value, EESIPR); sh_eth_set_ringparam()
2303 mdp->cd->irq_flags, ndev->name, ndev); sh_eth_open()
2395 if (!mdp->cd->hw_swap) sh_eth_start_xmit()
2665 if (!mdp->cd->tsu) sh_eth_tsu_add_entry()
2694 if (!mdp->cd->tsu) sh_eth_tsu_del_entry()
2717 if (!mdp->cd->tsu) sh_eth_tsu_purge_all()
2740 if (!mdp->cd->tsu) sh_eth_tsu_purge_mcast()
2763 if (mdp->cd->tsu) sh_eth_set_rx_mode()
2779 } else if (mdp->cd->tsu) { sh_eth_set_rx_mode()
2815 if (unlikely(!mdp->cd->tsu)) sh_eth_vlan_rx_add_vid()
2845 if (unlikely(!mdp->cd->tsu)) sh_eth_vlan_rx_kill_vid()
3132 mdp->cd = (struct sh_eth_cpu_data *)id->driver_data; sh_eth_drv_probe()
3138 mdp->cd = (struct sh_eth_cpu_data *)match->data; sh_eth_drv_probe()
3140 mdp->reg_offset = sh_eth_get_register_offset(mdp->cd->register_type); sh_eth_drv_probe()
3143 mdp->cd->register_type); sh_eth_drv_probe()
3147 sh_eth_set_default_cpu_data(mdp->cd); sh_eth_drv_probe()
3150 if (mdp->cd->tsu) sh_eth_drv_probe()
3169 if (mdp->cd->tsu) { sh_eth_drv_probe()
3183 if (mdp->cd->chip_reset) sh_eth_drv_probe()
3184 mdp->cd->chip_reset(ndev); sh_eth_drv_probe()
3186 if (mdp->cd->tsu) { sh_eth_drv_probe()
3192 if (mdp->cd->rmiimode) sh_eth_drv_probe()
H A Dsh_eth.h501 struct sh_eth_cpu_data *cd; member in struct:sh_eth_private
/linux-4.1.27/arch/s390/include/asm/
H A Ditcw.h23 struct dcw *itcw_add_dcw(struct itcw *itcw, u8 cmd, u8 flags, void *cd,
H A Dnmi.h21 __u32 cd : 1; /* 04 timing-facility damage */ member in struct:mci
H A Dfcx.h235 * @cd: Control Data
243 u8 cd[0]; member in struct:dcw
307 void *cd, u8 cd_count, u32 count);
H A Dcpu_mf.h69 unsigned int cd:1; /* 31: diag-sampling activation control */ member in struct:hws_qsi_info_block
91 unsigned int cd:1; /* 63: diag-sampling activation control */ member in struct:hws_lsctl_request_block
/linux-4.1.27/net/sunrpc/auth_gss/
H A Dsvcauth_gss.c81 static struct rsi *rsi_update(struct cache_detail *cd, struct rsi *new, struct rsi *old);
82 static struct rsi *rsi_lookup(struct cache_detail *cd, struct rsi *item);
174 static void rsi_request(struct cache_detail *cd, rsi_request() argument
185 static int rsi_parse(struct cache_detail *cd, rsi_parse() argument
214 rsip = rsi_lookup(cd, &rsii); rsi_parse()
256 rsip = rsi_update(cd, &rsii, rsip); rsi_parse()
261 cache_put(&rsip->h, cd); rsi_parse()
280 static struct rsi *rsi_lookup(struct cache_detail *cd, struct rsi *item) rsi_lookup() argument
285 ch = sunrpc_cache_lookup(cd, &item->h, hash); rsi_lookup()
292 static struct rsi *rsi_update(struct cache_detail *cd, struct rsi *new, struct rsi *old) rsi_update() argument
297 ch = sunrpc_cache_update(cd, &new->h, rsi_update()
335 static struct rsc *rsc_update(struct cache_detail *cd, struct rsc *new, struct rsc *old);
336 static struct rsc *rsc_lookup(struct cache_detail *cd, struct rsc *item);
407 static int rsc_parse(struct cache_detail *cd, rsc_parse() argument
434 rscp = rsc_lookup(cd, &rsci); rsc_parse()
516 rscp = rsc_update(cd, &rsci, rscp); rsc_parse()
521 cache_put(&rscp->h, cd); rsc_parse()
539 static struct rsc *rsc_lookup(struct cache_detail *cd, struct rsc *item) rsc_lookup() argument
544 ch = sunrpc_cache_lookup(cd, &item->h, hash); rsc_lookup()
551 static struct rsc *rsc_update(struct cache_detail *cd, struct rsc *new, struct rsc *old) rsc_update() argument
556 ch = sunrpc_cache_update(cd, &new->h, rsc_update()
566 gss_svc_searchbyctx(struct cache_detail *cd, struct xdr_netobj *handle) gss_svc_searchbyctx() argument
574 found = rsc_lookup(cd, &rsci); gss_svc_searchbyctx()
578 if (cache_check(cd, &found->h, NULL)) gss_svc_searchbyctx()
972 gss_write_init_verf(struct cache_detail *cd, struct svc_rqst *rqstp, gss_write_init_verf() argument
980 rsci = gss_svc_searchbyctx(cd, out_handle); gss_write_init_verf()
986 cache_put(&rsci->h, cd); gss_write_init_verf()
1140 static int gss_proxy_save_rsc(struct cache_detail *cd, gss_proxy_save_rsc() argument
1164 rscp = rsc_lookup(cd, &rsci); gss_proxy_save_rsc()
1198 rscp = rsc_update(cd, &rsci, rscp); gss_proxy_save_rsc()
1203 cache_put(&rscp->h, cd); gss_proxy_save_rsc()
1767 struct cache_detail *cd; rsi_cache_create_net() local
1770 cd = cache_create_net(&rsi_cache_template, net); rsi_cache_create_net()
1771 if (IS_ERR(cd)) rsi_cache_create_net()
1772 return PTR_ERR(cd); rsi_cache_create_net()
1773 err = cache_register_net(cd, net); rsi_cache_create_net()
1775 cache_destroy_net(cd, net); rsi_cache_create_net()
1778 sn->rsi_cache = cd; rsi_cache_create_net()
1785 struct cache_detail *cd = sn->rsi_cache; rsi_cache_destroy_net() local
1788 cache_purge(cd); rsi_cache_destroy_net()
1789 cache_unregister_net(cd, net); rsi_cache_destroy_net()
1790 cache_destroy_net(cd, net); rsi_cache_destroy_net()
1796 struct cache_detail *cd; rsc_cache_create_net() local
1799 cd = cache_create_net(&rsc_cache_template, net); rsc_cache_create_net()
1800 if (IS_ERR(cd)) rsc_cache_create_net()
1801 return PTR_ERR(cd); rsc_cache_create_net()
1802 err = cache_register_net(cd, net); rsc_cache_create_net()
1804 cache_destroy_net(cd, net); rsc_cache_create_net()
1807 sn->rsc_cache = cd; rsc_cache_create_net()
1814 struct cache_detail *cd = sn->rsc_cache; rsc_cache_destroy_net() local
1817 cache_purge(cd); rsc_cache_destroy_net()
1818 cache_unregister_net(cd, net); rsc_cache_destroy_net()
1819 cache_destroy_net(cd, net); rsc_cache_destroy_net()
/linux-4.1.27/drivers/staging/lustre/lustre/obdclass/
H A Dllog_cat.c558 struct llog_process_cat_data cd; llog_cat_process_cb() local
560 cd.lpcd_first_idx = d->lpd_startidx; llog_cat_process_cb()
561 cd.lpcd_last_idx = 0; llog_cat_process_cb()
563 &cd, false); llog_cat_process_cb()
592 struct llog_process_cat_data cd; llog_cat_process_or_fork() local
597 cd.lpcd_first_idx = llh->llh_cat_idx; llog_cat_process_or_fork()
598 cd.lpcd_last_idx = 0; llog_cat_process_or_fork()
600 &d, &cd, fork); llog_cat_process_or_fork()
604 cd.lpcd_first_idx = 0; llog_cat_process_or_fork()
605 cd.lpcd_last_idx = cat_llh->lgh_last_idx; llog_cat_process_or_fork()
607 &d, &cd, fork); llog_cat_process_or_fork()
660 struct llog_process_cat_data cd; llog_cat_reverse_process() local
672 cd.lpcd_first_idx = 0; llog_cat_reverse_process()
673 cd.lpcd_last_idx = cat_llh->lgh_last_idx; llog_cat_reverse_process()
676 &d, &cd); llog_cat_reverse_process()
680 cd.lpcd_first_idx = le32_to_cpu(llh->llh_cat_idx); llog_cat_reverse_process()
681 cd.lpcd_last_idx = 0; llog_cat_reverse_process()
684 &d, &cd); llog_cat_reverse_process()
H A Dllog.c276 struct llog_process_cat_data *cd = lpi->lpi_catdata; llog_process_thread() local
292 if (cd != NULL) { llog_process_thread()
293 last_called_index = cd->lpcd_first_idx; llog_process_thread()
294 index = cd->lpcd_first_idx + 1; llog_process_thread()
296 if (cd != NULL && cd->lpcd_last_idx) llog_process_thread()
297 last_index = cd->lpcd_last_idx; llog_process_thread()
400 if (cd != NULL) llog_process_thread()
401 cd->lpcd_last_idx = last_called_index; llog_process_thread()
483 struct llog_process_cat_data *cd = catdata; llog_reverse_process() local
491 if (cd != NULL) llog_reverse_process()
492 first_index = cd->lpcd_first_idx + 1; llog_reverse_process()
493 if (cd != NULL && cd->lpcd_last_idx) llog_reverse_process()
494 index = cd->lpcd_last_idx; llog_reverse_process()
H A Dobd_config.c1580 struct llog_process_cat_data cd = {0, 0}; class_config_parse_llog() local
1596 cd.lpcd_first_idx = cfg->cfg_last_idx; class_config_parse_llog()
1603 cd.lpcd_last_idx = 0; class_config_parse_llog()
1605 rc = llog_process(env, llh, callback, cfg, &cd); class_config_parse_llog()
1608 cd.lpcd_first_idx + 1, cd.lpcd_last_idx, rc); class_config_parse_llog()
1610 cfg->cfg_last_idx = cd.lpcd_last_idx; class_config_parse_llog()
H A Dcl_object.c119 struct cl_device *cd, const struct lu_fid *fid, cl_object_find()
123 return lu2cl(lu_object_find_slice(env, cl2lu_dev(cd), fid, &c->coc_lu)); cl_object_find()
118 cl_object_find(const struct lu_env *env, struct cl_device *cd, const struct lu_fid *fid, const struct cl_object_conf *c) cl_object_find() argument
/linux-4.1.27/drivers/usb/gadget/function/
H A Df_uvc.c792 struct uvc_camera_terminal_descriptor *cd; uvc_alloc_inst() local
804 cd = &opts->uvc_camera_terminal; uvc_alloc_inst()
805 cd->bLength = UVC_DT_CAMERA_TERMINAL_SIZE(3); uvc_alloc_inst()
806 cd->bDescriptorType = USB_DT_CS_INTERFACE; uvc_alloc_inst()
807 cd->bDescriptorSubType = UVC_VC_INPUT_TERMINAL; uvc_alloc_inst()
808 cd->bTerminalID = 1; uvc_alloc_inst()
809 cd->wTerminalType = cpu_to_le16(0x0201); uvc_alloc_inst()
810 cd->bAssocTerminal = 0; uvc_alloc_inst()
811 cd->iTerminal = 0; uvc_alloc_inst()
812 cd->wObjectiveFocalLengthMin = cpu_to_le16(0); uvc_alloc_inst()
813 cd->wObjectiveFocalLengthMax = cpu_to_le16(0); uvc_alloc_inst()
814 cd->wOcularFocalLength = cpu_to_le16(0); uvc_alloc_inst()
815 cd->bControlSize = 3; uvc_alloc_inst()
816 cd->bmControls[0] = 2; uvc_alloc_inst()
817 cd->bmControls[1] = 0; uvc_alloc_inst()
818 cd->bmControls[2] = 0; uvc_alloc_inst()
853 ctl_cls[1] = (struct uvc_descriptor_header *)cd; uvc_alloc_inst()
863 ctl_cls[1] = (struct uvc_descriptor_header *)cd; uvc_alloc_inst()
H A Duvc_configfs.c335 struct uvc_camera_terminal_descriptor *cd; \
343 cd = &opts->uvc_camera_terminal; \
346 result = sprintf(page, "%d\n", conv(cd->aname)); \
381 struct uvc_camera_terminal_descriptor *cd; uvcg_default_camera_bm_controls_show() local
390 cd = &opts->uvc_camera_terminal; uvcg_default_camera_bm_controls_show()
393 for (result = 0, i = 0; i < cd->bControlSize; ++i) { uvcg_default_camera_bm_controls_show()
394 result += sprintf(pg, "%d\n", cd->bmControls[i]); uvcg_default_camera_bm_controls_show()
467 struct uvc_output_terminal_descriptor *cd; \
475 cd = &opts->uvc_output_terminal; \
478 result = sprintf(page, "%d\n", conv(cd->aname)); \
1828 struct uvc_color_matching_descriptor *cd; \
1835 cd = &opts->uvc_color_matching; \
1838 result = sprintf(page, "%d\n", conv(cd->aname)); \
/linux-4.1.27/arch/arm/mach-s3c64xx/
H A Dpl080.c22 static int pl08x_get_xfer_signal(const struct pl08x_channel_data *cd) pl08x_get_xfer_signal() argument
24 return cd->min_signal; pl08x_get_xfer_signal()
27 static void pl08x_put_xfer_signal(const struct pl08x_channel_data *cd, int ch) pl08x_put_xfer_signal() argument
/linux-4.1.27/net/dsa/
H A Ddsa.c515 struct dsa_chip_data *cd, dsa_of_setup_routing_table()
542 if (!cd->rtable) { dsa_of_setup_routing_table()
543 cd->rtable = kmalloc_array(pd->nr_chips, sizeof(s8), dsa_of_setup_routing_table()
545 if (!cd->rtable) dsa_of_setup_routing_table()
549 memset(cd->rtable, -1, pd->nr_chips * sizeof(s8)); dsa_of_setup_routing_table()
552 cd->rtable[link_sw_addr] = port_index; dsa_of_setup_routing_table()
580 struct dsa_chip_data *cd; dsa_of_probe() local
623 cd = &pd->chip[chip_index]; for_each_available_child_of_node()
625 cd->of_node = child; for_each_available_child_of_node()
626 cd->host_dev = &mdio_bus->dev; for_each_available_child_of_node()
632 cd->sw_addr = be32_to_cpup(sw_addr); for_each_available_child_of_node()
633 if (cd->sw_addr > PHY_MAX_ADDR) for_each_available_child_of_node()
637 cd->eeprom_len = eeprom_len; for_each_available_child_of_node()
650 cd->port_dn[port_index] = port; for_each_available_child_of_node()
652 cd->port_names[port_index] = kstrdup(port_name, for_each_available_child_of_node()
654 if (!cd->port_names[port_index]) { for_each_available_child_of_node()
663 ret = dsa_of_setup_routing_table(pd, cd, for_each_available_child_of_node()
514 dsa_of_setup_routing_table(struct dsa_platform_data *pd, struct dsa_chip_data *cd, int chip_index, int port_index, struct device_node *link) dsa_of_setup_routing_table() argument
H A Dslave.c747 struct dsa_chip_data *cd = ds->pd; dsa_slave_phy_setup() local
753 port_dn = cd->port_dn[p->port]; dsa_slave_phy_setup()
/linux-4.1.27/drivers/infiniband/hw/qib/
H A Dqib_qsfp.c500 struct qib_qsfp_cache cd; qib_qsfp_dump() local
507 ret = qib_refresh_qsfp_cache(ppd, &cd); qib_qsfp_dump()
513 if (QSFP_IS_CU(cd.tech)) qib_qsfp_dump()
514 sprintf(lenstr, "%dM ", cd.len); qib_qsfp_dump()
517 (QSFP_PWR(cd.pwr) * 4)); qib_qsfp_dump()
520 qib_qsfp_devtech[cd.tech >> 4]); qib_qsfp_dump()
523 QSFP_VEND_LEN, cd.vendor); qib_qsfp_dump()
526 QSFP_OUI(cd.oui)); qib_qsfp_dump()
529 QSFP_PN_LEN, cd.partnum); qib_qsfp_dump()
531 QSFP_REV_LEN, cd.rev); qib_qsfp_dump()
532 if (QSFP_IS_CU(cd.tech)) qib_qsfp_dump()
534 QSFP_ATTEN_SDR(cd.atten), qib_qsfp_dump()
535 QSFP_ATTEN_DDR(cd.atten)); qib_qsfp_dump()
537 QSFP_SN_LEN, cd.serial); qib_qsfp_dump()
539 QSFP_DATE_LEN, cd.date); qib_qsfp_dump()
541 QSFP_LOT_LEN, cd.date); qib_qsfp_dump()
/linux-4.1.27/scripts/package/
H A Dbuilddeb21 sh -c "cd '$pdir'; find . -type f ! -path './DEBIAN/*' -printf '%P\0' \
302 (cd $srctree; find . -name Makefile\* -o -name Kconfig\* -o -name \*.pl) > "$objtree/debian/hdrsrcfiles"
303 (cd $srctree; find arch/$SRCARCH/include include scripts -type f) >> "$objtree/debian/hdrsrcfiles"
304 (cd $srctree; find arch/$SRCARCH -name module.lds -o -name Kbuild.platforms -o -name Platform) >> "$objtree/debian/hdrsrcfiles"
305 (cd $srctree; find $(find arch/$SRCARCH -name include -o -name scripts -type d) -type f) >> "$objtree/debian/hdrsrcfiles"
306 (cd $objtree; find arch/$SRCARCH/include Module.symvers include scripts -type f) >> "$objtree/debian/hdrobjfiles"
309 (cd $srctree; tar -c -f - -T -) < "$objtree/debian/hdrsrcfiles" | (cd $destdir; tar -xf -)
310 (cd $objtree; tar -c -f - -T -) < "$objtree/debian/hdrobjfiles" | (cd $destdir; tar -xf -)
311 (cd $objtree; cp $KCONFIG_CONFIG $destdir/.config) # copy .config manually to be where it's expected to be
H A DMakefile113 HEAD^{tree} $$(cd $(srctree); \
118 (cd $(srctree)/tools/perf; \
/linux-4.1.27/arch/mips/include/asm/
H A Dtime.h80 static inline void clockevent_set_clock(struct clock_event_device *cd, clockevent_set_clock() argument
83 clockevents_calc_mult_shift(cd, clock, 4); clockevent_set_clock()
H A Dasmmacro.h222 .macro _ctcmsa cd, rs
226 ctcmsa $\cd, \rs
312 .macro _ctcmsa cd, rs
317 .word CTC_MSA_INSN | (\cd << 6)
/linux-4.1.27/scripts/
H A Dobjdiff28 SRCTREE=$(cd $(git rev-parse --show-toplevel 2>/dev/null); pwd)
52 dir=$(cd $dir; pwd)
H A Dsetlocalversion36 cd "$srctree"
/linux-4.1.27/include/media/
H A Dmedia-devnode.h83 #define to_media_devnode(cd) container_of(cd, struct media_devnode, dev)
H A Dv4l2-dev.h147 #define to_video_device(cd) container_of(cd, struct video_device, dev)
/linux-4.1.27/arch/powerpc/crypto/
H A Daes-tab-4k.S68 .long R(cd, eb, eb, 26), R(4e, 27, 27, 69)
69 .long R(7f, b2, b2, cd), R(ea, 75, 75, 9f)
102 .long R(81, cd, cd, 4c), R(18, 0c, 0c, 14)
203 .long R(65, da, f4, cd), R(06, 05, be, d5)
261 .long R(cd, 26, 78, 09), R(6e, 59, 18, f4)
272 .long R(7f, cd, 50, 0e), R(17, 91, f6, 2f)
287 .long R(53, f7, cd, ea), R(5f, fd, aa, 5b)
/linux-4.1.27/drivers/media/usb/gspca/
H A Dse401.c221 u8 *cd = gspca_dev->usb_buf; sd_config() local
240 if (cd[1] != 0x41) { sd_config()
245 if (!(cd[2] & SE401_FORMAT_BAYER)) { sd_config()
250 if (cd[3]) sd_config()
251 pr_info("ExtraFeatures: %d\n", cd[3]); sd_config()
253 n = cd[4] | (cd[5] << 8); sd_config()
260 widths[i] = cd[6 + i * 4 + 0] | (cd[6 + i * 4 + 1] << 8); sd_config()
261 heights[i] = cd[6 + i * 4 + 2] | (cd[6 + i * 4 + 3] << 8); sd_config()
/linux-4.1.27/arch/parisc/include/asm/
H A Dchecksum.h144 " ldd,ma 8(%1), %%r21\n" /* 2cd saddr */ csum_ipv6_magic()
145 " ldd,ma 8(%2), %%r22\n" /* 2cd daddr */ csum_ipv6_magic()
167 " ldw,ma 4(%1), %%r21\n" /* 2cd saddr */ csum_ipv6_magic()
169 " ldw,ma 4(%2), %%r22\n" /* 2cd daddr */ csum_ipv6_magic()
H A Dbitops.h131 * Only the 1st and one of either the 2cd or 3rd insn will get executed.
/linux-4.1.27/net/bluetooth/bnep/
H A Dsock.c56 struct bnep_conndel_req cd; bnep_sock_ioctl() local
96 if (copy_from_user(&cd, argp, sizeof(cd))) bnep_sock_ioctl()
99 return bnep_del_connection(&cd); bnep_sock_ioctl()
/linux-4.1.27/net/bluetooth/cmtp/
H A Dsock.c69 struct cmtp_conndel_req cd; cmtp_sock_ioctl() local
108 if (copy_from_user(&cd, argp, sizeof(cd))) cmtp_sock_ioctl()
111 return cmtp_del_connection(&cd); cmtp_sock_ioctl()
/linux-4.1.27/net/bluetooth/hidp/
H A Dsock.c53 struct hidp_conndel_req cd; hidp_sock_ioctl() local
93 if (copy_from_user(&cd, argp, sizeof(cd))) hidp_sock_ioctl()
96 return hidp_connection_del(&cd); hidp_sock_ioctl()
/linux-4.1.27/drivers/media/usb/usbvision/
H A Dusbvision-video.c166 static inline struct usb_usbvision *cd_to_usbvision(struct device *cd) cd_to_usbvision() argument
169 container_of(cd, struct video_device, dev); cd_to_usbvision()
173 static ssize_t show_version(struct device *cd, show_version() argument
180 static ssize_t show_model(struct device *cd, show_model() argument
184 container_of(cd, struct video_device, dev); show_model()
191 static ssize_t show_hue(struct device *cd, show_hue() argument
195 container_of(cd, struct video_device, dev); show_hue()
206 static ssize_t show_contrast(struct device *cd, show_contrast() argument
210 container_of(cd, struct video_device, dev); show_contrast()
221 static ssize_t show_brightness(struct device *cd, show_brightness() argument
225 container_of(cd, struct video_device, dev); show_brightness()
236 static ssize_t show_saturation(struct device *cd, show_saturation() argument
240 container_of(cd, struct video_device, dev); show_saturation()
251 static ssize_t show_streaming(struct device *cd, show_streaming() argument
255 container_of(cd, struct video_device, dev); show_streaming()
262 static ssize_t show_compression(struct device *cd, show_compression() argument
266 container_of(cd, struct video_device, dev); show_compression()
273 static ssize_t show_device_bridge(struct device *cd, show_device_bridge() argument
277 container_of(cd, struct video_device, dev); show_device_bridge()
/linux-4.1.27/arch/s390/kernel/
H A Dtime.c93 struct clock_event_device *cd; clock_comparator_work() local
96 cd = this_cpu_ptr(&comparators); clock_comparator_work()
97 cd->event_handler(cd); clock_comparator_work()
131 struct clock_event_device *cd; init_cpu_timer() local
138 cd = &per_cpu(comparators, cpu); init_cpu_timer()
139 cd->name = "comparator"; init_cpu_timer()
140 cd->features = CLOCK_EVT_FEAT_ONESHOT; init_cpu_timer()
141 cd->mult = 16777; init_cpu_timer()
142 cd->shift = 12; init_cpu_timer()
143 cd->min_delta_ns = 1; init_cpu_timer()
144 cd->max_delta_ns = LONG_MAX; init_cpu_timer()
145 cd->rating = 400; init_cpu_timer()
146 cd->cpumask = cpumask_of(cpu); init_cpu_timer()
147 cd->set_next_event = s390_next_event; init_cpu_timer()
148 cd->set_mode = s390_set_mode; init_cpu_timer()
150 clockevents_register_device(cd); init_cpu_timer()
H A Dnmi.c314 if (mci->cd) { s390_do_machine_check()
H A Dperf_event.c156 si.ad, si.ed, si.cd, si.dsdes, si.tear, si.dear); print_debug_sf()
H A Dperf_cpum_sf.c893 debug_sprintf_event(sfdbg, 6, "pmu_enable: es=%i cs=%i ed=%i cd=%i " cpumsf_pmu_enable()
895 cpuhw->lsctl.ed, cpuhw->lsctl.cd, cpumsf_pmu_enable()
915 inactive.cd = 0; cpumsf_pmu_disable()
1321 cpuhw->lsctl.cd = 1; cpumsf_pmu_start()
1337 cpuhw->lsctl.cd = 0; cpumsf_pmu_stop()
/linux-4.1.27/tools/testing/selftests/ftrace/
H A Dftracetest33 (cd `dirname $1`; pwd)
226 (cd $TRACING_DIR; read PID _ < /proc/self/stat ; set -e; set -x; . $1)
/linux-4.1.27/drivers/memory/
H A Domap-gpmc.c294 * @cd Clock Domain.
299 static unsigned long gpmc_get_clk_period(int cs, enum gpmc_clk_domain cd) gpmc_get_clk_period() argument
306 switch (cd) { gpmc_get_clk_period()
325 enum gpmc_clk_domain cd) gpmc_ns_to_clk_ticks()
330 tick_ps = gpmc_get_clk_period(cs, cd); gpmc_ns_to_clk_ticks()
351 enum gpmc_clk_domain cd) gpmc_clk_ticks_to_ns()
353 return ticks * gpmc_get_clk_period(cs, cd) / 1000; gpmc_clk_ticks_to_ns()
416 * @cd: Clock Domain of timing parameter.
430 const char *name, const enum gpmc_clk_domain cd, get_gpmc_timing_reg()
458 time_ns_min = gpmc_clk_ticks_to_ns(l - 1, cs, cd) + 1; get_gpmc_timing_reg()
459 time_ns = gpmc_clk_ticks_to_ns(l, cs, cd); get_gpmc_timing_reg()
485 #define GPMC_GET_TICKS_CD(reg, st, end, field, cd) \
486 get_gpmc_timing_reg(cs, (reg), (st), (end), 0, field, (cd), 0, 0, 0)
487 #define GPMC_GET_TICKS_CD_MAX(reg, st, end, max, field, cd) \
488 get_gpmc_timing_reg(cs, (reg), (st), (end), (max), field, (cd), 0, 0, 0)
578 * prior to calling this function with @cd equal to GPMC_CD_CLK.
587 * @cd: Timing parameter clock domain.
592 int time, enum gpmc_clk_domain cd, const char *name) set_gpmc_timing_reg()
600 ticks = gpmc_ns_to_clk_ticks(time, cs, cd); set_gpmc_timing_reg()
618 cs, name, ticks, gpmc_get_clk_period(cs, cd) * ticks / 1000, set_gpmc_timing_reg()
628 #define GPMC_SET_ONE_CD_MAX(reg, st, end, max, field, cd) \
630 t->field, (cd), #field) < 0) \
324 gpmc_ns_to_clk_ticks(unsigned int time_ns, int cs, enum gpmc_clk_domain cd) gpmc_ns_to_clk_ticks() argument
350 gpmc_clk_ticks_to_ns(unsigned ticks, int cs, enum gpmc_clk_domain cd) gpmc_clk_ticks_to_ns() argument
427 get_gpmc_timing_reg( int cs, int reg, int st_bit, int end_bit, int max, const char *name, const enum gpmc_clk_domain cd, int shift, bool raw, bool noval) get_gpmc_timing_reg() argument
591 set_gpmc_timing_reg(int cs, int reg, int st_bit, int end_bit, int max, int time, enum gpmc_clk_domain cd, const char *name) set_gpmc_timing_reg() argument
/linux-4.1.27/include/linux/
H A Ddca.h38 struct device *cd; member in struct:dca_provider
/linux-4.1.27/drivers/media/i2c/
H A Dmsp3400-kthreads.c508 struct msp3400c_carrier_detect *cd; msp3400c_thread() local
549 cd = msp3400c_carrier_detect_main; msp3400c_thread()
560 msp3400c_set_carrier(client, cd[i].cdo, cd[i].cdo); msp3400c_thread()
569 "carrier1 val: %5d / %s\n", val, cd[i].name); msp3400c_thread()
575 cd = msp3400c_carrier_detect_55; msp3400c_thread()
579 cd = msp3400c_carrier_detect_65; msp3400c_thread()
585 cd = NULL; msp3400c_thread()
592 cd = NULL; msp3400c_thread()
597 msp3400c_set_carrier(client, cd[i].cdo, cd[i].cdo); msp3400c_thread()
606 "carrier2 val: %5d / %s\n", val, cd[i].name); msp3400c_thread()
/linux-4.1.27/arch/arm/include/asm/
H A Decard.h98 unsigned char cd:1; /* Chunk dir present */ member in struct:in_ecid
180 * cd : where to put read data
185 extern int ecard_readchunk (struct in_chunk_dir *cd, struct expansion_card *ec, int id, int num);
/linux-4.1.27/arch/arm/mach-lpc32xx/
H A Dphy3250.c173 static int pl08x_get_signal(const struct pl08x_channel_data *cd) pl08x_get_signal() argument
175 return cd->min_signal; pl08x_get_signal()
178 static void pl08x_put_signal(const struct pl08x_channel_data *cd, int ch) pl08x_put_signal() argument
/linux-4.1.27/drivers/ata/
H A Dsata_fsl.c460 VPRINTK("SATA FSL : cd = 0x%p, prd = 0x%p\n", cmd_desc, prd); sata_fsl_fill_sg()
522 struct command_desc *cd; sata_fsl_qc_prep() local
528 cd = (struct command_desc *)pp->cmdentry + tag; sata_fsl_qc_prep()
531 ata_tf_to_fis(&qc->tf, qc->dev->link->pmp, 1, (u8 *) &cd->cfis); sata_fsl_qc_prep()
534 cd->cfis[0], cd->cfis[1], cd->cfis[2]); sata_fsl_qc_prep()
538 cd->cfis[3], cd->cfis[11]); sata_fsl_qc_prep()
544 memset((void *)&cd->acmd, 0, 32); sata_fsl_qc_prep()
545 memcpy((void *)&cd->acmd, qc->cdb, qc->dev->cdb_len); sata_fsl_qc_prep()
549 num_prde = sata_fsl_fill_sg(qc, (void *)cd, sata_fsl_qc_prep()
598 struct command_desc *cd; sata_fsl_qc_fill_rtf() local
600 cd = pp->cmdentry + tag; sata_fsl_qc_fill_rtf()
602 ata_tf_from_fis(cd->sfis, &qc->result_tf); sata_fsl_qc_fill_rtf()
/linux-4.1.27/arch/x86/kernel/cpu/microcode/
H A Dintel_early.c531 struct cpio_data cd; scan_microcode() local
539 cd.data = NULL; scan_microcode()
540 cd.size = 0; scan_microcode()
542 cd = find_cpio_data(p, (void *)start, size, &offset); scan_microcode()
543 if (!cd.data) scan_microcode()
546 return get_matching_model_microcode(0, start, cd.data, cd.size, scan_microcode()
/linux-4.1.27/fs/jfs/
H A Djfs_txnmgr.c165 struct tlock * tlck, struct commit * cd);
176 struct commit * cd);
1141 struct commit cd; txCommit() local
1158 sb = cd.sb = iplist[0]->i_sb; txCommit()
1159 cd.tid = tid; txCommit()
1169 cd.log = log; txCommit()
1172 lrd = &cd.lrd; txCommit()
1188 cd.iplist = iplist; txCommit()
1189 cd.nip = nip; txCommit()
1203 for (k = 0; k < cd.nip; k++) { txCommit()
1204 top = (cd.iplist[k])->i_ino; txCommit()
1205 for (n = k + 1; n < cd.nip; n++) { txCommit()
1206 ip = cd.iplist[n]; txCommit()
1209 cd.iplist[n] = cd.iplist[k]; txCommit()
1210 cd.iplist[k] = ip; txCommit()
1214 ip = cd.iplist[k]; txCommit()
1272 if ((rc = txLog(log, tblk, &cd))) txCommit()
1350 for (k = 0; k < cd.nip; k++) { txCommit()
1351 ip = cd.iplist[k]; txCommit()
1381 static int txLog(struct jfs_log * log, struct tblock * tblk, struct commit * cd) txLog() argument
1387 struct lrd *lrd = &cd->lrd; txLog()
1414 diLog(log, tblk, lrd, tlck, cd); txLog()
1439 struct tlock * tlck, struct commit * cd) diLog()
1494 cpu_to_le32((u32) (size_t) cd->iplist[1]); diLog()
1496 cpu_to_le32((u32) (size_t) cd->iplist[2]); diLog()
1438 diLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd, struct tlock * tlck, struct commit * cd) diLog() argument
/linux-4.1.27/drivers/media/v4l2-core/
H A Dv4l2-dev.c41 static ssize_t index_show(struct device *cd, index_show() argument
44 struct video_device *vdev = to_video_device(cd); index_show()
50 static ssize_t dev_debug_show(struct device *cd, dev_debug_show() argument
53 struct video_device *vdev = to_video_device(cd); dev_debug_show()
58 static ssize_t dev_debug_store(struct device *cd, struct device_attribute *attr, dev_debug_store() argument
61 struct video_device *vdev = to_video_device(cd); dev_debug_store()
74 static ssize_t name_show(struct device *cd, name_show() argument
77 struct video_device *vdev = to_video_device(cd); name_show()
170 static void v4l2_device_release(struct device *cd) v4l2_device_release() argument
172 struct video_device *vdev = to_video_device(cd); v4l2_device_release()
/linux-4.1.27/drivers/dma/
H A Dcppi41.c135 struct cppi41_desc *cd; member in struct:cppi41_dd
541 td = cdd->cd; cppi41_tear_down_chan()
687 cchan->desc = &cdd->cd[i]; cppi41_add_chans()
713 dma_free_coherent(dev, mem_decs, cdd->cd, purge_descs()
759 cdd->cd = dma_alloc_coherent(dev, mem_decs, init_descs()
761 if (!cdd->cd) init_descs()
H A Damba-pl08x.c222 * @cd: channel platform data
236 const struct pl08x_channel_data *cd; member in struct:pl08x_dma_chan
321 ret = pd->get_xfer_signal(plchan->cd); pl08x_request_mux()
340 pd->put_xfer_signal(plchan->cd, plchan->signal); pl08x_release_mux()
1376 if (plchan->cd->single) pl08x_get_cctl()
1501 dst_buses = plchan->cd->periph_buses; pl08x_init_txd()
1507 src_buses = plchan->cd->periph_buses; pl08x_init_txd()
1874 chan->name = chan->cd->bus_id; pl08x_dma_slave_init()
1875 chan->cfg.src_addr = chan->cd->addr; pl08x_dma_slave_init()
1876 chan->cfg.dst_addr = chan->cd->addr; pl08x_dma_slave_init()
1909 chan->cd = &pl08x->pd->slave_channels[i]; pl08x_dma_init_virtual_channels()
1912 chan->cd = &pl08x->pd->memcpy_channel; pl08x_dma_init_virtual_channels()
H A Dmv_xor.c1204 struct mv_xor_channel_data *cd; mv_xor_probe() local
1208 cd = &pdata->channels[i]; mv_xor_probe()
1209 if (!cd) { mv_xor_probe()
1221 cd->cap_mask, irq); mv_xor_probe()
/linux-4.1.27/arch/m68k/amiga/
H A Dconfig.c178 const struct ConfigDev *cd = data; amiga_parse_bootinfo() local
180 dev->rom = cd->cd_Rom; amiga_parse_bootinfo()
181 dev->slotaddr = be16_to_cpu(cd->cd_SlotAddr); amiga_parse_bootinfo()
182 dev->slotsize = be16_to_cpu(cd->cd_SlotSize); amiga_parse_bootinfo()
183 dev->boardaddr = be32_to_cpu(cd->cd_BoardAddr); amiga_parse_bootinfo()
184 dev->boardsize = be32_to_cpu(cd->cd_BoardSize); amiga_parse_bootinfo()
/linux-4.1.27/drivers/staging/speakup/
H A Di18n.c260 [MSG_KEYNAME_CLOSECD] = "close cd",
261 [MSG_KEYNAME_EJECTCD] = "eject cd",
262 [MSG_KEYNAME_EJECTCLOSE] = "eject close cd",
266 [MSG_KEYNAME_STOPCD] = "stop cd",
/linux-4.1.27/drivers/tty/serial/
H A Dxilinx_uartps.c339 u32 cd, bdiv; cdns_uart_calc_baud_divs() local
353 cd = DIV_ROUND_CLOSEST(clk, baud * (bdiv + 1)); cdns_uart_calc_baud_divs()
354 if (cd < 1 || cd > CDNS_UART_CD_MAX) cdns_uart_calc_baud_divs()
357 calc_baud = clk / (cd * (bdiv + 1)); cdns_uart_calc_baud_divs()
366 *rcd = cd; cdns_uart_calc_baud_divs()
389 u32 cd = 0, bdiv = 0; cdns_uart_set_baud_rate() local
394 calc_baud = cdns_uart_calc_baud_divs(port->uartclk, baud, &bdiv, &cd, cdns_uart_set_baud_rate()
404 writel(cd, port->membase + CDNS_UART_BAUDGEN_OFFSET); cdns_uart_set_baud_rate()
436 u32 bdiv, cd; cdns_uart_clk_notifier_cb() local
444 &bdiv, &cd, &div8)) { cdns_uart_clk_notifier_cb()
/linux-4.1.27/drivers/spi/
H A Dspi-omap2-mcspi.c1071 struct omap2_mcspi_device_config *cd; omap2_mcspi_work() local
1080 cd = spi->controller_data; omap2_mcspi_work()
1109 if (cd && cd->cs_per_word) { omap2_mcspi_work()
1132 if (cd && cd->turbo_mode && t->tx_buf == NULL) { omap2_mcspi_work()
1190 if (cd && cd->cs_per_word) { omap2_mcspi_work()
/linux-4.1.27/drivers/phy/
H A Dphy-exynos5250-sata.c6 * Yuvaraj Kumar C D <yuvaraj.cd@samsung.com>
250 MODULE_AUTHOR("Yuvaraj C D <yuvaraj.cd@samsung.com>");
/linux-4.1.27/drivers/gpu/drm/panel/
H A Dpanel-s6e8aa0.c326 case 0 ... 6: /* 30cd ~ 100cd */ s6e8aa0_elvss_nvm_set_v142()
329 case 7 ... 11: /* 120cd ~ 150cd */ s6e8aa0_elvss_nvm_set_v142()
332 case 12 ... 15: /* 180cd ~ 210cd */ s6e8aa0_elvss_nvm_set_v142()
336 case 16 ... 24: /* 240cd ~ 300cd */ s6e8aa0_elvss_nvm_set_v142()
/linux-4.1.27/drivers/video/fbdev/exynos/
H A Ds6e8ax0.c323 /* Gamma 2.2 Setting (200cd, 7500K, 10MPCD) */ s6e8ax0_gamma_cond()
568 case 0: /* 30cd */ s6e8ax0_acl_ctrl_set()
572 case 1 ... 3: /* 50cd ~ 90cd */ s6e8ax0_acl_ctrl_set()
579 case 4 ... 7: /* 120cd ~ 210cd */ s6e8ax0_acl_ctrl_set()
586 case 8 ... 10: /* 220cd ~ 300cd */ s6e8ax0_acl_ctrl_set()
/linux-4.1.27/include/linux/mfd/
H A Ducb1x00.h163 #define classdev_to_ucb1x00(cd) container_of(cd, struct ucb1x00, dev)
/linux-4.1.27/drivers/mmc/core/
H A Dhost.c357 * "broken-cd" property is provided, the MMC_CAP_NEEDS_POLL capability mmc_of_parse()
367 cd_cap_invert = of_property_read_bool(np, "cd-inverted"); mmc_of_parse()
369 if (of_find_property(np, "broken-cd", &len)) mmc_of_parse()
372 ret = mmc_gpiod_request_cd(host, "cd", 0, true, mmc_of_parse()
381 * through the cd-inverted flag and by the GPIO line itself mmc_of_parse()
H A Dslot-gpio.c52 snprintf(ctx->cd_label, len, "%s cd", dev_name(host->parent)); mmc_gpio_alloc()
/linux-4.1.27/arch/cris/arch-v32/drivers/
H A Dcryptocop.c351 static void setup_descr_chain(struct cryptocop_dma_desc *cd) setup_descr_chain() argument
354 while (cd) { setup_descr_chain()
355 if (cd->next) { setup_descr_chain()
356 cd->dma_descr->next = (dma_descr_data*)virt_to_phys(cd->next->dma_descr); setup_descr_chain()
358 cd->dma_descr->next = NULL; setup_descr_chain()
360 cd = cd->next; setup_descr_chain()
1366 struct cryptocop_dma_desc *cd = iop->cdesc_out; delete_internal_operation() local
1371 while (cd) { delete_internal_operation()
1372 next = cd->next; delete_internal_operation()
1373 free_cdesc(cd); delete_internal_operation()
1374 cd = next; delete_internal_operation()
1376 cd = iop->cdesc_in; delete_internal_operation()
1377 while (cd) { delete_internal_operation()
1378 next = cd->next; delete_internal_operation()
1379 free_cdesc(cd); delete_internal_operation()
1380 cd = next; delete_internal_operation()
/linux-4.1.27/drivers/mmc/host/
H A Dsdhci-sirf.c148 gpio_cd = of_get_named_gpio(pdev->dev.of_node, "cd-gpios", 0); sdhci_sirf_probe()
H A Dsdhci-spear.c51 cd_gpio = of_get_named_gpio(np, "cd-gpios", 0); sdhci_probe_config_dt()
H A Dwmt-sdmmc.c723 u32 cd = (readb(priv->sdmmc_base + SDMMC_STS0) & STS0_CD_GPI) >> 3; wmt_mci_get_cd() local
725 return !(cd ^ priv->cd_inverted); wmt_mci_get_cd()
813 if (of_get_property(np, "cd-inverted", NULL)) wmt_mci_probe()
H A Drtsx_pci_sdmmc.c1127 int cd = 0; sdmmc_get_cd() local
1131 return cd; sdmmc_get_cd()
1141 cd = 1; sdmmc_get_cd()
1145 return cd; sdmmc_get_cd()
H A Dsdhci-pltfm.c89 if (of_get_property(np, "broken-cd", NULL)) sdhci_get_of_property()
H A Dsdhci-s3c.c404 if (of_get_property(node, "broken-cd", NULL)) { sdhci_s3c_parse_dt()
414 if (of_get_named_gpio(node, "cd-gpios", 0)) sdhci_s3c_parse_dt()
H A Dsdhci-esdhc-imx.c879 if (of_get_property(np, "fsl,cd-controller", NULL)) sdhci_esdhc_imx_probe_dt()
885 boarddata->cd_gpio = of_get_named_gpio(np, "cd-gpios", 0); sdhci_esdhc_imx_probe_dt()
H A Dmxs-mmc.c645 host->broken_cd = of_property_read_bool(np, "broken-cd"); mxs_mmc_probe()
H A Dpxamci.c601 of_get_named_gpio(np, "cd-gpios", 0); pxamci_of_init()
H A Dmmci.c1686 * look up these descriptors named "cd" and "wp" right here, fail mmci_probe()
1690 ret = mmc_gpiod_request_cd(mmc, "cd", 0, false, 0, NULL); mmci_probe()
/linux-4.1.27/drivers/net/ethernet/8390/
H A Detherh.c522 struct in_chunk_dir cd; etherh_addr() local
525 if (!ecard_readchunk(&cd, ec, 0xf5, 0)) { etherh_addr()
531 s = strchr(cd.d.string, '('); etherh_addr()
546 dev_name(&ec->dev), cd.d.string); etherh_addr()
/linux-4.1.27/drivers/staging/rts5208/
H A Drtsx.h131 /* Whether interrupt handler should care card cd info */
/linux-4.1.27/tools/perf/util/
H A Drun-command.c103 die("exec %s: cd to %s failed (%s)", cmd->argv[0], start_command()
/linux-4.1.27/tools/power/acpi/
H A DMakefile18 OUTDIR := $(shell cd $(OUTPUT) && /bin/pwd)
/linux-4.1.27/include/linux/iio/adc/
H A Dad_sigma_delta.h117 const struct ad_sd_calib_data *cd, unsigned int n);
/linux-4.1.27/drivers/media/
H A Dmedia-device.c344 static ssize_t show_model(struct device *cd, show_model() argument
347 struct media_device *mdev = to_media_device(to_media_devnode(cd)); show_model()
H A Dmedia-devnode.c60 static void media_devnode_release(struct device *cd) media_devnode_release() argument
62 struct media_devnode *mdev = to_media_devnode(cd); media_devnode_release()
/linux-4.1.27/arch/mips/alchemy/devboards/
H A Ddb1000.c519 gpio_direction_input(19); /* sd0 cd# */ db1000_dev_setup()
520 gpio_direction_input(20); /* sd1 cd# */ db1000_dev_setup()
/linux-4.1.27/drivers/tty/hvc/
H A Dhvsi_lib.c46 static void hvsi_cd_change(struct hvsi_priv *pv, int cd) hvsi_cd_change() argument
48 if (cd) hvsi_cd_change()
/linux-4.1.27/Documentation/DocBook/media/
H A DMakefile205 @(ln -sf `cd $(MEDIA_SRC_DIR) && /bin/pwd`/v4l/*xml $(MEDIA_OBJ_DIR)/)
206 @(ln -sf `cd $(MEDIA_SRC_DIR) && /bin/pwd`/dvb/*xml $(MEDIA_OBJ_DIR)/)
/linux-4.1.27/drivers/pinctrl/mvebu/
H A Dpinctrl-dove.c375 MPP_FUNCTION(0x03, "sdio0", "cd"),
446 MPP_FUNCTION(0x03, "sdio1", "cd"),
580 MPP_FUNCTION(0x04, "sdio1", "cd"),
648 MPP_FUNCTION(0x03, "sdio0", "cd"),
673 MPP_FUNCTION(0x03, "sdio1", "cd"),
674 MPP_FUNCTION(0x05, "sdio0", "cd"),
/linux-4.1.27/arch/arm/mach-rpc/
H A Decard.c327 int ecard_readchunk(struct in_chunk_dir *cd, ecard_t *ec, int id, int num) ecard_readchunk() argument
333 if (!ec->cid.cd) ecard_readchunk()
379 cd->start_offset = c_start(&excd); ecard_readchunk()
380 memcpy(cd->d.string, excd.d.string, 256); ecard_readchunk()
634 if (!ec->card_desc && ec->cid.cd && ecard_prints()
910 ec->cid.cd = cid.r_cd; ecard_probe()
/linux-4.1.27/arch/x86/kernel/cpu/
H A Dperf_event_intel_pt.c75 struct pt_cap_desc *cd = &pt_caps[cap]; pt_cap_get() local
76 u32 c = pt_pmu.caps[cd->leaf * 4 + cd->reg]; pt_cap_get()
77 unsigned int shift = __ffs(cd->mask); pt_cap_get()
79 return (c & cd->mask) >> shift; pt_cap_get()
/linux-4.1.27/drivers/net/ethernet/seeq/
H A Dether3.c200 struct in_chunk_dir cd; ether3_addr() local
203 if (ecard_readchunk(&cd, ec, 0xf5, 0) && (s = strchr(cd.d.string, '('))) { ether3_addr()
/linux-4.1.27/virt/kvm/
H A Dkvm_main.c2427 struct kvm_create_device *cd) kvm_ioctl_create_device()
2431 bool test = cd->flags & KVM_CREATE_DEVICE_TEST; kvm_ioctl_create_device()
2434 if (cd->type >= ARRAY_SIZE(kvm_device_ops_table)) kvm_ioctl_create_device()
2437 ops = kvm_device_ops_table[cd->type]; kvm_ioctl_create_device()
2451 ret = ops->create(dev, cd->type); kvm_ioctl_create_device()
2465 cd->fd = ret; kvm_ioctl_create_device()
2646 struct kvm_create_device cd; kvm_vm_ioctl() local
2649 if (copy_from_user(&cd, argp, sizeof(cd))) kvm_vm_ioctl()
2652 r = kvm_ioctl_create_device(kvm, &cd); kvm_vm_ioctl()
2657 if (copy_to_user(argp, &cd, sizeof(cd))) kvm_vm_ioctl()
2426 kvm_ioctl_create_device(struct kvm *kvm, struct kvm_create_device *cd) kvm_ioctl_create_device() argument
/linux-4.1.27/drivers/media/i2c/cx25840/
H A Dcx25840-audio.c236 /* 0x1.60cd = 44100/32000 */ cx25840_set_audclk_freq()
388 /* 0x1.60cd = 44100/32000 */ cx231xx_set_audclk_freq()
/linux-4.1.27/arch/um/drivers/
H A Dcow_user.c160 cow_printf("absolutize : Can't cd to '%s' - " absolutize()
189 cow_printf("absolutize : Can't cd to '%s' - " absolutize()
/linux-4.1.27/drivers/pcmcia/
H A Dxxs1500_ss.c279 dev_err(&pdev->dev, "cannot setup cd irq\n"); xxs1500_pcmcia_probe()
/linux-4.1.27/drivers/usb/serial/
H A Daircable.c42 * and made it all available inside a cd.
/linux-4.1.27/arch/avr32/boards/atstk1000/
H A Datstk1002.c274 #endif /* SW6 for sd{cd,wp} routing */
/linux-4.1.27/arch/cris/include/arch-v32/arch/hwregs/
H A DMakefile160 (cd $(OFFICIAL_INCDIR); ls -l *.h )
/linux-4.1.27/include/linux/mlx5/
H A Dmlx5_ifc.h233 u8 cd[0x1]; member in struct:mlx5_ifc_cmd_hca_cap_bits
/linux-4.1.27/drivers/staging/lustre/lustre/obdecho/
H A Decho_client.c696 struct cl_device *cd; echo_device_alloc() local
710 cd = &ed->ed_cl; echo_device_alloc()
711 rc = cl_device_init(cd, t); echo_device_alloc()
715 cd->cd_lu_dev.ld_ops = &echo_device_lu_ops; echo_device_alloc()
716 cd->cd_ops = &echo_device_cl_ops; echo_device_alloc()
784 return &cd->cd_lu_dev; echo_device_alloc()
/linux-4.1.27/drivers/net/bonding/
H A Dbond_sysfs.c46 #define to_bond(cd) ((struct bonding *)(netdev_priv(to_net_dev(cd))))
/linux-4.1.27/net/bridge/
H A Dbr_sysfs_br.c26 #define to_bridge(cd) ((struct net_bridge *)netdev_priv(to_net_dev(cd)))
/linux-4.1.27/sound/isa/
H A Dcmi8330.c148 0x0, /* 21 - cd-in volume */
153 0x0 /* 26 - cd-in rec gain */
/linux-4.1.27/drivers/ntb/
H A Dntb_transport.c266 struct ntb_transport_client_dev *client_dev, *cd; ntb_bus_remove() local
268 list_for_each_entry_safe(client_dev, cd, &nt->client_devs, entry) { ntb_bus_remove()
297 struct ntb_transport_client_dev *client, *cd; ntb_unregister_client_dev() local
301 list_for_each_entry_safe(client, cd, &nt->client_devs, entry) ntb_unregister_client_dev()
/linux-4.1.27/fs/ufs/
H A Dsuper.c385 {Opt_type_nextstepcd, "ufstype=nextstep-cd"},
821 "sun|sunx86|44bsd|ufs2|5xbsd|old|hp|nextstep|nextstep-cd|openstep ...\n\n" ufs_fill_super()
924 UFSD("ufstype=nextstep-cd\n"); ufs_fill_super()
934 pr_info("ufstype=nextstep-cd is supported read-only\n"); ufs_fill_super()
/linux-4.1.27/include/uapi/linux/
H A Delf.h54 * http://docs.oracle.com/cd/E18752_01/pdf/817-1984.pdf
H A Dcdrom.h94 * This ioctl is only used by the scsi-cd driver.
105 * These ioctls are (now) only in ide-cd.c for controlling
H A Dsoundcard.h765 * specific meanings (line, cd, synth etc.) to them.
802 "mic", "cd", "mix", "pcm2", "rec", "igain", "ogain", \
/linux-4.1.27/arch/arm/mach-integrator/
H A Dimpd1.c418 lookup->table[1].con_id = "cd"; impd1_probe()
/linux-4.1.27/Documentation/ptp/
H A Dtestptp.c188 while (EOF != (c = getopt(argc, argv, "a:A:cd:e:f:ghi:k:lL:p:P:sSt:T:v"))) { main()
/linux-4.1.27/tools/power/cpupower/
H A DMakefile29 OUTDIR := $(shell cd $(OUTPUT) && /bin/pwd)
/linux-4.1.27/drivers/media/pci/cx18/
H A Dcx18-av-audio.c234 /* 0x1.60cd = 44100/32000 */ set_audclk_freq()
/linux-4.1.27/drivers/gpio/
H A Dgpio-twl4030.c465 of_property_read_u32(dev->of_node, "ti,mmc-cd", of_gpio_twl4030()
/linux-4.1.27/arch/m68k/include/asm/
H A Dm68360_quicc.h252 volatile unsigned short cd:12; member in struct:quicc::__anon1802::__anon1803
/linux-4.1.27/scripts/kconfig/
H A Dstreamline_config.pl38 # cd /usr/src/linux-2.6.10
/linux-4.1.27/drivers/crypto/qat/qat_common/
H A Dqat_algs.c454 struct icp_qat_hw_cipher_algo_blk *cd, qat_alg_ablkcipher_init_com()
461 memcpy(cd->aes.key, key, keylen); qat_alg_ablkcipher_init_com()
452 qat_alg_ablkcipher_init_com(struct qat_alg_ablkcipher_ctx *ctx, struct icp_qat_fw_la_bulk_req *req, struct icp_qat_hw_cipher_algo_blk *cd, const uint8_t *key, unsigned int keylen) qat_alg_ablkcipher_init_com() argument
/linux-4.1.27/arch/x86/kernel/
H A Duprobes.c90 * cd - int N.
152 * cd - int N.
/linux-4.1.27/drivers/staging/lustre/lustre/ptlrpc/
H A Dpack_generic.c2531 void lustre_swab_close_data(struct close_data *cd) lustre_swab_close_data() argument
2533 lustre_swab_lu_fid(&cd->cd_fid); lustre_swab_close_data()
2534 __swab64s(&cd->cd_data_version); lustre_swab_close_data()
/linux-4.1.27/drivers/gpu/drm/i915/
H A Dintel_ddi.c1700 return 24000; /* 24MHz is the cd freq with NSSC ref */ skl_get_cdclk_freq()
1720 WARN(1, "Unknown cd freq selection\n"); skl_get_cdclk_freq()
1732 WARN(1, "Unknown cd freq selection\n"); skl_get_cdclk_freq()
/linux-4.1.27/
H A DMakefile135 KBUILD_OUTPUT := $(shell mkdir -p $(KBUILD_OUTPUT) && cd $(KBUILD_OUTPUT) \
932 $(Q)ln -fsn `cd $(srctree) && /bin/pwd`/scripts/gdb/vmlinux-gdb.py
1127 @ln -s `cd $(srctree) && /bin/pwd` $(MODLIB)/source
/linux-4.1.27/drivers/scsi/sym53c8xx_2/
H A Dsym_defs.h356 /*cd*/ u8 nc_ua1;
/linux-4.1.27/crypto/
H A Dvmac.c193 /* compute ab*cd, put bd into result registers */ \
/linux-4.1.27/sound/mips/
H A Dsgio2audio.c289 /* cd mixer control */

Completed in 5308 milliseconds

12