Home
last modified time | relevance | path

Searched full:sc (Results 1 – 25 of 2813) sorted by relevance

12345678910>>...113

/freebsd/sys/dev/iicbus/controller/twsi/
H A Dtwsi.c86 #define debugf(sc, fmt, args...) if ((sc)->debug) \ argument
87 device_printf((sc)->dev, "%s: " fmt, __func__, ##args)
96 TWSI_READ(struct twsi_softc *sc, bus_size_t off) in TWSI_READ() argument
100 val = bus_read_4(sc->res[0], off); in TWSI_READ()
101 if (sc->debug > 1) in TWSI_READ()
102 debugf(sc, "read %x from %lx\n", val, off); in TWSI_READ()
107 TWSI_WRITE(struct twsi_softc *sc, bus_size_t off, uint32_t val) in TWSI_WRITE() argument
110 if (sc->debug > 1) in TWSI_WRITE()
111 debugf(sc, "Writing %x to %lx\n", val, off); in TWSI_WRITE()
112 bus_write_4(sc->res[0], off, val); in TWSI_WRITE()
[all …]
/freebsd/sys/dev/tws/
H A Dtws.c52 extern int tws_cam_attach(struct tws_softc *sc);
53 extern void tws_cam_detach(struct tws_softc *sc);
54 extern int tws_init_ctlr(struct tws_softc *sc);
55 extern boolean tws_ctlr_ready(struct tws_softc *sc);
56 extern void tws_turn_off_interrupts(struct tws_softc *sc);
57 extern void tws_q_insert_tail(struct tws_softc *sc, struct tws_request *req,
59 extern struct tws_request *tws_q_remove_request(struct tws_softc *sc,
61 extern struct tws_request *tws_q_remove_head(struct tws_softc *sc,
63 extern boolean tws_get_response(struct tws_softc *sc, u_int16_t *req_id);
64 extern boolean tws_ctlr_reset(struct tws_softc *sc);
[all …]
/freebsd/sys/dev/smc/
H A Dif_smc.c83 #define SMC_LOCK(sc) mtx_lock(&(sc)->smc_mtx) argument
84 #define SMC_UNLOCK(sc) mtx_unlock(&(sc)->smc_mtx) argument
85 #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/sys/dev/cadence/
H A Dif_cgem.c220 #define RD4(sc, off) (bus_read_4((sc)->mem_res, (off))) argument
221 #define WR4(sc, off, val) (bus_write_4((sc)->mem_res, (off), (val))) argument
222 #define BARRIER(sc, off, len, flags) \ argument
223 (bus_barrier((sc)->mem_res, (off), (len), (flags))
225 #define CGEM_LOCK(sc) mtx_lock(&(sc)->sc_mtx) argument
226 #define CGEM_UNLOCK(sc) mtx_unlock(&(sc)->sc_mtx) argument
227 #define CGEM_LOCK_INIT(sc) mtx_init(&(sc)->sc_mtx, \ argument
228 device_get_nameunit((sc)->dev), MTX_NETWORK_LOCK, MTX_DEF)
229 #define CGEM_LOCK_DESTROY(sc) mtx_destroy(&(sc)->sc_mtx) argument
230 #define CGEM_ASSERT_LOCKED(sc) mtx_assert(&(sc)->sc_mtx, MA_OWNED) argument
[all …]
/freebsd/sys/dev/rtsx/
H A Drtsx.c88 void (*rtsx_intr_trans_ok)(struct rtsx_softc *sc);
90 void (*rtsx_intr_trans_ko)(struct rtsx_softc *sc);
201 static int rtsx_dma_alloc(struct rtsx_softc *sc);
203 static void rtsx_dma_free(struct rtsx_softc *sc);
205 static void rtsx_handle_card_present(struct rtsx_softc *sc);
207 static bool rtsx_is_card_present(struct rtsx_softc *sc);
208 static int rtsx_init(struct rtsx_softc *sc);
210 static int rtsx_rts5227_fill_driving(struct rtsx_softc *sc);
211 static int rtsx_rts5249_fill_driving(struct rtsx_softc *sc);
212 static int rtsx_rts5260_fill_driving(struct rtsx_softc *sc);
[all …]
/freebsd/sys/dev/mpi3mr/
H A Dmpi3mr.c79 static void mpi3mr_repost_reply_buf(struct mpi3mr_softc *sc,
81 static int mpi3mr_complete_admin_cmd(struct mpi3mr_softc *sc);
82 static void mpi3mr_port_enable_complete(struct mpi3mr_softc *sc,
84 static void mpi3mr_flush_io(struct mpi3mr_softc *sc);
85 static int mpi3mr_issue_reset(struct mpi3mr_softc *sc, U16 reset_type,
87 static void mpi3mr_dev_rmhs_send_tm(struct mpi3mr_softc *sc, U16 handle,
89 static void mpi3mr_dev_rmhs_complete_iou(struct mpi3mr_softc *sc,
91 static void mpi3mr_dev_rmhs_complete_tm(struct mpi3mr_softc *sc,
93 static void mpi3mr_send_evt_ack(struct mpi3mr_softc *sc, U8 event,
95 static void mpi3mr_print_fault_info(struct mpi3mr_softc *sc);
[all …]
/freebsd/contrib/bsnmp/tests/
H A Dsnmp_parse_server.cc15 try_parse(struct snmp_client *sc, const char *str) in try_parse() argument
17 const int r = snmp_parse_server(sc, str); in try_parse()
19 std::cout << "snmp_parse_server: " << sc->error << "\n"; in try_parse()
25 struct snmp_client sc; variable
26 snmp_client_init(&sc);
28 REQUIRE(try_parse(&sc, "") == 0);
29 REQUIRE(sc.trans == SNMP_TRANS_UDP);
30 REQUIRE(sc.chost == ""s);
31 REQUIRE(sc.cport == "snmp"s);
32 REQUIRE(sc.read_community == "public"s);
[all …]
/freebsd/sys/dev/mrsas/
H A Dmrsas.c66 static int mrsas_setup_msix(struct mrsas_softc *sc);
67 static int mrsas_allocate_msix(struct mrsas_softc *sc);
68 static void mrsas_shutdown_ctlr(struct mrsas_softc *sc, u_int32_t opcode);
69 static void mrsas_flush_cache(struct mrsas_softc *sc);
70 static void mrsas_reset_reply_desc(struct mrsas_softc *sc);
72 static int mrsas_get_map_info(struct mrsas_softc *sc);
73 static int mrsas_get_ld_map_info(struct mrsas_softc *sc);
74 static int mrsas_sync_map_info(struct mrsas_softc *sc);
75 static int mrsas_get_pd_list(struct mrsas_softc *sc);
76 static int mrsas_get_ld_list(struct mrsas_softc *sc);
[all …]
/freebsd/sys/dev/ae/
H A Dif_ae.c104 static void ae_pcie_init(ae_softc_t *sc);
105 static void ae_phy_reset(ae_softc_t *sc);
106 static void ae_phy_init(ae_softc_t *sc);
107 static int ae_reset(ae_softc_t *sc);
109 static int ae_init_locked(ae_softc_t *sc);
116 static void ae_retrieve_address(ae_softc_t *sc);
119 static int ae_alloc_rings(ae_softc_t *sc);
120 static void ae_dma_free(ae_softc_t *sc);
123 static void ae_powersave_disable(ae_softc_t *sc);
124 static void ae_powersave_enable(ae_softc_t *sc);
[all …]
/freebsd/sys/dev/hdmi/
H A Ddwc_hdmi.c73 dwc_hdmi_phy_wait_i2c_done(struct dwc_hdmi_softc *sc, int msec) in dwc_hdmi_phy_wait_i2c_done() argument
77 val = RD1(sc, HDMI_IH_I2CMPHY_STAT0) & in dwc_hdmi_phy_wait_i2c_done()
84 val = RD1(sc, HDMI_IH_I2CMPHY_STAT0) & in dwc_hdmi_phy_wait_i2c_done()
90 dwc_hdmi_phy_i2c_write(struct dwc_hdmi_softc *sc, unsigned short data, in dwc_hdmi_phy_i2c_write() argument
95 WR1(sc, HDMI_IH_I2CMPHY_STAT0, in dwc_hdmi_phy_i2c_write()
97 WR1(sc, HDMI_PHY_I2CM_ADDRESS_ADDR, addr); in dwc_hdmi_phy_i2c_write()
98 WR1(sc, HDMI_PHY_I2CM_DATAO_1_ADDR, ((data >> 8) & 0xff)); in dwc_hdmi_phy_i2c_write()
99 WR1(sc, HDMI_PHY_I2CM_DATAO_0_ADDR, ((data >> 0) & 0xff)); in dwc_hdmi_phy_i2c_write()
100 WR1(sc, HDMI_PHY_I2CM_OPERATION_ADDR, HDMI_PHY_I2CM_OPERATION_ADDR_WRITE); in dwc_hdmi_phy_i2c_write()
101 dwc_hdmi_phy_wait_i2c_done(sc, 1000); in dwc_hdmi_phy_i2c_write()
[all …]
/freebsd/sys/dev/oce/
H A Doce_hw.c44 static int oce_POST(POCE_SOFTC sc);
48 * @param sc software handle to the device
51 oce_POST(POCE_SOFTC sc) in oce_POST() argument
57 post_status.dw0 = OCE_READ_CSR_MPU(sc, csr, MPU_EP_SEMAPHORE(sc)); in oce_POST()
62 OCE_WRITE_CSR_MPU(sc, csr, MPU_EP_SEMAPHORE(sc), post_status.dw0); in oce_POST()
72 post_status.dw0 = OCE_READ_CSR_MPU(sc, csr, MPU_EP_SEMAPHORE(sc)); in oce_POST()
74 device_printf(sc->dev, in oce_POST()
82 device_printf(sc->dev, "POST timed out: %x\n", post_status.dw0); in oce_POST()
89 * @param sc software handle to the device
92 oce_hw_init(POCE_SOFTC sc) in oce_hw_init() argument
[all …]
/freebsd/sys/dev/vmware/pvscsi/
H A Dpvscsi.c57 static inline uint32_t pvscsi_reg_read(struct pvscsi_softc *sc,
59 static inline void pvscsi_reg_write(struct pvscsi_softc *sc, uint32_t offset,
61 static inline uint32_t pvscsi_read_intr_status(struct pvscsi_softc *sc);
62 static inline void pvscsi_write_intr_status(struct pvscsi_softc *sc,
64 static inline void pvscsi_intr_enable(struct pvscsi_softc *sc);
65 static inline void pvscsi_intr_disable(struct pvscsi_softc *sc);
66 static void pvscsi_kick_io(struct pvscsi_softc *sc, uint8_t cdb0);
67 static void pvscsi_write_cmd(struct pvscsi_softc *sc, uint32_t cmd, void *data,
69 static uint32_t pvscsi_get_max_targets(struct pvscsi_softc *sc);
70 static int pvscsi_setup_req_call(struct pvscsi_softc *sc, uint32_t enable);
[all …]
/freebsd/sys/dev/bge/
H A Dif_bge.c363 #define BGE_IS_JUMBO_CAPABLE(sc) ((sc)->bge_flags & BGE_FLAG_JUMBO) argument
364 #define BGE_IS_5700_FAMILY(sc) ((sc)->bge_flags & BGE_FLAG_5700_FAMILY) argument
365 #define BGE_IS_5705_PLUS(sc) ((sc)->bge_flags & BGE_FLAG_5705_PLUS) argument
366 #define BGE_IS_5714_FAMILY(sc) ((sc)->bge_flags & BGE_FLAG_5714_FAMILY) argument
367 #define BGE_IS_575X_PLUS(sc) ((sc)->bge_flags & BGE_FLAG_575X_PLUS) argument
368 #define BGE_IS_5755_PLUS(sc) ((sc)->bge_flags & BGE_FLAG_5755_PLUS) argument
369 #define BGE_IS_5717_PLUS(sc) ((sc)->bge_flags & BGE_FLAG_5717_PLUS) argument
370 #define BGE_IS_57765_PLUS(sc) ((sc)->bge_flags & BGE_FLAG_57765_PLUS) argument
393 static int bge_get_eaddr_fw(struct bge_softc *sc, uint8_t ether_addr[]);
546 bge_has_eaddr(struct bge_softc *sc) in bge_has_eaddr() argument
[all …]
/freebsd/sys/dev/cyapa/
H A Dcyapa.c214 struct cyapa_softc *sc; member
220 static int cyapa_raw_input(struct cyapa_softc *sc, struct cyapa_regs *regs,
222 static void cyapa_set_power_mode(struct cyapa_softc *sc, int mode);
224 static int fifo_empty(struct cyapa_softc *sc, struct cyapa_fifo *fifo);
225 static size_t fifo_ready(struct cyapa_softc *sc, struct cyapa_fifo *fifo);
226 static char *fifo_read(struct cyapa_softc *sc, struct cyapa_fifo *fifo,
228 static char *fifo_write(struct cyapa_softc *sc, struct cyapa_fifo *fifo,
230 static uint8_t fifo_read_char(struct cyapa_softc *sc,
232 static void fifo_write_char(struct cyapa_softc *sc, struct cyapa_fifo *fifo,
234 static size_t fifo_space(struct cyapa_softc *sc, struct cyapa_fifo *fifo);
[all …]
/freebsd/sys/powerpc/powermac/
H A Dcuda.c76 static void cuda_send_inbound(struct cuda_softc *sc);
77 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/sys/dev/eqos/
H A Dif_eqos.c93 #define EQOS_LOCK(sc) mtx_lock(&(sc)->lock) argument
94 #define EQOS_UNLOCK(sc) mtx_unlock(&(sc)->lock) argument
95 #define EQOS_ASSERT_LOCKED(sc) mtx_assert(&(sc)->lock, MA_OWNED) argument
97 #define RD4(sc, o) bus_read_4(sc->res[EQOS_RES_MEM], (o)) argument
98 #define WR4(sc, o, v) bus_write_4(sc->res[EQOS_RES_MEM], (o), (v)) argument
113 struct eqos_softc *sc = device_get_softc(dev); in eqos_miibus_readreg() local
117 addr = sc->csr_clock_range | in eqos_miibus_readreg()
121 WR4(sc, GMAC_MAC_MDIO_ADDRESS, addr); in eqos_miibus_readreg()
126 addr = RD4(sc, GMAC_MAC_MDIO_ADDRESS); in eqos_miibus_readreg()
128 val = RD4(sc, GMAC_MAC_MDIO_DATA) & 0xFFFF; in eqos_miibus_readreg()
[all …]
/freebsd/sys/dev/cfi/
H A Dcfi_core.c65 cfi_read_raw(struct cfi_softc *sc, u_int ofs) in cfi_read_raw() argument
69 ofs &= ~(sc->sc_width - 1); in cfi_read_raw()
70 switch (sc->sc_width) { in cfi_read_raw()
72 val = bus_space_read_1(sc->sc_tag, sc->sc_handle, ofs); in cfi_read_raw()
75 val = bus_space_read_2(sc->sc_tag, sc->sc_handle, ofs); in cfi_read_raw()
78 val = bus_space_read_4(sc->sc_tag, sc->sc_handle, ofs); in cfi_read_raw()
88 cfi_read(struct cfi_softc *sc, u_int ofs) in cfi_read() argument
93 ofs &= ~(sc->sc_width - 1); in cfi_read()
94 switch (sc->sc_width) { in cfi_read()
96 val = bus_space_read_1(sc->sc_tag, sc->sc_handle, ofs); in cfi_read()
[all …]
/freebsd/sys/dev/xilinx/
H A Dif_xae.c78 #define XAE_LOCK(sc) mtx_lock(&(sc)->mtx) argument
79 #define XAE_UNLOCK(sc) mtx_unlock(&(sc)->mtx) argument
80 #define XAE_ASSERT_LOCKED(sc) mtx_assert(&(sc)->mtx, MA_OWNED) argument
81 #define XAE_ASSERT_UNLOCKED(sc) mtx_assert(&(sc)->mtx, MA_NOTOWNED) argument
98 #define PHY1_RD(sc, _r) \ argument
99 xae_miibus_read_reg(sc->dev, 1, _r)
100 #define PHY1_WR(sc, _r, _v) \ argument
101 xae_miibus_write_reg(sc->dev, 1, _r, _v)
103 #define PHY_RD(sc, _r) \ argument
104 xae_miibus_read_reg(sc->dev, sc->phy_addr, _r)
[all …]
/freebsd/sys/dev/qcom_qup/
H A Dqcom_spi_hw.c65 qcom_spi_hw_read_controller_transfer_sizes(struct qcom_spi_softc *sc) in qcom_spi_hw_read_controller_transfer_sizes() argument
69 reg = QCOM_SPI_READ_4(sc, QUP_IO_M_MODES); in qcom_spi_hw_read_controller_transfer_sizes()
71 QCOM_SPI_DPRINTF(sc, QCOM_SPI_DEBUG_HW_TRANSFER_SETUP, in qcom_spi_hw_read_controller_transfer_sizes()
78 sc->config.input_block_size = 4; in qcom_spi_hw_read_controller_transfer_sizes()
80 sc->config.input_block_size = val * 16; in qcom_spi_hw_read_controller_transfer_sizes()
86 sc->config.output_block_size = 4; in qcom_spi_hw_read_controller_transfer_sizes()
88 sc->config.output_block_size = val * 16; in qcom_spi_hw_read_controller_transfer_sizes()
93 sc->config.input_fifo_size = in qcom_spi_hw_read_controller_transfer_sizes()
94 sc->config.input_block_size * (2 << val); in qcom_spi_hw_read_controller_transfer_sizes()
99 sc->config.output_fifo_size = in qcom_spi_hw_read_controller_transfer_sizes()
[all …]
/freebsd/sys/dev/bxe/
H A Dbxe.c642 static void bxe_cmng_fns_init(struct bxe_softc *sc,
645 static int bxe_get_cmng_fns_mode(struct bxe_softc *sc);
646 static void storm_memset_cmng(struct bxe_softc *sc,
649 static void bxe_set_reset_global(struct bxe_softc *sc);
650 static void bxe_set_reset_in_progress(struct bxe_softc *sc);
651 static uint8_t bxe_reset_is_done(struct bxe_softc *sc,
653 static uint8_t bxe_clear_pf_load(struct bxe_softc *sc);
654 static uint8_t bxe_chk_parity_attn(struct bxe_softc *sc,
657 static void bxe_int_disable(struct bxe_softc *sc);
658 static int bxe_release_leader_lock(struct bxe_softc *sc);
[all …]
/freebsd/sys/arm/allwinner/
H A Daw_mmc.c167 static void aw_mmc_teardown_dma(struct aw_mmc_softc *sc);
206 struct aw_mmc_softc *sc; in aw_mmc_get_tran_settings() local
208 sc = device_get_softc(dev); in aw_mmc_get_tran_settings()
210 cts->host_ocr = sc->aw_host.host_ocr; in aw_mmc_get_tran_settings()
211 cts->host_f_min = sc->aw_host.f_min; in aw_mmc_get_tran_settings()
212 cts->host_f_max = sc->aw_host.f_max; in aw_mmc_get_tran_settings()
213 cts->host_caps = sc->aw_host.caps; in aw_mmc_get_tran_settings()
214 cts->host_max_data = (sc->aw_mmc_conf->dma_xferlen * in aw_mmc_get_tran_settings()
216 memcpy(&cts->ios, &sc->aw_host.ios, sizeof(struct mmc_ios)); in aw_mmc_get_tran_settings()
224 struct aw_mmc_softc *sc; in aw_mmc_set_tran_settings() local
[all …]
/freebsd/sys/dev/etherswitch/mtkswitch/
H A Dmtkswitch_mt7620.c57 mtkswitch_phy_read_locked(struct mtkswitch_softc *sc, int phy, int reg) in mtkswitch_phy_read_locked() argument
61 MTKSWITCH_WRITE(sc, MTKSWITCH_PIAC, PIAC_PHY_ACS_ST | PIAC_MDIO_ST | in mtkswitch_phy_read_locked()
64 while ((data = MTKSWITCH_READ(sc, MTKSWITCH_PIAC)) & PIAC_PHY_ACS_ST); in mtkswitch_phy_read_locked()
72 struct mtkswitch_softc *sc = device_get_softc(dev); in mtkswitch_phy_read() local
78 MTKSWITCH_LOCK_ASSERT(sc, MA_NOTOWNED); in mtkswitch_phy_read()
79 MTKSWITCH_LOCK(sc); in mtkswitch_phy_read()
80 data = mtkswitch_phy_read_locked(sc, phy, reg); in mtkswitch_phy_read()
81 MTKSWITCH_UNLOCK(sc); in mtkswitch_phy_read()
87 mtkswitch_phy_write_locked(struct mtkswitch_softc *sc, int phy, int reg, in mtkswitch_phy_write_locked() argument
91 MTKSWITCH_WRITE(sc, MTKSWITCH_PIAC, PIAC_PHY_ACS_ST | PIAC_MDIO_ST | in mtkswitch_phy_write_locked()
[all …]
/freebsd/sys/dev/tsec/
H A Dif_tsec.c73 static void tsec_dma_ctl(struct tsec_softc *sc, int state);
74 static void tsec_encap(if_t ifp, struct tsec_softc *sc,
76 static void tsec_free_dma(struct tsec_softc *sc);
84 static void tsec_intrs_ctl(struct tsec_softc *sc, int state);
86 static void tsec_init_locked(struct tsec_softc *sc);
88 static void tsec_reset_mac(struct tsec_softc *sc);
89 static void tsec_setfilter(struct tsec_softc *sc);
90 static void tsec_set_mac_address(struct tsec_softc *sc);
93 static void tsec_stop(struct tsec_softc *sc);
95 static void tsec_watchdog(struct tsec_softc *sc);
[all …]
/freebsd/sys/powerpc/ps3/
H A Dif_glc.c67 static void glc_set_multicast(struct glc_softc *sc);
68 static int glc_add_rxbuf(struct glc_softc *sc, int idx);
69 static int glc_add_rxbuf_dma(struct glc_softc *sc, int idx);
70 static int glc_encap(struct glc_softc *sc, struct mbuf **m_head,
119 struct glc_softc *sc; in glc_attach() local
124 sc = device_get_softc(dev); in glc_attach()
126 sc->sc_bus = ps3bus_get_bus(dev); in glc_attach()
127 sc->sc_dev = ps3bus_get_device(dev); in glc_attach()
128 sc->sc_self = dev; in glc_attach()
130 mtx_init(&sc->sc_mtx, device_get_nameunit(dev), MTX_NETWORK_LOCK, in glc_attach()
[all …]
/freebsd/usr.sbin/bhyve/amd64/
H A Dps2mouse.c114 fifo_init(struct ps2mouse_softc *sc) in fifo_init() argument
118 fifo = &sc->fifo; in fifo_init()
123 fifo_reset(struct ps2mouse_softc *sc) in fifo_reset() argument
127 fifo = &sc->fifo; in fifo_reset()
133 fifo_put(struct ps2mouse_softc *sc, uint8_t val) in fifo_put() argument
137 fifo = &sc->fifo; in fifo_put()
146 fifo_get(struct ps2mouse_softc *sc, uint8_t *val) in fifo_get() argument
150 fifo = &sc->fifo; in fifo_get()
162 movement_reset(struct ps2mouse_softc *sc) in movement_reset() argument
164 assert(pthread_mutex_isowned_np(&sc->mtx)); in movement_reset()
[all …]

12345678910>>...113