| /linux/net/core/ |
| H A D | dev_addr_lists.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 3 * net/core/dev_addr_lists.c - Functions for handling net device lists 6 * This file contains functions for working with unicast, multicast and device 24 struct rb_node **ins_point = &list->tree.rb_node, *parent = NULL; in __hw_addr_insert() 31 diff = memcmp(new->addr, ha->addr, addr_len); in __hw_addr_insert() 33 diff = memcmp(&new->type, &ha->type, sizeof(new->type)); in __hw_addr_insert() 37 ins_point = &parent->rb_left; in __hw_addr_insert() 39 ins_point = &parent->rb_right; in __hw_addr_insert() 41 return -EEXIST; in __hw_addr_insert() 44 rb_link_node_rcu(&new->node, parent, ins_point); in __hw_addr_insert() [all …]
|
| H A D | of_net.c | 1 // SPDX-License-Identifier: GPL-2.0-only 14 #include <linux/device.h> 15 #include <linux/nvmem-consumer.h> 18 * of_get_phy_mode - Get phy mode for given device_node 22 * The function gets phy interface string from property 'phy-mode' or 23 * 'phy-connection-type'. The index in phy_modes table is set in 25 * PHY_INTERFACE_MODE_NA and an errno is returned, e.g. -ENODEV. 34 err = of_property_read_string(np, "phy-mode", &pm); in of_get_phy_mode() 36 err = of_property_read_string(np, "phy-connection-type", &pm); in of_get_phy_mode() 46 return -ENODEV; in of_get_phy_mode() [all …]
|
| /linux/drivers/peci/ |
| H A D | device.c | 1 // SPDX-License-Identifier: GPL-2.0-only 2 // Copyright (c) 2018-2021 Intel Corporation 6 #include <linux/peci-cpu.h> 12 * PECI device can be removed using sysfs, but the removal can also happen as 14 * Mutex is used to protect PECI device from being double-deleted. 19 static int peci_get_revision(struct peci_device *device, u8 *revision) in peci_get_revision() argument 24 req = peci_xfer_get_dib(device); in peci_get_revision() 29 * PECI device may be in a state where it is unable to return a proper in peci_get_revision() 37 return -EIO; in peci_get_revision() 47 static int peci_get_cpu_id(struct peci_device *device, u32 *cpu_id) in peci_get_cpu_id() argument [all …]
|
| /linux/drivers/net/phy/ |
| H A D | mdio_bus.c | 1 // SPDX-License-Identifier: GPL-2.0+ 11 #include <linux/device.h> 39 mdiodev->reset_gpio = gpiod_get_optional(&mdiodev->dev, in mdiobus_register_gpiod() 41 if (IS_ERR(mdiodev->reset_gpio)) in mdiobus_register_gpiod() 42 return PTR_ERR(mdiodev->reset_gpio); in mdiobus_register_gpiod() 44 if (mdiodev->reset_gpio) in mdiobus_register_gpiod() 45 gpiod_set_consumer_name(mdiodev->reset_gpio, "PHY reset"); in mdiobus_register_gpiod() 54 reset = reset_control_get_optional_exclusive(&mdiodev->dev, "phy"); in mdiobus_register_reset() 58 mdiodev->reset_ctrl = reset; in mdiobus_register_reset() 67 if (mdiodev->bus->mdio_map[mdiodev->addr]) in mdiobus_register_device() [all …]
|
| /linux/drivers/gpu/drm/nouveau/nvkm/engine/fifo/ |
| H A D | ga100.c | 39 return (chan->cgrp->runl->doorbell << 16) | chan->id; in ga100_chan_doorbell_handle() 45 struct nvkm_runl *runl = chan->cgrp->runl; in ga100_chan_stop() 47 nvkm_wr32(runl->fifo->engine.subdev.device, runl->chan + (chan->id * 4), 0x00000003); in ga100_chan_stop() 53 struct nvkm_runl *runl = chan->cgrp->runl; in ga100_chan_start() 54 struct nvkm_device *device = runl->fifo->engine.subdev.device; in ga100_chan_start() local 57 nvkm_wr32(device, runl->chan + (chan->id * 4), 0x00000002); in ga100_chan_start() 58 nvkm_wr32(device, runl->addr + 0x0090, (gfid << 16) | chan->id); /* INTERNAL_DOORBELL. */ in ga100_chan_start() 64 struct nvkm_runl *runl = chan->cgrp->runl; in ga100_chan_unbind() 66 nvkm_wr32(runl->fifo->engine.subdev.device, runl->chan + (chan->id * 4), 0xffffffff); in ga100_chan_unbind() 74 nvkm_kmap(chan->inst); in ga100_chan_ramfc_write() [all …]
|
| /linux/drivers/gpu/drm/nouveau/nvkm/subdev/bios/ |
| H A D | shadowramin.c | 33 struct nvkm_device *device = bios->subdev.device; in pramin_read() local 37 *(u32 *)&bios->data[i] = nvkm_rd32(device, 0x700000 + i); in pramin_read() 48 struct nvkm_device *device = priv->bios->subdev.device; in pramin_fini() local 49 nvkm_wr32(device, 0x001700, priv->bar0); in pramin_fini() 57 struct nvkm_subdev *subdev = &bios->subdev; in pramin_init() 58 struct nvkm_device *device = subdev->device; in pramin_init() local 60 u64 addr = 0; in pramin_init() local 63 if (device->card_type < NV_50) in pramin_init() 67 if (device->card_type >= GA100) in pramin_init() 68 addr = device->chipset == 0x170; /*XXX: find the fuse reg for this */ in pramin_init() [all …]
|
| H A D | init.c | 42 nvkm_printk(init->subdev, lvl, info, "0x%08x[%c]: "fmt, \ 43 init->offset, init_exec(init) ? \ 44 '0' + (init->nested - 1) : ' ', ##args); \ 47 if (init->subdev->debug >= NV_DBG_TRACE) \ 61 return (init->execute == 1) || ((init->execute & 5) == 5); in init_exec() 67 if (exec) init->execute &= 0xfd; in init_exec_set() 68 else init->execute |= 0x02; in init_exec_set() 74 init->execute ^= 0x02; in init_exec_inv() 80 if (exec) init->execute |= 0x04; in init_exec_force() 81 else init->execute &= 0xfb; in init_exec_force() [all …]
|
| /linux/lib/ |
| H A D | devres.c | 1 // SPDX-License-Identifier: GPL-2.0 3 #include <linux/device.h> 19 void devm_ioremap_release(struct device *dev, void *res) in devm_ioremap_release() 24 static int devm_ioremap_match(struct device *dev, void *res, void *match_data) in devm_ioremap_match() 29 static void __iomem *__devm_ioremap(struct device *dev, resource_size_t offset, in __devm_ioremap() 33 void __iomem **ptr, *addr = NULL; in __devm_ioremap() local 42 addr = ioremap(offset, size); in __devm_ioremap() 45 addr = ioremap_uc(offset, size); in __devm_ioremap() 48 addr = ioremap_wc(offset, size); in __devm_ioremap() 51 addr = ioremap_np(offset, size); in __devm_ioremap() [all …]
|
| H A D | test_hmm.c | 1 // SPDX-License-Identifier: GPL-2.0 4 * mirror and zone device private memory migration APIs of the kernel. 6 * space and can use the device to read/write any valid virtual address. 14 #include <linux/device.h> 42 * representing a piece of device memory. dmirror_devmem_alloc_page 44 * real device. zone_device_data points to that backing page. But 46 * physical CPU-accessible memory that we can use directly. 49 (page)->zone_device_data : (page)) 54 …start address for SPM (special purpose memory) used for device 0. By setting this Coherent device … 59 …start address for SPM (special purpose memory) used for device 1. By setting this Coherent device … [all …]
|
| /linux/drivers/cxl/core/ |
| H A D | regs.c | 1 // SPDX-License-Identifier: GPL-2.0-only 3 #include <linux/io-64-nonatomic-lo-hi.h> 4 #include <linux/device.h> 16 * CXL device capabilities are enumerated by PCI DVSEC (Designated 17 * Vendor-specific) and / or descriptors provided by platform firmware. 18 * They can be defined as a set like the device and component registers 19 * mandated by CXL Section 8.1.12.2 Memory Device PCIe Capabilities and 28 * cxl_probe_component_regs() - Detect CXL Component register blocks 29 * @dev: Host device of the @base mapping 34 * See CXL 2.0 8.2.5.5 CXL Device Register Interface [all …]
|
| /linux/drivers/net/ethernet/huawei/hinic/ |
| H A D | hinic_hw_if.c | 1 // SPDX-License-Identifier: GPL-2.0-only 8 #include <linux/device.h> 20 #define VALID_MSIX_IDX(attr, msix_index) ((msix_index) < (attr)->num_irqs) 27 * hinic_msix_attr_set - set message attribute for msix entry 28 * @hwif: the HW interface of a pci function device 36 * Return 0 - Success, negative - Failure 43 u32 msix_ctrl, addr; in hinic_msix_attr_set() local 45 if (!VALID_MSIX_IDX(&hwif->attr, msix_index)) in hinic_msix_attr_set() 46 return -EINVAL; in hinic_msix_attr_set() 54 addr = HINIC_CSR_MSIX_CTRL_ADDR(msix_index); in hinic_msix_attr_set() [all …]
|
| /linux/drivers/media/usb/em28xx/ |
| H A D | em28xx-i2c.c | 1 // SPDX-License-Identifier: GPL-2.0+ 3 // em28xx-i2c.c - driver for Empia EM2800/EM2820/2840 USB video capture devices 20 #include <media/v4l2-common.h> 23 /* ----------------------------------------------------------- */ 35 dev_printk(KERN_DEBUG, &dev->intf->dev, \ 41 * 35ms is the maximum time a SMBUS device could wait when 54 switch (dev->i2c_speed & 0x03) { in em28xx_i2c_timeout() 71 * send up to 4 bytes to the em2800 i2c device 73 static int em2800_i2c_send_bytes(struct em28xx *dev, u8 addr, u8 *buf, u16 len) in em2800_i2c_send_bytes() argument 80 return -EOPNOTSUPP; in em2800_i2c_send_bytes() [all …]
|
| /linux/include/trace/events/ |
| H A D | habanalabs.h | 1 /* SPDX-License-Identifier: GPL-2.0 3 * Copyright 2022-2023 HabanaLabs, Ltd. 17 TP_PROTO(struct device *dev, u64 virt_addr, u64 phys_addr, u32 page_size, bool flush_pte), 31 __entry->virt_addr = virt_addr; 32 __entry->phys_addr = phys_addr; 33 __entry->page_size = page_size; 34 __entry->flush_pte = flush_pte; 39 __entry->virt_add [all...] |
| /linux/Documentation/devicetree/bindings/powerpc/fsl/ |
| H A D | mpc5200.txt | 1 MPC5200 Device Tree Bindings 2 ---------------------------- 4 (c) 2006-2009 Secret Lab Technologies Ltd 8 ------------------ 9 For mpc5200 on-chip devices, the format for each compatible value is 10 <chip>-<device>[-<mode>]. The OS should be able to match a device driver 11 to the device based solely on the compatible value. If two drivers 21 "fsl,mpc5200-<device>". 27 To express this information as completely as possible, 5200B device trees 29 compatible = "fsl,mpc5200b-<device>","fsl,mpc5200-<device>"; [all …]
|
| /linux/drivers/gpio/ |
| H A D | gpio-f7188x.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 3 * GPIO driver for Fintek and Nuvoton Super-I/O chips 5 * Copyright (C) 2010-2013 LaCie 10 #define DRVNAME "gpio-f7188x" 21 * Super-I/O registers 23 #define SIO_LDSEL 0x07 /* Logical device select */ 24 #define SIO_DEVID 0x20 /* Device ID (2 bytes) */ 26 #define SIO_UNLOCK_KEY 0x87 /* Key to enable Super-I/O */ 27 #define SIO_LOCK_KEY 0xAA /* Key to disable Super-I/O */ 32 #define SIO_FINTEK_DEVREV 0x22 /* Fintek Device revision */ [all …]
|
| /linux/drivers/gpu/drm/nouveau/nvkm/engine/ |
| H A D | xtensa.c | 30 struct nvkm_xtensa *xtensa = nvkm_xtensa(oclass->engine); in nvkm_xtensa_oclass_get() 33 while (xtensa->func->sclass[c].oclass) { in nvkm_xtensa_oclass_get() 35 oclass->base = xtensa->func->sclass[index]; in nvkm_xtensa_oclass_get() 47 return nvkm_gpuobj_new(object->engine->subdev.device, 0x10000, align, in nvkm_xtensa_cclass_bind() 60 struct nvkm_subdev *subdev = &xtensa->engine.subdev; in nvkm_xtensa_intr() 61 struct nvkm_device *device = subdev->device; in nvkm_xtensa_intr() local 62 const u32 base = xtensa->addr; in nvkm_xtensa_intr() 63 u32 unk104 = nvkm_rd32(device, base + 0xd04); in nvkm_xtensa_intr() 64 u32 intr = nvkm_rd32(device, base + 0xc20); in nvkm_xtensa_intr() 65 u32 chan = nvkm_rd32(device, base + 0xc28); in nvkm_xtensa_intr() [all …]
|
| /linux/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/ |
| H A D | busnv50.c | 31 u32 addr; member 39 struct nvkm_device *device = bus->base.pad->i2c->subdev.device; in nv50_i2c_bus_drive_scl() local 40 if (state) bus->data |= 0x01; in nv50_i2c_bus_drive_scl() 41 else bus->data &= 0xfe; in nv50_i2c_bus_drive_scl() 42 nvkm_wr32(device, bus->addr, bus->data); in nv50_i2c_bus_drive_scl() 49 struct nvkm_device *device = bus->base.pad->i2c->subdev.device; in nv50_i2c_bus_drive_sda() local 50 if (state) bus->data |= 0x02; in nv50_i2c_bus_drive_sda() 51 else bus->data &= 0xfd; in nv50_i2c_bus_drive_sda() 52 nvkm_wr32(device, bus->addr, bus->data); in nv50_i2c_bus_drive_sda() 59 struct nvkm_device *device = bus->base.pad->i2c->subdev.device; in nv50_i2c_bus_sense_scl() local [all …]
|
| /linux/Documentation/i2c/ |
| H A D | smbus-protocol.rst | 14 If you write a driver for some I2C device, please try to use the SMBus 15 commands if at all possible (if the device uses only that subset of the 16 I2C protocol). This makes it possible to use the device driver on both 28 transaction function, a device driver should always check (just once) for 44 Addr (7 bits) I2C 7 bit address. Note that this can be expanded to 47 the device. 52 [..] Data sent by I2C device, as opposed to data sent by the host 60 This sends a single bit to the device, at the place of the Rd/Wr bit:: 62 S Addr Rd/Wr [A] P 72 This reads a single byte from a device, without specifying a device [all …]
|
| /linux/net/ethernet/ |
| H A D | eth.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 7 * Ethernet-type device handling. 14 * Florian La Roche, <rzsfl@rz.uni-sb.de> 34 * Andrew Morton : 26Feb01: kill ether_setup() - use netdev_boot_setup(). 46 #include <linux/nvmem-consume 279 struct sockaddr *addr = p; eth_prepare_mac_addr_change() local 296 struct sockaddr *addr = p; eth_commit_mac_addr_change() local 389 sysfs_format_mac(char * buf,const unsigned char * addr,int len) sysfs_format_mac() argument 491 unsigned char *addr; eth_platform_get_mac_address() local 518 u8 addr[ETH_ALEN] __aligned(2); platform_get_ethdev_address() local 565 fwnode_get_mac_addr(struct fwnode_handle * fwnode,const char * name,char * addr) fwnode_get_mac_addr() argument 600 fwnode_get_mac_address(struct fwnode_handle * fwnode,char * addr) fwnode_get_mac_address() argument 616 device_get_mac_address(struct device * dev,char * addr) device_get_mac_address() argument 632 u8 addr[ETH_ALEN]; device_get_ethdev_address() local [all...] |
| /linux/drivers/usb/gadget/udc/ |
| H A D | udc-xilinx.c | 1 // SPDX-License-Identifier: GPL-2.0+ 8 * Copyright (C) 2010 - 2014 Xilinx, Inc. 10 * Some parts of this driver code is based on the driver for at91-series 16 #include <linux/device.h> 17 #include <linux/dma-mapping.h> 27 /* Register offsets for the USB device.*/ 40 #define XUSB_DMA_DDAR_ADDR_OFFSET 0x020C /* DMA destination Addr Reg */ 82 /* USB device specific global configuration constants.*/ 109 * struct xusb_req - Xilinx USB device request structure 111 * @queue: usb device request queue [all …]
|
| /linux/drivers/input/rmi4/ |
| H A D | rmi_bus.h | 1 /* SPDX-License-Identifier: GPL-2.0-only */ 3 * Copyright (c) 2011-2016 Synaptics Incorporated 21 * struct rmi_function - represents the implementation of an RMI4 22 * function for a particular device (basically, a driver for that RMI4 function) 25 * @rmi_dev: Pointer to the RMI device associated with this function container 26 * @dev: The device associated with this particular function. 34 * @node: entry in device's list of functions 39 struct device dev; 50 bool rmi_is_function_device(struct device *dev); 56 * struct rmi_function_handler - driver routines for a particular RMI function. [all …]
|
| /linux/include/linux/mmc/ |
| H A D | sdio_func.h | 1 /* SPDX-License-Identifier: GPL-2.0-or-later */ 5 * Copyright 2007-2008 Pierre Ossman 11 #include <linux/device.h> 35 struct mmc_card *card; /* the card this device belongs to */ 36 struct device dev; /* the device */ 42 unsigned short device; /* device id */ member 62 #define sdio_func_present(f) ((f)->state & SDIO_STATE_PRESENT) 64 #define sdio_func_set_present(f) ((f)->state |= SDIO_STATE_PRESENT) 66 #define sdio_func_id(f) (dev_name(&(f)->dev)) 68 #define sdio_get_drvdata(f) dev_get_drvdata(&(f)->dev) [all …]
|
| /linux/arch/mips/kvm/ |
| H A D | loongson_ipi.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 3 * Loongson-3 Virtual IPI interrupt support. 54 gpa_t addr, int len, void *val) in loongson_vipi_read() argument 56 uint32_t core = (addr >> 8) & 3; in loongson_vipi_read() 57 uint32_t node = (addr >> 44) & 3; in loongson_vipi_read() 59 uint64_t offset = addr & 0xff; in loongson_vipi_read() 61 struct ipi_state *s = &(ipi->ipistate[id]); in loongson_vipi_read() 63 BUG_ON(offset & (len - 1)); in loongson_vipi_read() 67 *(uint64_t *)val = s->status; in loongson_vipi_read() 71 *(uint64_t *)val = s->en; in loongson_vipi_read() [all …]
|
| /linux/include/linux/ |
| H A D | virtio_pci_modern.h | 1 /* SPDX-License-Identifier: GPL-2.0 */ 10 * struct virtio_pci_modern_device - info for modern PCI virtio 11 * @pci_dev: Ptr to the PCI device struct 13 * @device: Device-specific data (non-legacy mode) 14 * @notify_base: Base of vq notifications (non-legacy mode) 17 * @notify_len: So we can sanity-check accesses 18 * @device_len: So we can sanity-check accesses 19 * @notify_map_cap: Capability for when we need to map notifications per-vq 21 * (non-legacy mode). 23 * @id: Device and vendor id [all …]
|
| /linux/drivers/s390/net/ |
| H A D | qeth_l3_sys.c | 1 // SPDX-License-Identifier: GPL-2.0 20 enum qeth_prot_versions proto, u8 *addr) in qeth_l3_string_to_ipaddr() argument 24 if ((proto == QETH_PROT_IPV4 && !in4_pton(buf, -1, addr, -1, &end)) || in qeth_l3_string_to_ipaddr() 25 (proto == QETH_PROT_IPV6 && !in6_pton(buf, -1, addr, -1, &end))) in qeth_l3_string_to_ipaddr() 26 return -EINVAL; in qeth_l3_string_to_ipaddr() 33 switch (route->type) { in qeth_l3_dev_route_show() 39 if (card->info.broadcast_capable == QETH_BROADCAST_WITHOUT_ECHO) in qeth_l3_dev_route_show() 44 if (card->info.broadcast_capable == QETH_BROADCAST_WITHOUT_ECHO) in qeth_l3_dev_route_show() 49 if (card->info.broadcast_capable == QETH_BROADCAST_WITHOUT_ECHO) in qeth_l3_dev_route_show() 58 static ssize_t qeth_l3_dev_route4_show(struct device *dev, in qeth_l3_dev_route4_show() [all …]
|