/freebsd/sys/dev/mlx4/mlx4_core/ |
H A D | mlx4_resource_tracker.c | 17 * - Redistributions of source code must retain the above 21 * - Redistributions in binary form must reproduce the above 42 #include <dev/mlx4/cmd.h> 43 #include <dev/mlx4/qp.h> 226 /* > 0 --> apply mirror when getting into HA mode */ 227 /* = 0 --> un-apply mirror when getting out of HA mode */ 235 struct rb_node *node = root->rb_node; in res_tracker_lookup() 241 if (res_id < res->res_id) in res_tracker_lookup() 242 node = node->rb_left; in res_tracker_lookup() 243 else if (res_id > res->res_id) in res_tracker_lookup() [all …]
|
H A D | mlx4_cmd.c | 16 * - Redistributions of source code must retain the above 20 * - Redistributions in binary form must reproduce the above 42 #include <dev/mlx4/cmd.h> 43 #include <dev/mlx4/device.h> 135 static int mlx4_master_process_vhcr(struct mlx4_dev *dev, int slave, 141 [CMD_STAT_INTERNAL_ERR] = -EIO, in mlx4_status_to_errno() 142 [CMD_STAT_BAD_OP] = -EPERM, in mlx4_status_to_errno() 143 [CMD_STAT_BAD_PARAM] = -EINVAL, in mlx4_status_to_errno() 144 [CMD_STAT_BAD_SYS_STATE] = -ENXIO, in mlx4_status_to_errno() 145 [CMD_STAT_BAD_RESOURCE] = -EBADF, in mlx4_status_to_errno() [all …]
|
H A D | mlx4_eq.c | 15 * - Redistributions of source code must retain the above 19 * - Redistributions in binary form must reproduce the above 38 #include <linux/dma-mapping.h> 41 #include <dev/mlx4/cmd.h> 86 static u64 get_async_ev_mask(struct mlx4_dev *dev) in get_async_ev_mask() argument 89 if (dev->caps.flags & MLX4_DEV_CAP_FLAG_PORT_MNG_CHG_EV) in get_async_ev_mask() 91 if (dev->caps.flags2 & MLX4_DEV_CAP_FLAG2_RECOVERABLE_ERROR_EVENT) in get_async_ev_mask() 99 __raw_writel((__force u32) cpu_to_be32((eq->cons_index & 0xffffff) | in eq_set_ci() 101 eq->doorbell); in eq_set_ci() 109 /* (entry & (eq->nent - 1)) gives us a cyclic array */ in get_eqe() [all …]
|
H A D | mlx4.h | 18 * - Redistributions of source code must retain the above 22 * - Redistributions in binary form must reproduce the above 41 #include <linux/radix-tree.h> 48 #include <dev/mlx4/device.h> 49 #include <dev/mlx4/driver.h> 50 #include <dev/mlx4/doorbell.h> 51 #include <dev/mlx4/cmd.h> 52 #include <dev/mlx4/mlx4_core/fw_qos.h> 86 MLX4_MAX_QP_PER_MGM = 4 * ((1 << MLX4_MAX_MGM_LOG_ENTRY_SIZE) / 16 - 2), 133 /*The flag indicates that the slave should delay the RESET cmd*/ [all …]
|
H A D | mlx4_port.c | 14 * - Redistributions of source code must retain the above 18 * - Redistributions in binary form must reproduce the above 40 #include <dev/mlx4/cmd.h> 46 #include <dev/mlx4/stats.h> 62 void mlx4_init_mac_table(struct mlx4_dev *dev, struct mlx4_mac_table *table) in mlx4_init_mac_table() argument 66 mutex_init(&table->mutex); in mlx4_init_mac_table() 68 table->entries[i] = 0; in mlx4_init_mac_table() 69 table->refs[i] = 0; in mlx4_init_mac_table() 70 table->is_dup[i] = false; in mlx4_init_mac_table() 72 table->max = 1 << dev->caps.log_num_macs; in mlx4_init_mac_table() [all …]
|
/freebsd/sys/dev/iicbus/ |
H A D | iicsmb.c | 1 /*- 2 * SPDX-License-Identifier: BSD-2-Clause 57 #include <dev/iicbus/iiconf.h> 58 #include <dev/iicbus/iicbus.h> 60 #include <dev/smbus/smb.h> 61 #include <dev/smbus/smbconf.h> 74 u_char devaddr; /* slave device address */ 88 static int iicsmb_intr(device_t dev, int event, char *buf); 89 static int iicsmb_callback(device_t dev, int index, void *data); 90 static int iicsmb_quick(device_t dev, u_char slave, int how); [all …]
|
H A D | iiconf.c | 1 /*- 2 * SPDX-License-Identifier: BSD-2-Clause 37 #include <dev/iicbus/iiconf.h> 38 #include <dev/iicbus/iicbus.h> 44 * system errno value later. This lets controller- and bus-layer code get 54 * Translate IIC_Exxxxx status values to vaguely-equivelent errno values. 75 * IIC_ERRNO marker bit. If lots of high-order bits are set, in iic2errno() 76 * then it's one of the negative pseudo-errors such as ERESTART in iic2errno() 77 * and we return it as-is. Otherwise it's a plain "small in iic2errno() 99 if (sc->owner) in iicbus_intr() [all …]
|
H A D | icee.c | 1 /*- 2 * SPDX-License-Identifier: BSD-2-Clause 47 #include <dev/ofw/ofw_bus.h> 48 #include <dev/ofw/ofw_bus_subr.h> 51 #include <dev/iicbus/iiconf.h> 52 #include <dev/iicbus/iicbus.h> 57 * AT24 parts have a "write page size" that differs per-device, and a "read page 66 device_t dev; /* Myself */ member 68 int addr; /* Slave address on the bus */ 112 #define CDEV2SOFTC(dev) ((dev)->si_drv1) argument [all …]
|
H A D | acpi_iicbus.c | 1 /*- 2 * SPDX-License-Identifier: BSD-2-Clause 4 * Copyright (c) 2019-2020 Vladimir Kondratyev <wulf@FreeBSD.org> 39 #include <contrib/dev/acpica/include/acpi.h> 40 #include <contrib/dev/acpica/include/accommon.h> 41 #include <contrib/dev/acpica/include/amlcode.h> 42 #include <dev/acpica/acpivar.h> 44 #include <dev/iicbus/iiconf.h> 45 #include <dev/iicbus/iicbus.h> 85 return (res->Type == ACPI_RESOURCE_TYPE_SERIAL_BUS && in acpi_resource_is_i2c_serialbus() [all …]
|
/freebsd/sys/dev/mlx4/mlx4_ib/ |
H A D | mlx4_ib_mad.c | 14 * - Redistributions of source code must retain the above 18 * - Redistributions in binary form must reproduce the above 39 #include <dev/mlx4/cmd.h> 40 #include <dev/mlx4/driver.h> 61 #define GET_BLK_PTR_FROM_EQE(eqe) be32_to_cpu(eqe->event.port_mgmt_change.params.tbl_change_info.bl… 62 #define GET_MASK_FROM_EQE(eqe) be32_to_cpu(eqe->event.port_mgmt_change.params.tbl_change_info.tbl_e… 89 static void handle_client_rereg_event(struct mlx4_ib_dev *dev, u8 port_num); 90 static void handle_lid_change_event(struct mlx4_ib_dev *dev, u8 port_num); 91 static void __propagate_pkey_ev(struct mlx4_ib_dev *dev, int port_num, 102 return cpu_to_be64(atomic_inc_return(&ctx->tid)) | in mlx4_ib_get_new_demux_tid() [all …]
|
H A D | mlx4_ib_sysfs.c | 14 * - Redistributions of source code must retain the above 18 * - Redistributions in binary form must reproduce the above 42 * 0 - requests opensm to assign a value. 43 * ffffffffffffffff - delete this entry. 44 * other - value assigned by administrator. 46 static ssize_t show_admin_alias_guid(struct device *dev, in show_admin_alias_guid() argument 51 struct mlx4_ib_iov_port *port = mlx4_ib_iov_dentry->ctx; in show_admin_alias_guid() 52 struct mlx4_ib_dev *mdev = port->dev; in show_admin_alias_guid() 55 sysadmin_ag_val = mlx4_get_admin_guid(mdev->dev, in show_admin_alias_guid() 56 mlx4_ib_iov_dentry->entry_num, in show_admin_alias_guid() [all …]
|
/freebsd/sys/dev/nfsmb/ |
H A D | nfsmb.c | 1 /*- 39 #include <dev/pci/pcivar.h> 40 #include <dev/pci/pcireg.h> 42 #include <dev/smbus/smbconf.h> 100 #define SMB_STS_PEC 0x1F /* PEC (CRC-8) Error */ 121 #define NFSMB_LOCK(nfsmb) mtx_lock(&(nfsmb)->lock) 122 #define NFSMB_UNLOCK(nfsmb) mtx_unlock(&(nfsmb)->lock) 123 #define NFSMB_LOCK_ASSERT(nfsmb) mtx_assert(&(nfsmb)->lock, MA_OWNED) 126 (bus_read_1(nfsmb->res, register)) 128 (bus_write_1(nfsmb->res, register, value)) [all …]
|
/freebsd/sys/dev/alpm/ |
H A D | alpm.c | 1 /*- 43 #include <dev/pci/pcivar.h> 44 #include <dev/pci/pcireg.h> 46 #include <dev/smbus/smbconf.h> 60 * I/O registers offsets - the base address is programmed via the 63 #define SMBSTS 0x0 /* SMBus host/slave status register */ 64 #define SMBCMD 0x1 /* SMBus host/slave command register */ 130 #define ALPM_LOCK(alpm) mtx_lock(&(alpm)->lock) 131 #define ALPM_UNLOCK(alpm) mtx_unlock(&(alpm)->lock) 132 #define ALPM_LOCK_ASSERT(alpm) mtx_assert(&(alpm)->lock, MA_OWNED) [all …]
|
/freebsd/sys/dev/ichsmb/ |
H A D | ichsmb.c | 1 /*- 23 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. 61 #include <dev/smbus/smbconf.h> 63 #include <dev/ichsmb/ichsmb_var.h> 64 #include <dev/ichsmb/ichsmb_reg.h> 67 * Enable debugging by defining ICHSMB_DEBUG to a non-zero value. 88 BUS-INDEPENDENT BUS METHODS 92 * Handle probe-time duties that are independent of the bus 96 ichsmb_probe(device_t dev) in ichsmb_probe() argument 102 * Handle attach-time duties that are independent of the bus [all …]
|
/freebsd/sys/dev/amdsmb/ |
H A D | amdsmb.c | 1 /*- 39 #include <dev/pci/pcivar.h> 40 #include <dev/pci/pcireg.h> 42 #include <dev/smbus/smbconf.h> 94 #define SMB_STS_PEC 0x1f /* PEC (CRC-8) Error */ 114 #define AMDSMB_LOCK(amdsmb) mtx_lock(&(amdsmb)->lock) 115 #define AMDSMB_UNLOCK(amdsmb) mtx_unlock(&(amdsmb)->lock) 116 #define AMDSMB_LOCK_ASSERT(amdsmb) mtx_assert(&(amdsmb)->lock, MA_OWNED) 119 (bus_read_1(amdsmb->res, register)) 121 (bus_write_1(amdsmb->res, register, value)) [all …]
|
/freebsd/sys/dev/amdpm/ |
H A D | amdpm.c | 1 /*- 47 #include <dev/pci/pcivar.h> 48 #include <dev/pci/pcireg.h> 50 #include <dev/smbus/smbconf.h> 129 #define AMDPM_LOCK(amdpm) mtx_lock(&(amdpm)->lock) 130 #define AMDPM_UNLOCK(amdpm) mtx_unlock(&(amdpm)->lock) 131 #define AMDPM_LOCK_ASSERT(amdpm) mtx_assert(&(amdpm)->lock, MA_OWNED) 134 (bus_read_1(amdpm->res, register)) 136 (bus_write_1(amdpm->res, register, value)) 138 (bus_read_2(amdpm->res, register)) [all …]
|
/freebsd/sys/dev/imcsmb/ |
H A D | imcsmb.c | 1 /*- 2 * SPDX-License-Identifier: BSD-2-Clause 6 * Copyright (c) 2017-2018 Panasas 46 #include <dev/pci/pcivar.h> 47 #include <dev/pci/pcireg.h> 49 #include <dev/smbus/smbconf.h> 55 static int imcsmb_attach(device_t dev); 56 static int imcsmb_probe(device_t dev); 59 static int imcsmb_callback(device_t dev, int index, void *data); 60 static int imcsmb_readb(device_t dev, u_char slave, char cmd, char *byte); [all …]
|
/freebsd/sys/dev/intpm/ |
H A D | intpm.c | 1 /*- 36 #include <dev/smbus/smbconf.h> 40 #include <dev/pci/pcireg.h> 41 #include <dev/pci/pcivar.h> 42 #include <dev/intpm/intpmreg.h> 43 #include <dev/amdsbwd/amd_chipset.h> 48 device_t dev; member 62 #define INTSMB_LOCK(sc) mtx_lock(&(sc)->lock) 63 #define INTSMB_UNLOCK(sc) mtx_unlock(&(sc)->lock) 64 #define INTSMB_LOCK_ASSERT(sc) mtx_assert(&(sc)->lock, MA_OWNED) [all …]
|
/freebsd/sys/dev/viapm/ |
H A D | viapm.c | 1 /*- 2 * Copyright (c) 2001 Alcove - Nicolas Souchu 46 #include <dev/pci/pcivar.h> 47 #include <dev/pci/pcireg.h> 49 #include <dev/iicbus/iiconf.h> 51 #include <dev/smbus/smbconf.h> 75 ((u_char)bus_read_1(viapm->iores, port)) 77 (bus_write_1(viapm->iores, port, (u_char)(val))) 86 #define VIAPM_LOCK(sc) mtx_lock(&(sc)->lock) 87 #define VIAPM_UNLOCK(sc) mtx_unlock(&(sc)->lock) [all …]
|
/freebsd/sys/dev/iicbus/controller/opencores/ |
H A D | iicoc.c | 1 /*- 2 * SPDX-License-Identifier: BSD-2-Clause 4 * Copyright (c) 2003-2012 Broadcom Corporation 42 #include <dev/iicbus/iicbus.h> 43 #include <dev/iicbus/iiconf.h> 51 iicoc_dev_write(device_t dev, int reg, int value) in iicoc_dev_write() argument 55 sc = device_get_softc(dev); in iicoc_dev_write() 56 bus_write_1(sc->mem_res, reg<<sc->reg_shift, value); in iicoc_dev_write() 60 iicoc_dev_read(device_t dev, int reg) in iicoc_dev_read() argument 65 sc = device_get_softc(dev); in iicoc_dev_read() [all …]
|
/freebsd/sys/arm/freescale/imx/ |
H A D | imx_i2c.c | 1 /*- 2 * Copyright (C) 2008-2009 Semihalf, Michal Hajduk 35 * Note that the hardware is capable of running as both a master and a slave. 36 * This driver currently implements only master-mode operations. 38 * This driver supports multi-master i2c buses, by detecting bus arbitration 41 * transfer cycles resulting in arbitration loss in mid-transfer. The caller 42 * must handle retries in a way that makes sense for the slave being addressed. 61 #include <dev/iicbus/iiconf.h> 62 #include <dev/iicbus/iicbus.h> 63 #include <dev/iicbus/iic_recover_bus.h> [all …]
|
/freebsd/sys/dev/smbus/ |
H A D | smbus_if.m | 1 #- 36 device_t dev; 47 device_t dev; 56 device_t dev; 57 u_char slave; 65 device_t dev; 66 u_char slave; 74 device_t dev; 75 u_char slave; 83 device_t dev; [all …]
|
H A D | smb.c | 1 /*- 2 * SPDX-License-Identifier: BSD-2-Clause 40 #include <dev/smbus/smbconf.h> 41 #include <dev/smbus/smbus.h> 42 #include <dev/smbus/smb.h> 61 int slave; member 129 if (device_find_child(parent, "smb", - in smb_identify() 134 smb_probe(device_t dev) smb_probe() argument 144 smb_attach(device_t dev) smb_attach() argument 165 smb_detach(device_t dev) smb_detach() argument 190 smbioctl(struct cdev * dev,u_long cmd,caddr_t data,int flags,struct thread * td) smbioctl() argument [all...] |
/freebsd/sys/dev/ismt/ |
H A D | ismt.c | 1 /*- 45 #include <dev/pci/pcireg.h> 46 #include <dev/pci/pcivar.h> 47 #include <dev/smbus/smbconf.h> 53 /* Hardware Descriptor Constants - Control Field */ 62 /* Hardware Descriptor Constants - Status Field */ 182 val = bus_read_4(sc->mmio_res, ISMT_MSTR_MSTS); in ismt_intr() 183 ISMT_DEBUG(sc->pcidev, "%s MSTS=0x%x\n", __func__, val); in ismt_intr() 186 bus_write_4(sc->mmio_res, ISMT_MSTR_MSTS, val); in ismt_intr() 192 ismt_callback(device_t dev, int index, void *data) in ismt_callback() argument [all …]
|
/freebsd/contrib/netbsd-tests/kernel/tty/ |
H A D | t_pr.c | 3 /*- 36 #include <atf-c.h> 72 exercise_ptytty(int master, int slave) in exercise_ptytty() argument 77 * send a few bytes from master to slave and read them back in exercise_ptytty() 79 error = sendsome(master, slave); in exercise_ptytty() 89 error = sendsome(slave, master); in exercise_ptytty() 108 int master, slave, error, v; in ATF_TC_BODY() local 111 slave = rump_sys_open("/dev/ttyp1", O_RDWR|O_NONBLOCK); in ATF_TC_BODY() 112 ATF_CHECK(slave != -1); in ATF_TC_BODY() 114 master = rump_sys_open("/dev/ptyp1", O_RDWR); in ATF_TC_BODY() [all …]
|