| /freebsd-11-stable/sys/dev/tws/ |
| HD | tws.c | 53 extern int tws_cam_attach(struct tws_softc *sc); 54 extern void tws_cam_detach(struct tws_softc *sc); 55 extern int tws_init_ctlr(struct tws_softc *sc); 56 extern boolean tws_ctlr_ready(struct tws_softc *sc); 57 extern void tws_turn_off_interrupts(struct tws_softc *sc); 58 extern void tws_q_insert_tail(struct tws_softc *sc, struct tws_request *req, 60 extern struct tws_request *tws_q_remove_request(struct tws_softc *sc, 62 extern struct tws_request *tws_q_remove_head(struct tws_softc *sc, 64 extern boolean tws_get_response(struct tws_softc *sc, u_int16_t *req_id); 65 extern boolean tws_ctlr_reset(struct tws_softc *sc); [all …]
|
| /freebsd-11-stable/sys/dev/hatm/ |
| HD | if_hatm.c | 200 hatm_alloc_dmamem(struct hatm_softc *sc, const char *what, struct dmamem *mem) in hatm_alloc_dmamem() argument 216 error = bus_dma_tag_create(sc->parent_tag, mem->align, 0, in hatm_alloc_dmamem() 222 if_printf(sc->ifp, "DMA tag create (%s)\n", what); in hatm_alloc_dmamem() 228 if_printf(sc->ifp, "DMA mem alloc (%s): %d\n", in hatm_alloc_dmamem() 238 if_printf(sc->ifp, "DMA map load (%s): %d\n", in hatm_alloc_dmamem() 246 DBG(sc, DMA, ("%s S/A/V/P 0x%x 0x%x %p 0x%lx", what, mem->size, in hatm_alloc_dmamem() 270 hatm_destroy_rmaps(struct hatm_softc *sc) in hatm_destroy_rmaps() argument 274 DBG(sc, ATTACH, ("destroying rmaps and lbuf pointers...")); in hatm_destroy_rmaps() 275 if (sc->rmaps != NULL) { in hatm_destroy_rmaps() 276 for (b = 0; b < sc->lbufs_size; b++) in hatm_destroy_rmaps() [all …]
|
| /freebsd-11-stable/sys/dev/mse/ |
| HD | mse.c | 111 static void mseintr_locked(mse_softc_t *sc); 121 mse_softc_t *sc; in mse_common_attach() local 124 sc = device_get_softc(dev); in mse_common_attach() 126 mtx_init(&sc->sc_lock, "mse", NULL, MTX_DEF); in mse_common_attach() 127 callout_init_mtx(&sc->sc_callout, &sc->sc_lock, 0); in mse_common_attach() 130 sc->sc_intr = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, in mse_common_attach() 132 if (sc->sc_intr == NULL) { in mse_common_attach() 133 bus_release_resource(dev, SYS_RES_IOPORT, rid, sc->sc_port); in mse_common_attach() 134 mtx_destroy(&sc->sc_lock); in mse_common_attach() 138 if (bus_setup_intr(dev, sc->sc_intr, INTR_TYPE_TTY | INTR_MPSAFE, in mse_common_attach() [all …]
|
| /freebsd-11-stable/sys/dev/ed/ |
| HD | if_ed.c | 88 static void ed_stop_hw(struct ed_softc *sc); 121 ed_probe_generic8390(struct ed_softc *sc) in ed_probe_generic8390() argument 123 if ((ed_nic_inb(sc, ED_P0_CR) & in ed_probe_generic8390() 127 if ((ed_nic_inb(sc, ED_P0_ISR) & ED_ISR_RST) != ED_ISR_RST) in ed_probe_generic8390() 134 ed_disable_16bit_access(struct ed_softc *sc) in ed_disable_16bit_access() argument 139 if (sc->isa16bit && sc->vendor == ED_VENDOR_WD_SMC) { in ed_disable_16bit_access() 140 if (sc->chip_type == ED_CHIP_TYPE_WD790) in ed_disable_16bit_access() 141 ed_asic_outb(sc, ED_WD_MSR, 0x00); in ed_disable_16bit_access() 142 ed_asic_outb(sc, ED_WD_LAAR, in ed_disable_16bit_access() 143 sc->wd_laar_proto & ~ED_WD_LAAR_M16EN); in ed_disable_16bit_access() [all …]
|
| /freebsd-11-stable/sys/dev/uart/ |
| HD | uart_core.c | 96 uart_pps_print_mode(struct uart_softc *sc) in uart_pps_print_mode() argument 99 device_printf(sc->sc_dev, "PPS capture mode: "); in uart_pps_print_mode() 100 switch(sc->sc_pps_mode) { in uart_pps_print_mode() 110 if (sc->sc_pps_mode & UART_PPS_INVERT_PULSE) in uart_pps_print_mode() 112 if (sc->sc_pps_mode & UART_PPS_NARROW_PULSE) in uart_pps_print_mode() 120 struct uart_softc *sc; in uart_pps_mode_sysctl() local 123 sc = arg1; in uart_pps_mode_sysctl() 124 tmp = sc->sc_pps_mode; in uart_pps_mode_sysctl() 130 sc->sc_pps_mode = tmp; in uart_pps_mode_sysctl() 135 uart_pps_process(struct uart_softc *sc, int ser_sig) in uart_pps_process() argument [all …]
|
| /freebsd-11-stable/sys/dev/digi/ |
| HD | digi_isa.c | 74 digi_isa_setwin(struct digi_softc *sc, unsigned int addr) in digi_isa_setwin() argument 76 outb(sc->wport, sc->window = FEPWIN | (addr >> sc->win_bits)); in digi_isa_setwin() 77 return (sc->vmem + (addr % sc->win_size)); in digi_isa_setwin() 81 digi_xi_setwin(struct digi_softc *sc, unsigned int addr) in digi_xi_setwin() argument 83 outb(sc->wport, sc->window = FEPMEM); in digi_xi_setwin() 84 return (sc->vmem + addr); in digi_xi_setwin() 88 digi_isa_hidewin(struct digi_softc *sc) in digi_isa_hidewin() argument 90 outb(sc->wport, sc->window = 0); in digi_isa_hidewin() 95 digi_isa_towin(struct digi_softc *sc, int win) in digi_isa_towin() argument 97 outb(sc->wport, sc->window = win); in digi_isa_towin() [all …]
|
| /freebsd-11-stable/sys/dev/ath/ |
| HD | if_ath.c | 183 static void ath_txq_init(struct ath_softc *sc, struct ath_txq *, int); 188 static int ath_tx_processq(struct ath_softc *sc, struct ath_txq *txq, 260 ath_legacy_attach_comp_func(struct ath_softc *sc) in ath_legacy_attach_comp_func() argument 268 switch (sc->sc_txqsetup &~ (1<<sc->sc_cabq->axq_qnum)) { in ath_legacy_attach_comp_func() 270 TASK_INIT(&sc->sc_txtask, 0, ath_tx_proc_q0, sc); in ath_legacy_attach_comp_func() 273 TASK_INIT(&sc->sc_txtask, 0, ath_tx_proc_q0123, sc); in ath_legacy_attach_comp_func() 276 TASK_INIT(&sc->sc_txtask, 0, ath_tx_proc, sc); in ath_legacy_attach_comp_func() 290 _ath_power_setpower(struct ath_softc *sc, int power_state, const char *file, int line) in _ath_power_setpower() argument 292 ATH_LOCK_ASSERT(sc); in _ath_power_setpower() 294 sc->sc_target_powerstate = power_state; in _ath_power_setpower() [all …]
|
| /freebsd-11-stable/sys/dev/mrsas/ |
| HD | mrsas.c | 70 static int mrsas_setup_msix(struct mrsas_softc *sc); 71 static int mrsas_allocate_msix(struct mrsas_softc *sc); 72 static void mrsas_shutdown_ctlr(struct mrsas_softc *sc, u_int32_t opcode); 73 static void mrsas_flush_cache(struct mrsas_softc *sc); 74 static void mrsas_reset_reply_desc(struct mrsas_softc *sc); 76 static int mrsas_get_map_info(struct mrsas_softc *sc); 77 static int mrsas_get_ld_map_info(struct mrsas_softc *sc); 78 static int mrsas_sync_map_info(struct mrsas_softc *sc); 79 static int mrsas_get_pd_list(struct mrsas_softc *sc); 80 static int mrsas_get_ld_list(struct mrsas_softc *sc); [all …]
|
| /freebsd-11-stable/sys/arm/at91/ |
| HD | if_ate.c | 97 #define RX_BUF_SIZE(sc) (sc->is_emacb ? 128 : MCLBYTES) argument 124 #define NEXT_RX_IDX(sc, cur) \ argument 125 ((sc->rx_descs[cur].addr & ETH_WRAP_BIT) ? 0 : (cur + 1)) 127 #define NEXT_TX_IDX(sc, cur) \ argument 128 ((sc->tx_descs[cur].status & ETHB_TX_WRAP) ? 0 : (cur + 1)) 167 RD4(struct ate_softc *sc, bus_size_t off) in RD4() argument 170 return (bus_read_4(sc->mem_res, off)); in RD4() 174 WR4(struct ate_softc *sc, bus_size_t off, uint32_t val) in WR4() argument 177 bus_write_4(sc->mem_res, off, val); in WR4() 181 BARRIER(struct ate_softc *sc, bus_size_t off, bus_size_t len, int flags) in BARRIER() argument [all …]
|
| /freebsd-11-stable/sys/dev/altera/jtag_uart/ |
| HD | altera_jtag_uart_tty.c | 83 aju_data_read(struct altera_jtag_uart_softc *sc) in aju_data_read() argument 86 return (le32toh(bus_read_4(sc->ajus_mem_res, in aju_data_read() 91 aju_data_write(struct altera_jtag_uart_softc *sc, uint32_t v) in aju_data_write() argument 94 bus_write_4(sc->ajus_mem_res, ALTERA_JTAG_UART_DATA_OFF, htole32(v)); in aju_data_write() 98 aju_control_read(struct altera_jtag_uart_softc *sc) in aju_control_read() argument 101 return (le32toh(bus_read_4(sc->ajus_mem_res, in aju_control_read() 106 aju_control_write(struct altera_jtag_uart_softc *sc, uint32_t v) in aju_control_write() argument 109 bus_write_4(sc->ajus_mem_res, ALTERA_JTAG_UART_CONTROL_OFF, in aju_control_write() 117 aju_writable(struct altera_jtag_uart_softc *sc) in aju_writable() argument 120 return ((aju_control_read(sc) & in aju_writable() [all …]
|
| /freebsd-11-stable/sys/dev/cyapa/ |
| HD | cyapa.c | 205 struct cyapa_softc *sc; member 211 static int cyapa_raw_input(struct cyapa_softc *sc, struct cyapa_regs *regs, 213 static void cyapa_set_power_mode(struct cyapa_softc *sc, int mode); 215 static int fifo_empty(struct cyapa_softc *sc, struct cyapa_fifo *fifo); 216 static size_t fifo_ready(struct cyapa_softc *sc, struct cyapa_fifo *fifo); 217 static char *fifo_read(struct cyapa_softc *sc, struct cyapa_fifo *fifo, 219 static char *fifo_write(struct cyapa_softc *sc, struct cyapa_fifo *fifo, 221 static uint8_t fifo_read_char(struct cyapa_softc *sc, 223 static void fifo_write_char(struct cyapa_softc *sc, struct cyapa_fifo *fifo, 225 static size_t fifo_space(struct cyapa_softc *sc, struct cyapa_fifo *fifo); [all …]
|
| /freebsd-11-stable/sys/powerpc/powermac/ |
| HD | cuda.c | 74 static void cuda_send_inbound(struct cuda_softc *sc); 75 static void cuda_send_outbound(struct cuda_softc *sc); 117 static uint8_t cuda_read_reg(struct cuda_softc *sc, u_int offset); 118 static void cuda_write_reg(struct cuda_softc *sc, u_int offset, uint8_t value); 143 struct cuda_softc *sc; in cuda_attach() local 149 sc = device_get_softc(dev); in cuda_attach() 150 sc->sc_dev = dev; in cuda_attach() 152 sc->sc_memrid = 0; in cuda_attach() 153 sc->sc_memr = bus_alloc_resource_any(dev, SYS_RES_MEMORY, in cuda_attach() 154 &sc->sc_memrid, RF_ACTIVE); in cuda_attach() [all …]
|
| /freebsd-11-stable/sys/dev/esp/ |
| HD | ncr53c9x.c | 135 static void ncr53c9x_abort(struct ncr53c9x_softc *sc, 141 static void ncr53c9x_clear(struct ncr53c9x_softc *sc, cam_status result); 142 static void ncr53c9x_clear_target(struct ncr53c9x_softc *sc, int target, 144 static void ncr53c9x_dequeue(struct ncr53c9x_softc *sc, 146 static void ncr53c9x_done(struct ncr53c9x_softc *sc, 148 static void ncr53c9x_free_ecb(struct ncr53c9x_softc *sc, 150 static void ncr53c9x_msgin(struct ncr53c9x_softc *sc); 151 static void ncr53c9x_msgout(struct ncr53c9x_softc *sc); 152 static void ncr53c9x_init(struct ncr53c9x_softc *sc, int doreset); 153 static void ncr53c9x_intr1(struct ncr53c9x_softc *sc); [all …]
|
| /freebsd-11-stable/sys/dev/fe/ |
| HD | if_fe.c | 224 fe_simple_probe (struct fe_softc const * sc, in fe_simple_probe() argument 231 bits = fe_inb(sc, p->port); in fe_simple_probe() 282 fe_softc_defaults (struct fe_softc *sc) in fe_softc_defaults() argument 287 sc->proto_dlcr4 = FE_D4_LBC_DISABLE | FE_D4_CNTRL; in fe_softc_defaults() 288 sc->proto_dlcr5 = 0; in fe_softc_defaults() 289 sc->proto_dlcr6 = FE_D6_BUFSIZ_32KB | FE_D6_TXBSIZ_2x4KB in fe_softc_defaults() 291 sc->proto_dlcr7 = FE_D7_BYTSWP_LH; in fe_softc_defaults() 292 sc->proto_bmpr13 = 0; in fe_softc_defaults() 295 sc->stability = 0; in fe_softc_defaults() 298 sc->init = NULL; in fe_softc_defaults() [all …]
|
| /freebsd-11-stable/sys/dev/bxe/ |
| HD | bxe.c | 653 static void bxe_cmng_fns_init(struct bxe_softc *sc, 656 static int bxe_get_cmng_fns_mode(struct bxe_softc *sc); 657 static void storm_memset_cmng(struct bxe_softc *sc, 660 static void bxe_set_reset_global(struct bxe_softc *sc); 661 static void bxe_set_reset_in_progress(struct bxe_softc *sc); 662 static uint8_t bxe_reset_is_done(struct bxe_softc *sc, 664 static uint8_t bxe_clear_pf_load(struct bxe_softc *sc); 665 static uint8_t bxe_chk_parity_attn(struct bxe_softc *sc, 668 static void bxe_int_disable(struct bxe_softc *sc); 669 static int bxe_release_leader_lock(struct bxe_softc *sc); [all …]
|
| /freebsd-11-stable/sys/dev/ichiic/ |
| HD | ig4_iic.c | 75 static void ig4iic_dump(ig4iic_softc_t *sc); 85 reg_write(ig4iic_softc_t *sc, uint32_t reg, uint32_t value) in reg_write() argument 87 bus_write_4(sc->regs_res, reg, value); in reg_write() 88 bus_barrier(sc->regs_res, reg, 4, BUS_SPACE_BARRIER_WRITE); in reg_write() 92 reg_read(ig4iic_softc_t *sc, uint32_t reg) in reg_read() argument 96 bus_barrier(sc->regs_res, reg, 4, BUS_SPACE_BARRIER_READ); in reg_read() 97 value = bus_read_4(sc->regs_res, reg); in reg_read() 106 set_controller(ig4iic_softc_t *sc, uint32_t ctl) in set_controller() argument 117 reg_write(sc, IG4_REG_INTR_MASK, IG4_INTR_STOP_DET | in set_controller() 119 reg_read(sc, IG4_REG_CLR_INTR); in set_controller() [all …]
|
| /freebsd-11-stable/sys/dev/sbni/ |
| HD | if_sbni.c | 137 sbni_inb(struct sbni_softc *sc, enum sbni_reg reg) in sbni_inb() argument 140 rman_get_bustag(sc->io_res), in sbni_inb() 141 rman_get_bushandle(sc->io_res), in sbni_inb() 142 sc->io_off + reg); in sbni_inb() 146 sbni_outb(struct sbni_softc *sc, enum sbni_reg reg, u_char value) in sbni_outb() argument 149 rman_get_bustag(sc->io_res), in sbni_outb() 150 rman_get_bushandle(sc->io_res), in sbni_outb() 151 sc->io_off + reg, value); in sbni_outb() 155 sbni_insb(struct sbni_softc *sc, u_char *to, u_int len) in sbni_insb() argument 158 rman_get_bustag(sc->io_res), in sbni_insb() [all …]
|
| /freebsd-11-stable/sys/dev/smc/ |
| HD | if_smc.c | 81 #define SMC_LOCK(sc) mtx_lock(&(sc)->smc_mtx) argument 82 #define SMC_UNLOCK(sc) mtx_unlock(&(sc)->smc_mtx) argument 83 #define SMC_ASSERT_LOCKED(sc) mtx_assert(&(sc)->smc_mtx, MA_OWNED) argument 147 smc_select_bank(struct smc_softc *sc, uint16_t bank) in smc_select_bank() argument 150 bus_barrier(sc->smc_reg, BSR, 2, in smc_select_bank() 152 bus_write_2(sc->smc_reg, BSR, bank & BSR_BANK_MASK); in smc_select_bank() 153 bus_barrier(sc->smc_reg, BSR, 2, in smc_select_bank() 159 smc_mmu_wait(struct smc_softc *sc) in smc_mmu_wait() argument 162 KASSERT((bus_read_2(sc->smc_reg, BSR) & in smc_mmu_wait() 164 device_get_nameunit(sc->smc_dev))); in smc_mmu_wait() [all …]
|
| /freebsd-11-stable/sys/dev/cadence/ |
| HD | if_cgem.c | 194 #define RD4(sc, off) (bus_read_4((sc)->mem_res, (off))) argument 195 #define WR4(sc, off, val) (bus_write_4((sc)->mem_res, (off), (val))) argument 196 #define BARRIER(sc, off, len, flags) \ argument 197 (bus_barrier((sc)->mem_res, (off), (len), (flags)) 199 #define CGEM_LOCK(sc) mtx_lock(&(sc)->sc_mtx) argument 200 #define CGEM_UNLOCK(sc) mtx_unlock(&(sc)->sc_mtx) argument 201 #define CGEM_LOCK_INIT(sc) \ argument 202 mtx_init(&(sc)->sc_mtx, device_get_nameunit((sc)->dev), \ 204 #define CGEM_LOCK_DESTROY(sc) mtx_destroy(&(sc)->sc_mtx) argument 205 #define CGEM_ASSERT_LOCKED(sc) mtx_assert(&(sc)->sc_mtx, MA_OWNED) argument [all …]
|
| /freebsd-11-stable/sys/dev/de/ |
| HD | if_de.c | 129 static void tulip_addr_filter(tulip_softc_t * const sc); 134 static void tulip_init_locked(tulip_softc_t * const sc); 137 static void tulip_mii_autonegotiate(tulip_softc_t * const sc, 139 static int tulip_mii_map_abilities(tulip_softc_t * const sc, 142 tulip_mii_phy_readspecific(tulip_softc_t * const sc); 143 static unsigned tulip_mii_readreg(tulip_softc_t * const sc, unsigned devaddr, 145 static void tulip_mii_writereg(tulip_softc_t * const sc, unsigned devaddr, 147 static void tulip_reset(tulip_softc_t * const sc); 148 static void tulip_rx_intr(tulip_softc_t * const sc); 149 static int tulip_srom_decode(tulip_softc_t * const sc); [all …]
|
| /freebsd-11-stable/sys/dev/ffec/ |
| HD | if_ffec.c | 195 #define FFEC_LOCK(sc) mtx_lock(&(sc)->mtx) argument 196 #define FFEC_UNLOCK(sc) mtx_unlock(&(sc)->mtx) argument 197 #define FFEC_LOCK_INIT(sc) mtx_init(&(sc)->mtx, \ argument 198 device_get_nameunit((sc)->dev), MTX_NETWORK_LOCK, MTX_DEF) 199 #define FFEC_LOCK_DESTROY(sc) mtx_destroy(&(sc)->mtx); argument 200 #define FFEC_ASSERT_LOCKED(sc) mtx_assert(&(sc)->mtx, MA_OWNED); argument 201 #define FFEC_ASSERT_UNLOCKED(sc) mtx_assert(&(sc)->mtx, MA_NOTOWNED); argument 203 static void ffec_init_locked(struct ffec_softc *sc); 204 static void ffec_stop_locked(struct ffec_softc *sc); 205 static void ffec_txstart_locked(struct ffec_softc *sc); [all …]
|
| /freebsd-11-stable/sys/dev/cfi/ |
| HD | cfi_core.c | 67 cfi_read_raw(struct cfi_softc *sc, u_int ofs) in cfi_read_raw() argument 71 ofs &= ~(sc->sc_width - 1); in cfi_read_raw() 72 switch (sc->sc_width) { in cfi_read_raw() 74 val = bus_space_read_1(sc->sc_tag, sc->sc_handle, ofs); in cfi_read_raw() 77 val = bus_space_read_2(sc->sc_tag, sc->sc_handle, ofs); in cfi_read_raw() 80 val = bus_space_read_4(sc->sc_tag, sc->sc_handle, ofs); in cfi_read_raw() 90 cfi_read(struct cfi_softc *sc, u_int ofs) in cfi_read() argument 95 ofs &= ~(sc->sc_width - 1); in cfi_read() 96 switch (sc->sc_width) { in cfi_read() 98 val = bus_space_read_1(sc->sc_tag, sc->sc_handle, ofs); in cfi_read() [all …]
|
| /freebsd-11-stable/sys/dev/ie/ |
| HD | if_ie.c | 247 ee16_shutdown(struct ie_softc *sc) in ee16_shutdown() argument 250 ee16_reset_586(sc); in ee16_shutdown() 251 outb(PORT(sc) + IEE16_ECTRL, IEE16_RESET_ASIC); in ee16_shutdown() 252 outb(PORT(sc) + IEE16_ECTRL, 0); in ee16_shutdown() 261 struct ie_softc * sc; in ie_attach() local 266 sc = device_get_softc(dev); in ie_attach() 267 ifp = sc->ifp = if_alloc(IFT_ETHER); in ie_attach() 269 device_printf(sc->dev, "can not if_alloc()\n"); in ie_attach() 273 sc->dev = dev; in ie_attach() 274 mtx_init(&sc->lock, device_get_nameunit(dev), MTX_NETWORK_LOCK, in ie_attach() [all …]
|
| /freebsd-11-stable/sys/dev/ep/ |
| HD | if_ep.c | 112 #define EP_FTST(sc, f) (sc->stat & (f)) argument 113 #define EP_FSET(sc, f) (sc->stat |= (f)) argument 114 #define EP_FRST(sc, f) (sc->stat &= ~(f)) argument 117 eeprom_rdy(struct ep_softc *sc) in eeprom_rdy() argument 121 for (i = 0; is_eeprom_busy(sc) && i < MAX_EEPROMBUSY; i++) in eeprom_rdy() 125 device_printf(sc->dev, "eeprom failed to come ready.\n"); in eeprom_rdy() 137 ep_get_e(struct ep_softc *sc, uint16_t offset, uint16_t *result) in ep_get_e() argument 140 if (eeprom_rdy(sc)) in ep_get_e() 143 CSR_WRITE_2(sc, EP_W0_EEPROM_COMMAND, in ep_get_e() 144 (EEPROM_CMD_RD << sc->epb.cmd_off) | offset); in ep_get_e() [all …]
|
| /freebsd-11-stable/sys/dev/patm/ |
| HD | if_patm.c | 77 static void patm_tst_init(struct patm_softc *sc); 78 static void patm_scd_init(struct patm_softc *sc); 84 patm_initialize(struct patm_softc *sc) in patm_initialize() argument 89 patm_debug(sc, ATTACH, "configuring..."); in patm_initialize() 92 for (i = 0; i < sc->mmap->sram * 1024; i += 4) in patm_initialize() 93 patm_sram_write4(sc, i, 0, 0, 0, 0); in patm_initialize() 94 patm_scd_init(sc); in patm_initialize() 98 /* IDT_CFG_NOIDLE | */ sc->mmap->rxtab; in patm_initialize() 99 if (!(sc->flags & PATM_UNASS)) in patm_initialize() 101 patm_nor_write(sc, IDT_NOR_CFG, cfg); in patm_initialize() [all …]
|