/haiku/src/add-ons/kernel/drivers/audio/ac97/ |
H A D | ac97.c | 43 bool ac97_reg_is_valid(ac97_dev *dev, uint8 reg); 44 void ac97_amp_enable(ac97_dev *dev, bool onoff); 45 void ac97_dump_capabilities(ac97_dev *dev); 46 void ac97_detect_capabilities(ac97_dev *dev); 47 void ac97_detect_rates(ac97_dev *dev); 48 void ac97_update_register_cache(ac97_dev *dev); 88 static void default_init(ac97_dev *dev); 89 static void ad1819_init(ac97_dev *dev); 90 static void ad1881_init(ac97_dev *dev); 91 static void ad1885_init(ac97_dev *dev); [all …]
|
/haiku/src/add-ons/kernel/drivers/audio/sb16/ |
H A D | sb16_hw.c | 21 hw_codec_write_byte(sb16_dev_t* dev, uint8 value) in hw_codec_write_byte() argument 27 if (!(gISA->read_io_8(dev->port + SB16_CODEC_WRITE_STATUS) & 0x80)) in hw_codec_write_byte() 32 gISA->write_io_8(dev->port + SB16_CODEC_WRITE_DATA, value); in hw_codec_write_byte() 37 hw_codec_read_byte(sb16_dev_t* dev) in hw_codec_read_byte() argument 42 if (gISA->read_io_8(dev->port + SB16_CODEC_READ_STATUS) & 0x80) in hw_codec_read_byte() 47 return gISA->read_io_8(dev->port + SB16_CODEC_READ_DATA); in hw_codec_read_byte() 52 hw_codec_reg_write(sb16_dev_t* dev, uint8 index, uint8 value) in hw_codec_reg_write() argument 55 gISA->write_io_8(dev->port + SB16_MIXER_ADDRESS, index); in hw_codec_reg_write() 56 gISA->write_io_8(dev->port + SB16_MIXER_DATA, value); in hw_codec_reg_write() 61 hw_codec_reg_read(sb16_dev_t* dev, uint8 index) in hw_codec_reg_read() argument [all …]
|
/haiku/src/add-ons/kernel/bus_managers/ps2/ |
H A D | ps2_dev.cpp | 40 ps2_reset_mouse(ps2_dev* dev) in ps2_reset_mouse() argument 47 status = ps2_dev_command(dev, PS2_CMD_RESET, NULL, 0, data, 2); in ps2_reset_mouse() 54 status = ps2_dev_command(dev, PS2_CMD_RESEND, NULL, 0, data, 2); in ps2_reset_mouse() 72 ps2_dev_detect_pointing(ps2_dev* dev, device_hooks** hooks) in ps2_dev_detect_pointing() argument 74 status_t status = ps2_reset_mouse(dev); in ps2_dev_detect_pointing() 83 status = probe_trackpoint(dev); in ps2_dev_detect_pointing() 89 status = probe_synaptics(dev); in ps2_dev_detect_pointing() 95 status = probe_alps(dev); in ps2_dev_detect_pointing() 101 status = probe_elantech(dev); in ps2_dev_detect_pointing() 109 status = ps2_reset_mouse(dev); in ps2_dev_detect_pointing() [all …]
|
H A D | ps2_elantech.cpp | 78 if (!cookie->dev->active) { in get_elantech_movement() 84 cookie->dev->packet_size) != cookie->dev->packet_size) { in get_elantech_movement() 157 synaptics_dev_send_command(ps2_dev* dev, uint8 cmd, uint8 *in, int in_count) in synaptics_dev_send_command() argument 159 if (ps2_dev_sliced_command(dev, cmd) != B_OK in synaptics_dev_send_command() 160 || ps2_dev_command(dev, PS2_CMD_MOUSE_GET_INFO, NULL, 0, in, in_count) in synaptics_dev_send_command() 170 elantech_dev_send_command(ps2_dev* dev, uint8 cmd, uint8 *in, int in_count) in elantech_dev_send_command() argument 172 if (ps2_dev_command(dev, ELANTECH_CMD_PS2_CUSTOM_CMD) != B_OK in elantech_dev_send_command() 173 || ps2_dev_command(dev, cmd) != B_OK in elantech_dev_send_command() 174 || ps2_dev_command(dev, PS2_CMD_MOUSE_GET_INFO, NULL, 0, in, in_count) in elantech_dev_send_command() 184 probe_elantech(ps2_dev* dev) in probe_elantech() argument [all …]
|
H A D | ps2_alps.cpp | 143 if (!cookie->dev->active) { in get_alps_movment() 149 cookie->dev->packet_size) != cookie->dev->packet_size) { in get_alps_movment() 205 probe_alps(ps2_dev* dev) in probe_alps() argument 212 if (ps2_dev_command(dev, PS2_CMD_MOUSE_SET_RES, val, 1, NULL, 0) != B_OK in probe_alps() 213 || ps2_dev_command(dev, PS2_CMD_MOUSE_SET_SCALE11, NULL, 0, NULL, 0) in probe_alps() 215 || ps2_dev_command(dev, PS2_CMD_MOUSE_SET_SCALE11, NULL, 0, NULL, 0) in probe_alps() 217 || ps2_dev_command(dev, PS2_CMD_MOUSE_SET_SCALE11, NULL, 0, NULL, 0) in probe_alps() 221 if (ps2_dev_command(dev, PS2_CMD_MOUSE_GET_INFO, NULL, 0, val, 3) in probe_alps() 229 if (ps2_dev_command(dev, PS2_CMD_MOUSE_SET_RES, val, 1, NULL, 0) != B_OK in probe_alps() 230 || ps2_dev_command(dev, PS2_CMD_MOUSE_SET_SCALE21, NULL, 0, NULL, 0) in probe_alps() [all …]
|
H A D | ps2_service.cpp | 34 ps2_dev * dev; member 51 ps2_service_notify_device_added(ps2_dev *dev) in ps2_service_notify_device_added() argument 55 TRACE("ps2: ps2_service_notify_device_added %s\n", dev->name); in ps2_service_notify_device_added() 58 cmd.dev = dev; in ps2_service_notify_device_added() 68 ps2_service_notify_device_republish(ps2_dev *dev) in ps2_service_notify_device_republish() argument 72 TRACE("ps2: ps2_service_notify_device_republish %s\n", dev->name); in ps2_service_notify_device_republish() 75 cmd.dev = dev; in ps2_service_notify_device_republish() 85 ps2_service_notify_device_removed(ps2_dev *dev) in ps2_service_notify_device_removed() argument 89 TRACE("ps2: ps2_service_notify_device_removed %s\n", dev->name); in ps2_service_notify_device_removed() 92 cmd.dev = dev; in ps2_service_notify_device_removed() [all …]
|
H A D | ps2_standard_mouse.cpp | 92 ps2_set_sample_rate(ps2_dev* dev, uint8 rate) in ps2_set_sample_rate() argument 94 return ps2_dev_command(dev, PS2_CMD_SET_SAMPLE_RATE, &rate, 1, NULL, 0); in ps2_set_sample_rate() 176 if (!cookie->dev->active) { in standard_mouse_read_event() 183 cookie->dev->packet_size) != cookie->dev->packet_size) { in standard_mouse_read_event() 200 standard_mouse_disconnect(ps2_dev* dev) in standard_mouse_disconnect() argument 203 INFO("ps2: ps2_standard_mouse_disconnect %s\n", dev->name); in standard_mouse_disconnect() 204 if (dev->flags & PS2_FLAG_OPEN) in standard_mouse_disconnect() 205 release_sem(((standard_mouse_cookie*)dev->cookie)->standard_mouse_sem); in standard_mouse_disconnect() 216 standard_mouse_handle_int(ps2_dev* dev) in standard_mouse_handle_int() argument 218 standard_mouse_cookie* cookie = (standard_mouse_cookie*)dev->cookie; in standard_mouse_handle_int() [all …]
|
/haiku/src/add-ons/kernel/file_systems/ntfs/libntfs/ |
H A D | unix_io.c | 67 #define DEV_FD(dev) (*(int *)dev->d_private) argument 117 static int ntfs_device_unix_io_open(struct ntfs_device *dev, int flags) in ntfs_device_unix_io_open() argument 123 if (NDevOpen(dev)) { in ntfs_device_unix_io_open() 127 if (stat(dev->d_name, &sbuf)) { in ntfs_device_unix_io_open() 128 ntfs_log_perror("Failed to access '%s'", dev->d_name); in ntfs_device_unix_io_open() 132 NDevSetBlock(dev); in ntfs_device_unix_io_open() 134 dev->d_private = ntfs_malloc(sizeof(int)); in ntfs_device_unix_io_open() 135 if (!dev->d_private) in ntfs_device_unix_io_open() 141 if (!NDevBlock(dev) && (flags & O_RDWR) == O_RDWR) in ntfs_device_unix_io_open() 143 *(int*)dev->d_private = open(dev->d_name, flags); in ntfs_device_unix_io_open() [all …]
|
H A D | device.c | 120 struct ntfs_device *dev; in ntfs_device_alloc() local 127 dev = ntfs_malloc(sizeof(struct ntfs_device)); in ntfs_device_alloc() 128 if (dev) { in ntfs_device_alloc() 129 if (!(dev->d_name = strdup(name))) { in ntfs_device_alloc() 131 free(dev); in ntfs_device_alloc() 135 dev->d_ops = dops; in ntfs_device_alloc() 136 dev->d_state = state; in ntfs_device_alloc() 137 dev->d_private = priv_data; in ntfs_device_alloc() 138 dev->d_heads = -1; in ntfs_device_alloc() 139 dev->d_sectors_per_track = -1; in ntfs_device_alloc() [all …]
|
/haiku/src/libs/compat/freebsd_network/compat/sys/ |
H A D | bus.h | 30 static __inline type varp ## _get_ ## var(device_t dev) \ 35 static __inline void varp ## _set_ ## var(device_t dev, type t) \ 54 int bus_generic_detach(device_t dev); 55 int bus_generic_suspend(device_t dev); 56 int bus_generic_resume(device_t dev); 57 void bus_generic_shutdown(device_t dev); 67 struct resource *bus_alloc_resource(device_t dev, int type, int *rid, 69 int bus_release_resource(device_t dev, int type, int rid, struct resource *r); 70 int bus_alloc_resources(device_t dev, struct resource_spec *resourceSpec, 72 void bus_release_resources(device_t dev, [all …]
|
/haiku/src/libs/compat/freebsd_network/compat/dev/pci/ |
H A D | pcivar.h | 23 int pci_enable_busmaster(device_t dev); 24 int pci_enable_io(device_t dev, int reg); 26 uint32_t pci_get_devid(device_t dev); 27 void pci_set_intpin(device_t dev, uint8_t pin); 28 uint8_t pci_get_intpin(device_t dev); 30 uint16_t pci_get_vendor(device_t dev); 31 uint16_t pci_get_device(device_t dev); 32 uint16_t pci_get_subvendor(device_t dev); 33 uint16_t pci_get_subdevice(device_t dev); 34 uint8_t pci_get_revid(device_t dev); [all …]
|
/haiku/src/add-ons/kernel/bus_managers/pci/ |
H A D | pci.cpp | 777 PCIDev *dev = bus->child; in _GetNthInfo() local 778 while (dev) { in _GetNthInfo() 780 *outInfo = dev->info; in _GetNthInfo() 784 if (dev->child && B_OK == _GetNthInfo(dev->child, currentIndex, in _GetNthInfo() 787 dev = dev->next; in _GetNthInfo() 802 for (int dev = 0; dev < maxBusDevices; dev++) { in _EnumerateBus() local 803 uint16 vendor_id = ReadConfig(domain, bus, dev, 0, PCI_vendor_id, 2); in _EnumerateBus() 807 int numFunctions = _NumFunctions(domain, bus, dev); in _EnumerateBus() 809 uint16 device_id = ReadConfig(domain, bus, dev, function, in _EnumerateBus() 814 uint8 baseClass = ReadConfig(domain, bus, dev, function, in _EnumerateBus() [all …]
|
/haiku/src/libs/compat/freebsd_network/ |
H A D | pci.cpp | 19 # define TRACE_PCI(dev, format, args...) device_printf(dev, format , ##args) argument 21 # define TRACE_PCI(dev, format, args...) do { } while (0) argument 61 pci_read_config(device_t dev, int offset, int size) in pci_read_config() argument 63 pci_info* info = get_device_pci_info(dev); in pci_read_config() 67 TRACE_PCI(dev, "pci_read_config(%i, %i) = 0x%x\n", offset, size, value); in pci_read_config() 73 pci_write_config(device_t dev, int offset, uint32_t value, int size) in pci_write_config() argument 75 pci_info* info = get_device_pci_info(dev); in pci_write_config() 77 TRACE_PCI(dev, "pci_write_config(%i, 0x%x, %i)\n", offset, value, size); in pci_write_config() 85 pci_get_vendor(device_t dev) in pci_get_vendor() argument 87 return pci_read_config(dev, PCI_vendor_id, 2); in pci_get_vendor() [all …]
|
H A D | device.c | 52 device_t dev = malloc(sizeof(struct device)); in new_device() local 53 if (dev == NULL) in new_device() 56 memset(dev, 0, sizeof(struct device)); in new_device() 58 if (init_device(dev, driver) == NULL) { in new_device() 59 free(dev); in new_device() 63 return dev; in new_device() 139 device_printf(device_t dev, const char *format, ...) in device_printf() argument 144 driver_vprintf_etc(dev->device_name, format, vl); in device_printf() 151 device_set_desc(device_t dev, const char *desc) in device_set_desc() argument 153 dev->description = desc; in device_set_desc() [all …]
|
/haiku/src/add-ons/media/media-add-ons/dvb/ |
H A D | DVBMediaAddon.cpp | 91 device_info *dev = (device_info *)fDeviceList.ItemAt(n); in GetFlavorAt() local 92 if (!dev) in GetFlavorAt() 94 *out_info = &dev->flavor; in GetFlavorAt() 104 device_info *dev = (device_info *)fDeviceList.ItemAt(info->internal_id); in InstantiateNodeFor() local 105 if (!dev || dev->flavor.internal_id != info->internal_id) { in InstantiateNodeFor() 111 return new DVBMediaNode(this, dev->name, dev->flavor.internal_id, dev->card); in InstantiateNodeFor() 137 device_info *dev = (device_info *)fDeviceList.ItemAt(index); in AutoStart() local 138 if (!dev) { in AutoStart() 144 *outInternalID = dev->flavor.internal_id; in AutoStart() 145 *outNode = new DVBMediaNode(this, dev->name, dev->flavor.internal_id, dev->card); in AutoStart() [all …]
|
/haiku/src/add-ons/media/media-add-ons/firewire_dv/ |
H A D | FireWireDVAddOn.cpp | 82 device_info* dev = fDeviceList.ItemAt(n); in GetFlavorAt() local 83 if (!dev) in GetFlavorAt() 85 *out_info = &dev->flavor; in GetFlavorAt() 95 device_info* dev = fDeviceList.ItemAt(info->internal_id); in InstantiateNodeFor() local 96 if (!dev || dev->flavor.internal_id != info->internal_id) { in InstantiateNodeFor() 102 return new FireWireDVNode(this, dev->name, dev->flavor.internal_id, in InstantiateNodeFor() 103 dev->card); in InstantiateNodeFor() 159 device_info *dev = new device_info; in AddDevice() local 160 fDeviceList.AddItem(dev); in AddDevice() 162 dev->card = card; in AddDevice() [all …]
|
/haiku/src/add-ons/kernel/drivers/network/wlan/atheroswifi/dev/ath/ |
H A D | if_ath_pci.c | 141 ath_pci_probe_device(device_t dev, const struct pci_device_id *dev_table, int nentries) in ath_pci_probe_device() argument 147 vendor_id = pci_get_vendor(dev); in ath_pci_probe_device() 148 device_id = pci_get_device(dev); in ath_pci_probe_device() 149 sub_vendor_id = pci_get_subvendor(dev); in ath_pci_probe_device() 150 sub_device_id = pci_get_subdevice(dev); in ath_pci_probe_device() 184 ath_pci_setup(device_t dev) in ath_pci_setup() argument 194 cz = pci_read_config(dev, PCIR_CACHELNSZ, 1); in ath_pci_setup() 196 pci_write_config(dev, PCIR_CACHELNSZ, in ath_pci_setup() 201 pci_write_config(dev, PCIR_LATTIMER, 0xa8, 1); in ath_pci_setup() 208 pmcsr = pci_read_config(dev, PCIR_CFG_PMCSR, 2); in ath_pci_setup() [all …]
|
/haiku/src/add-ons/kernel/drivers/network/wlan/marvell88w8363/dev/mwl/ |
H A D | if_mwl_pci.c | 115 mwl_pci_probe(device_t dev) in mwl_pci_probe() argument 119 ident = mwl_pci_lookup(pci_get_vendor(dev), pci_get_device(dev)); in mwl_pci_probe() 121 device_set_desc(dev, ident->name); in mwl_pci_probe() 128 mwl_pci_attach(device_t dev) in mwl_pci_attach() argument 130 struct mwl_pci_softc *psc = device_get_softc(dev); in mwl_pci_attach() 134 sc->sc_dev = dev; in mwl_pci_attach() 136 pci_enable_busmaster(dev); in mwl_pci_attach() 142 psc->sc_sr0 = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, in mwl_pci_attach() 145 device_printf(dev, "cannot map BAR0 register space\n"); in mwl_pci_attach() 149 psc->sc_sr1 = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, in mwl_pci_attach() [all …]
|
/haiku/src/add-ons/kernel/drivers/network/wlan/broadcom43xx/dev/bwi/ |
H A D | if_bwi_pci.c | 104 bwi_pci_probe(device_t dev) in bwi_pci_probe() argument 109 did = pci_get_device(dev); in bwi_pci_probe() 110 vid = pci_get_vendor(dev); in bwi_pci_probe() 114 device_set_desc(dev, b->desc); in bwi_pci_probe() 122 bwi_pci_attach(device_t dev) in bwi_pci_attach() argument 124 struct bwi_pci_softc *psc = device_get_softc(dev); in bwi_pci_attach() 128 sc->sc_dev = dev; in bwi_pci_attach() 133 pci_enable_busmaster(dev); in bwi_pci_attach() 139 sc->sc_mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, in bwi_pci_attach() 142 device_printf(dev, "cannot map register space\n"); in bwi_pci_attach() [all …]
|
/haiku/src/add-ons/kernel/drivers/disk/nvme/libnvme/ |
H A D | nvme_pci.h | 137 extern int nvme_pci_device_reset(struct pci_device *dev); 142 extern int nvme_pci_device_get_serial_number(struct pci_device *dev, 157 pci_dev1->dev == pci_dev2->dev && in nvme_pci_dev_cmp() 177 int nvme_pcicfg_read8(struct pci_device *dev, uint8_t *value, uint32_t offset); 178 int nvme_pcicfg_write8(struct pci_device *dev, uint8_t value, uint32_t offset); 179 int nvme_pcicfg_read16(struct pci_device *dev, uint16_t *value, uint32_t offset); 180 int nvme_pcicfg_write16(struct pci_device *dev, uint16_t value, uint32_t offset); 181 int nvme_pcicfg_read32(struct pci_device *dev, uint32_t *value, uint32_t offset); 182 int nvme_pcicfg_write32(struct pci_device *dev, uint32_t value, uint32_t offset); 194 static inline int nvme_pcicfg_read8(struct pci_device *dev, in nvme_pcicfg_read8() argument [all …]
|
/haiku/src/add-ons/kernel/drivers/network/wlan/marvell88w8335/dev/malo/ |
H A D | if_malo_pci.c | 133 malo_pci_probe(device_t dev) in malo_pci_probe() argument 139 vendor = pci_get_vendor(dev); in malo_pci_probe() 140 devid = pci_get_device(dev); in malo_pci_probe() 145 device_set_desc(dev, mp->mp_name); in malo_pci_probe() 154 malo_pci_attach(device_t dev) in malo_pci_attach() argument 157 struct malo_pci_softc *psc = device_get_softc(dev); in malo_pci_attach() 160 sc->malo_dev = dev; in malo_pci_attach() 162 pci_enable_busmaster(dev); in malo_pci_attach() 168 error = bus_alloc_resources(dev, psc->malo_mem_spec, psc->malo_res_mem); in malo_pci_attach() 170 device_printf(dev, "couldn't allocate memory resources\n"); in malo_pci_attach() [all …]
|
/haiku/src/add-ons/kernel/drivers/network/wlan/aironetwifi/dev/an/ |
H A D | if_an_pci.c | 121 an_probe_pci(device_t dev) in an_probe_pci() argument 127 vid = pci_get_vendor(dev); in an_probe_pci() 128 did = pci_get_device(dev); in an_probe_pci() 133 device_set_desc(dev, t->an_name); in an_probe_pci() 143 an_attach_pci(dev) in an_attach_pci() argument 144 device_t dev; in an_attach_pci() 149 sc = device_get_softc(dev); 151 flags = device_get_flags(dev); 157 mtx_init(&sc->an_mtx, device_get_nameunit(dev), MTX_NETWORK_LOCK, 160 if (pci_get_vendor(dev) == AIRONET_VENDORID && [all …]
|
/haiku/src/add-ons/kernel/drivers/network/wlan/ralinkwifi/dev/ral/ |
H A D | if_ral_pci.c | 182 ral_pci_probe(device_t dev) in ral_pci_probe() argument 187 if (pci_get_vendor(dev) == ident->vendor && in ral_pci_probe() 188 pci_get_device(dev) == ident->device) { in ral_pci_probe() 189 device_set_desc(dev, ident->name); in ral_pci_probe() 197 ral_pci_attach(device_t dev) in ral_pci_attach() argument 199 struct ral_pci_softc *psc = device_get_softc(dev); in ral_pci_attach() 203 pci_enable_busmaster(dev); in ral_pci_attach() 205 switch (pci_get_device(dev)) { in ral_pci_attach() 220 psc->mem = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, in ral_pci_attach() 223 device_printf(dev, "could not allocate memory resource\n"); in ral_pci_attach() [all …]
|
/haiku/src/bin/ |
H A D | driveinfo.c | 8 static void dump_dev_size(int dev) in dump_dev_size() argument 11 if (ioctl(dev, B_GET_DEVICE_SIZE, &sz, sizeof(sz)) < 0) { in dump_dev_size() 18 static void dump_bios_id(int dev) in dump_bios_id() argument 21 if (ioctl(dev, B_GET_BIOS_DRIVE_ID, &id, sizeof(id)) < 0) { in dump_bios_id() 28 static void dump_media_status(int dev) in dump_media_status() argument 31 if (ioctl(dev, B_GET_MEDIA_STATUS, &st, sizeof(st)) < 0) { in dump_media_status() 53 static void dump_geom(int dev, bool bios) in dump_geom() argument 57 if (ioctl(dev, bios?B_GET_BIOS_GEOMETRY:B_GET_GEOMETRY, &geom, sizeof(geom)) < 0) { in dump_geom() 72 static void dump_partition(int dev) in dump_partition() argument 76 if (ioctl(dev, B_GET_PARTITION_INFO, &partition, sizeof(partition)) < 0) { in dump_partition() [all …]
|
/haiku/src/add-ons/kernel/drivers/disk/virtual/nbd/ |
H A D | nbd.c | 70 #define WHICH(dev) ((int)(dev - nbd_devices)) argument 106 struct nbd_device *dev; member 111 status_t nbd_alloc_request(struct nbd_device *dev, struct nbd_request_entry **req, uint32 type, off… 112 status_t nbd_queue_request(struct nbd_device *dev, struct nbd_request_entry *req); 113 status_t nbd_dequeue_request(struct nbd_device *dev, uint64 handle, struct nbd_request_entry **req); 114 status_t nbd_free_request(struct nbd_device *dev, struct nbd_request_entry *req); 119 status_t nbd_connect(struct nbd_device *dev); 120 status_t nbd_teardown(struct nbd_device *dev); 121 status_t nbd_post_request(struct nbd_device *dev, struct nbd_request_entry *req); 169 status_t nbd_alloc_request(struct nbd_device *dev, struct nbd_request_entry **req, uint32 type, off… in nbd_alloc_request() argument [all …]
|