本文整理汇总了C++中device_get_name函数的典型用法代码示例。如果您正苦于以下问题:C++ device_get_name函数的具体用法?C++ device_get_name怎么用?C++ device_get_name使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了device_get_name函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: ep_alloc
int
ep_alloc(device_t dev)
{
struct ep_softc * sc = device_get_softc(dev);
int rid;
int error = 0;
rid = 0;
sc->iobase = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &rid,
RF_ACTIVE);
if (!sc->iobase) {
device_printf(dev, "No I/O space?!\n");
error = ENXIO;
goto bad;
}
rid = 0;
sc->irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_ACTIVE);
if (!sc->irq) {
device_printf(dev, "No irq?!\n");
error = ENXIO;
goto bad;
}
if_initname(&sc->arpcom.ac_if,
device_get_name(dev), device_get_unit(dev));
sc->stat = 0; /* 16 bit access */
sc->ep_io_addr = rman_get_start(sc->iobase);
sc->ep_btag = rman_get_bustag(sc->iobase);
sc->ep_bhandle = rman_get_bushandle(sc->iobase);
sc->ep_connectors = 0;
sc->ep_connector = 0;
GO_WINDOW(0);
sc->epb.cmd_off = 0;
sc->epb.prod_id = get_e(sc, EEPROM_PROD_ID);
sc->epb.res_cfg = get_e(sc, EEPROM_RESOURCE_CFG);
bad:
return (error);
}
开发者ID:mihaicarabas,项目名称:dragonfly,代码行数:44,代码来源:if_ep.c
示例2: init_uinput
static void init_uinput(struct avctp *session)
{
char address[18], name[248 + 1];
device_get_name(session->device, name, sizeof(name));
if (g_str_equal(name, "Nokia CK-20W")) {
session->key_quirks[AVC_FORWARD] |= QUIRK_NO_RELEASE;
session->key_quirks[AVC_BACKWARD] |= QUIRK_NO_RELEASE;
session->key_quirks[AVC_PLAY] |= QUIRK_NO_RELEASE;
session->key_quirks[AVC_PAUSE] |= QUIRK_NO_RELEASE;
}
ba2str(device_get_address(session->device), address);
session->uinput = uinput_create(address);
if (session->uinput < 0)
error("AVRCP: failed to init uinput for %s", address);
else
DBG("AVRCP: uinput initialized for %s", address);
}
开发者ID:MDomagala,项目名称:bluez,代码行数:19,代码来源:avctp.c
示例3: uninorth_enable_config
static int
uninorth_enable_config(struct uninorth_softc *sc, u_int bus, u_int slot,
u_int func, u_int reg)
{
uint32_t cfgval;
uint32_t pass;
if (resource_int_value(device_get_name(sc->pci_sc.sc_dev),
device_get_unit(sc->pci_sc.sc_dev), "skipslot", &pass) == 0) {
if (pass == slot)
return (0);
}
/*
* Issue type 0 configuration space accesses for the root bus.
*
* NOTE: On U4, issue only type 1 accesses. There is a secret
* PCI Express <-> PCI Express bridge not present in the device tree,
* and we need to route all of our configuration space through it.
*/
if (sc->pci_sc.sc_bus == bus && sc->sc_ver < 4) {
/*
* No slots less than 11 on the primary bus on U3 and lower
*/
if (slot < 11)
return (0);
cfgval = (1 << slot) | (func << 8) | (reg & 0xfc);
} else {
cfgval = (bus << 16) | (slot << 11) | (func << 8) |
(reg & 0xfc) | 1;
}
/* Set extended register bits on U4 */
if (sc->sc_ver == 4)
cfgval |= (reg >> 8) << 28;
do {
out32rb(sc->sc_addr, cfgval);
} while (in32rb(sc->sc_addr) != cfgval);
return (1);
}
开发者ID:Alkzndr,项目名称:freebsd,代码行数:43,代码来源:uninorthpci.c
示例4: sfxge_ifnet_init
static int
sfxge_ifnet_init(struct ifnet *ifp, struct sfxge_softc *sc)
{
const efx_nic_cfg_t *encp = efx_nic_cfg_get(sc->enp);
device_t dev;
int rc;
dev = sc->dev;
sc->ifnet = ifp;
if_initname(ifp, device_get_name(dev), device_get_unit(dev));
ifp->if_init = sfxge_if_init;
ifp->if_softc = sc;
ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
ifp->if_ioctl = sfxge_if_ioctl;
ifp->if_capabilities = SFXGE_CAP;
ifp->if_capenable = SFXGE_CAP_ENABLE;
ifp->if_hwassist = CSUM_TCP | CSUM_UDP | CSUM_IP | CSUM_TSO;
ether_ifattach(ifp, encp->enc_mac_addr);
#ifdef SFXGE_HAVE_MQ
ifp->if_transmit = sfxge_if_transmit;
ifp->if_qflush = sfxge_if_qflush;
#else
ifp->if_start = sfxge_if_start;
IFQ_SET_MAXLEN(&ifp->if_snd, SFXGE_NDESCS - 1);
ifp->if_snd.ifq_drv_maxlen = SFXGE_NDESCS - 1;
IFQ_SET_READY(&ifp->if_snd);
mtx_init(&sc->tx_lock, "txq", NULL, MTX_DEF);
#endif
if ((rc = sfxge_port_ifmedia_init(sc)) != 0)
goto fail;
return 0;
fail:
ether_ifdetach(sc->ifnet);
return rc;
}
开发者ID:AhmadTux,项目名称:freebsd,代码行数:43,代码来源:sfxge.c
示例5: ath_btcoex_attach
/*
* Attach btcoex to the given interface
*/
int
ath_btcoex_attach(struct ath_softc *sc)
{
int ret;
struct ath_hal *ah = sc->sc_ah;
const char *profname;
/*
* No chipset bluetooth coexistence? Then do nothing.
*/
if (! ath_hal_btcoex_supported(ah))
return (0);
/*
* Look at the hints to determine which bluetooth
* profile to configure.
*/
ret = resource_string_value(device_get_name(sc->sc_dev),
device_get_unit(sc->sc_dev),
"btcoex_profile",
&profname);
if (ret != 0) {
/* nothing to do */
return (0);
}
if (strncmp(profname, "wb195", 5) == 0) {
ret = ath_btcoex_cfg_wb195(sc);
} else if (strncmp(profname, "wb225", 5) == 0) {
ret = ath_btcoex_cfg_wb225(sc);
} else {
return (0);
}
/*
* Propagate up failure from the actual attach phase.
*/
if (ret != 0)
return (ret);
return (0);
}
开发者ID:mihaicarabas,项目名称:dragonfly,代码行数:45,代码来源:if_ath_btcoex.c
示例6: ar71xx_platform_create_cal_data
/*
* Create a calibration block from memory mapped SPI data for use by
* various drivers. Right now it's just ath(4) but later board support
* will include 802.11ac NICs with calibration data in NOR flash.
*
* (Yes, there are a handful of QCA MIPS boards with QCA9880v2 802.11ac chips
* with calibration data in flash..)
*/
static void
ar71xx_platform_create_cal_data(device_t dev, int id, long int flash_addr,
int size)
{
char buf[64];
uint16_t *cal_data = (uint16_t *) MIPS_PHYS_TO_KSEG1(flash_addr);
void *eeprom = NULL;
const struct firmware *fw = NULL;
device_printf(dev, "EEPROM firmware: 0x%lx @ %d bytes\n",
flash_addr, size);
eeprom = malloc(size, M_DEVBUF, M_WAITOK | M_ZERO);
if (! eeprom) {
device_printf(dev, "%s: malloc failed for '%s', aborting EEPROM\n",
__func__, buf);
return;
}
memcpy(eeprom, cal_data, size);
/*
* Generate a flash EEPROM 'firmware' from the given memory
* region. Since the SPI controller will eventually
* go into port-IO mode instead of memory-mapped IO
* mode, a copy of the EEPROM contents is required.
*/
snprintf(buf, sizeof(buf), "%s.%d.map.%d.eeprom_firmware",
device_get_name(dev),
device_get_unit(dev),
id);
fw = firmware_register(buf, eeprom, size, 1, NULL);
if (fw == NULL) {
device_printf(dev, "%s: firmware_register (%s) failed\n",
__func__, buf);
free(eeprom, M_DEVBUF);
return;
}
device_printf(dev, "device EEPROM '%s' registered\n", buf);
}
开发者ID:2trill2spill,项目名称:freebsd,代码行数:50,代码来源:ar71xx_caldata.c
示例7: ahci_attach
static int
ahci_attach (device_t dev)
{
struct ahci_softc *sc = device_get_softc(dev);
char name[16];
int error;
sc->sc_ad = ahci_lookup_device(dev);
if (sc->sc_ad == NULL)
return(ENXIO);
/*
* Some chipsets do not properly implement the AHCI spec and may
* require the link speed to be specifically requested.
*/
if (kgetenv("hint.ahci.force150"))
AhciForceGen = 1;
if (kgetenv("hint.ahci.force300"))
AhciForceGen = 2;
if (kgetenv("hint.ahci.force600"))
AhciForceGen = 3;
if (kgetenv("hint.ahci.nofeatures"))
AhciNoFeatures = -1;
if (kgetenv("hint.ahci.forcefbss"))
sc->sc_flags |= AHCI_F_FORCE_FBSS;
sysctl_ctx_init(&sc->sysctl_ctx);
ksnprintf(name, sizeof(name), "%s%d",
device_get_name(dev), device_get_unit(dev));
sc->sysctl_tree = SYSCTL_ADD_NODE(&sc->sysctl_ctx,
SYSCTL_STATIC_CHILDREN(_hw),
OID_AUTO, name, CTLFLAG_RD, 0, "");
error = sc->sc_ad->ad_attach(dev);
if (error) {
sysctl_ctx_free(&sc->sysctl_ctx);
sc->sysctl_tree = NULL;
}
return (error);
}
开发者ID:mihaicarabas,项目名称:dragonfly,代码行数:42,代码来源:ahci_dragonfly.c
示例8: sfxge_mcdi_exception
static void
sfxge_mcdi_exception(void *arg, efx_mcdi_exception_t eme)
{
struct sfxge_softc *sc;
device_t dev;
sc = (struct sfxge_softc *)arg;
dev = sc->dev;
log(LOG_WARNING, "[%s%d] MC_%s", device_get_name(dev),
device_get_unit(dev),
(eme == EFX_MCDI_EXCEPTION_MC_REBOOT)
? "REBOOT"
: (eme == EFX_MCDI_EXCEPTION_MC_BADASSERT)
? "BADASSERT" : "UNKNOWN");
EFSYS_PROBE(mcdi_exception);
sfxge_schedule_reset(sc);
}
开发者ID:dcui,项目名称:FreeBSD-9.3_kernel,代码行数:20,代码来源:sfxge_mcdi.c
示例9: chipc_probe_nomatch
static void
chipc_probe_nomatch(device_t dev, device_t child)
{
struct resource_list *rl;
const char *name;
name = device_get_name(child);
if (name == NULL)
name = "unknown device";
device_printf(dev, "<%s> at", name);
rl = BUS_GET_RESOURCE_LIST(dev, child);
if (rl != NULL) {
resource_list_print_type(rl, "mem", SYS_RES_MEMORY, "%#jx");
resource_list_print_type(rl, "irq", SYS_RES_IRQ, "%jd");
}
printf(" (no driver attached)\n");
}
开发者ID:wulf7,项目名称:freebsd,代码行数:20,代码来源:chipc.c
示例10: rlphy_probe
static int
rlphy_probe(device_t dev)
{
const char *nic;
int rv;
rv = mii_phy_dev_probe(dev, rlphys, BUS_PROBE_DEFAULT);
#ifdef __HAIKU__
if (rv == BUS_PROBE_DEFAULT)
return (rv);
#else
if (rv <= 0)
return (rv);
#endif
nic = device_get_name(device_get_parent(device_get_parent(dev)));
if (strcmp(nic, "rl") == 0 || strcmp(nic, "re") == 0)
return (mii_phy_dev_probe(dev, rlintphys, BUS_PROBE_DEFAULT));
return (ENXIO);
}
开发者ID:AmirAbrams,项目名称:haiku,代码行数:20,代码来源:rlphy.c
示例11: i80321_dma_attach
static int
i80321_dma_attach(device_t dev)
{
struct i80321_dma_softc *softc = device_get_softc(dev);
struct i80321_softc *sc = device_get_softc(device_get_parent(dev));
int unit = device_get_unit(dev);
i80321_dmadesc_t *dmadescs;
mtx_init(&softc->mtx, "DMA engine mtx", NULL, MTX_SPIN);
softc->sc_st = sc->sc_st;
if (bus_space_subregion(softc->sc_st, sc->sc_sh, unit == 0 ?
VERDE_DMA_BASE0 : VERDE_DMA_BASE1, VERDE_DMA_SIZE,
&softc->sc_dma_sh) != 0)
panic("%s: unable to subregion DMA registers",
device_get_name(dev));
if (bus_dma_tag_create(NULL, sizeof(i80321_dmadesc_t),
0, BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, NULL,
DMA_RING_SIZE * sizeof(i80321_dmadesc_t), 1,
sizeof(i80321_dmadesc_t), BUS_DMA_ALLOCNOW, busdma_lock_mutex,
&Giant, &softc->dmatag))
panic("Couldn't create a dma tag");
DMA_REG_WRITE(softc, 0, 0);
if (bus_dmamem_alloc(softc->dmatag, (void **)&dmadescs,
BUS_DMA_NOWAIT | BUS_DMA_COHERENT, &softc->dmaring[0].map))
panic("Couldn't alloc dma memory");
for (int i = 0; i < DMA_RING_SIZE; i++) {
if (i > 0)
if (bus_dmamap_create(softc->dmatag, 0,
&softc->dmaring[i].map))
panic("Couldn't alloc dmamap");
softc->dmaring[i].desc = &dmadescs[i];
bus_dmamap_load(softc->dmatag, softc->dmaring[i].map,
softc->dmaring[i].desc, sizeof(i80321_dmadesc_t),
i80321_mapphys, &softc->dmaring[i].phys_addr, 0);
}
softc->unit = unit;
softcs[unit] = softc;
_arm_memcpy = dma_memcpy;
_min_memcpy_size = 1024;
return (0);
}
开发者ID:BillTheBest,项目名称:libuinet,代码行数:41,代码来源:i80321_dma.c
示例12: confirm_request
static gboolean
confirm_request (DBusGMethodInvocation *context,
DBusGProxy *device,
guint pin,
gpointer user_data)
{
DBusGProxy *adapter = user_data;
char *name, *long_name, *line, *text;
name = device_get_name (device, &long_name);
if (name == NULL)
return FALSE;
text = g_strdup_printf("%d", pin);
confirm_dialog(adapter, device, name, long_name, text, context);
g_free(text);
g_free (long_name);
/* translators: this is a popup telling you a particular device
* has asked for pairing */
line = g_strdup_printf(_("Pairing confirmation for '%s'"), name);
g_free(name);
/* translators:
* This message is for Bluetooth 2.1 support, when the
* action is clicked in the notification popup, the user
* will get to check whether the PIN matches the one
* showing on the Bluetooth device */
if (notification_supports_actions () != FALSE)
show_notification(_("Bluetooth device"),
line, _("Verify PIN"), 0,
G_CALLBACK(notification_closed));
else
present_notification_dialogs ();
g_free(line);
return TRUE;
}
开发者ID:CopyKat,项目名称:mate-bluetooth,代码行数:41,代码来源:agent.c
示例13: init_uinput
static void init_uinput(struct control *control)
{
struct audio_device *dev = control->dev;
char address[18], name[248 + 1];
device_get_name(dev->btd_dev, name, sizeof(name));
if (g_str_equal(name, "Nokia CK-20W")) {
control->key_quirks[FORWARD_OP] |= QUIRK_NO_RELEASE;
control->key_quirks[BACKWARD_OP] |= QUIRK_NO_RELEASE;
control->key_quirks[PLAY_OP] |= QUIRK_NO_RELEASE;
control->key_quirks[PAUSE_OP] |= QUIRK_NO_RELEASE;
}
ba2str(&dev->dst, address);
control->uinput = uinput_create(address);
if (control->uinput < 0)
error("AVRCP: failed to init uinput for %s", address);
else
debug("AVRCP: uinput initialized for %s", address);
}
开发者ID:pocketbook-free,项目名称:bluez-4.62,代码行数:21,代码来源:control.c
示例14: nexus_alloc_resource
static struct resource *
nexus_alloc_resource(device_t bus, device_t child, int type, int *rid,
u_long start, u_long end, u_long count, u_int flags)
{
struct resource *rv;
struct rman *rm;
size_t i;
switch (type) {
case SYS_RES_MEMORY:
rm = &mem_rman;
break;
case SYS_RES_IRQ:
rm = &irq_rman;
break;
default:
return (NULL);
}
for (i = 0; i < rtems_bsd_nexus_device_count; ++i) {
const rtems_bsd_device *nd = &rtems_bsd_nexus_devices[i];
if (strcmp(device_get_name(child), nd->name) == 0
&& device_get_unit(child) == nd->unit) {
if (!nexus_get_start(nd, type, &start)) {
return (NULL);
};
} else {
return (NULL);
}
}
rv = rman_reserve_resource(rm, start, end, count, flags, child);
if (rv != NULL) {
rman_set_rid(rv, *rid);
rman_set_bushandle(rv, rman_get_start(rv));
}
return (rv);
}
开发者ID:scclancy,项目名称:rtems-libbsd,代码行数:40,代码来源:rtems-bsd-nexus.c
示例15: iicbus_attach
/*
* We add all the devices which we know about.
* The generic attach routine will attach them if they are alive.
*/
static int
iicbus_attach(device_t dev)
{
#if SCAN_IICBUS
unsigned char addr;
#endif
struct iicbus_softc *sc = IICBUS_SOFTC(dev);
int strict;
sc->dev = dev;
mtx_init(&sc->lock, "iicbus", NULL, MTX_DEF);
iicbus_init_frequency(dev, 0);
iicbus_reset(dev, IIC_FASTEST, 0, NULL);
if (resource_int_value(device_get_name(dev),
device_get_unit(dev), "strict", &strict) == 0)
sc->strict = strict;
else
sc->strict = 1;
/* device probing is meaningless since the bus is supposed to be
* hot-plug. Moreover, some I2C chips do not appreciate random
* accesses like stop after start to fast, reads for less than
* x bytes...
*/
#if SCAN_IICBUS
printf("Probing for devices on iicbus%d:", device_get_unit(dev));
/* probe any devices */
for (addr = 16; addr < 240; addr++) {
if (iic_probe_device(dev, (u_char)addr)) {
printf(" <%x>", addr);
}
}
printf("\n");
#endif
bus_generic_probe(dev);
bus_enumerate_hinted_children(dev);
bus_generic_attach(dev);
return (0);
}
开发者ID:FreeBSDFoundation,项目名称:freebsd,代码行数:44,代码来源:iicbus.c
示例16: ipmi_smbus_attach
static int
ipmi_smbus_attach(device_t dev)
{
struct ipmi_softc *sc = device_get_softc(dev);
struct ipmi_get_info info;
int error;
/* This should never fail. */
if (!ipmi_smbios_identify(&info))
return (ENXIO);
if (info.iface_type != SSIF_MODE) {
device_printf(dev, "No SSIF IPMI interface found\n");
return (ENXIO);
}
sc->ipmi_dev = dev;
if (info.irq != 0) {
sc->ipmi_irq_rid = 0;
sc->ipmi_irq_res = bus_alloc_resource(dev, SYS_RES_IRQ,
&sc->ipmi_irq_rid, info.irq, info.irq, 1,
RF_SHAREABLE | RF_ACTIVE);
}
device_printf(dev, "SSIF mode found at address 0x%llx on %s\n",
(long long)info.address, device_get_name(device_get_parent(dev)));
error = ipmi_ssif_attach(sc, device_get_parent(dev), info.address);
if (error)
goto bad;
error = ipmi_attach(dev);
if (error)
goto bad;
return (0);
bad:
ipmi_release_resources(dev);
return (error);
}
开发者ID:FreeBSDFoundation,项目名称:freebsd,代码行数:40,代码来源:ipmi_smbus.c
示例17: ata_pcichannel_attach
static int
ata_pcichannel_attach(device_t dev)
{
struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev));
struct ata_channel *ch = device_get_softc(dev);
int error;
if (ch->attached)
return (0);
ch->attached = 1;
ch->dev = dev;
ch->unit = (intptr_t)device_get_ivars(dev);
resource_int_value(device_get_name(dev),
device_get_unit(dev), "pm_level", &ch->pm_level);
if ((error = ctlr->ch_attach(dev)))
return error;
return ata_attach(dev);
}
开发者ID:coyizumi,项目名称:cs111,代码行数:22,代码来源:ata-pci.c
示例18: i80321_aau_attach
static int
i80321_aau_attach(device_t dev)
{
struct i80321_aau_softc *softc = device_get_softc(dev);
struct i80321_softc *sc = device_get_softc(device_get_parent(dev));
struct i80321_aaudesc_s *aaudescs;
mtx_init(&softc->mtx, "AAU mtx", NULL, MTX_SPIN);
softc->sc_st = sc->sc_st;
if (bus_space_subregion(softc->sc_st, sc->sc_sh, VERDE_AAU_BASE,
VERDE_AAU_SIZE, &softc->sc_aau_sh) != 0)
panic("%s: unable to subregion AAU registers",
device_get_name(dev));
if (bus_dma_tag_create(NULL, sizeof(i80321_aaudesc_t), 0,
BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, NULL,
AAU_RING_SIZE * sizeof(i80321_aaudesc_t),
1, sizeof(i80321_aaudesc_t), BUS_DMA_ALLOCNOW, busdma_lock_mutex,
&Giant, &softc->dmatag))
panic("Couldn't create a dma tag");
if (bus_dmamem_alloc(softc->dmatag, (void **)&aaudescs,
BUS_DMA_NOWAIT | BUS_DMA_COHERENT, &softc->aauring[0].map))
panic("Couldn't alloc dma memory");
for (int i = 0; i < AAU_RING_SIZE; i++) {
if (i > 0)
if (bus_dmamap_create(softc->dmatag, 0,
&softc->aauring[i].map))
panic("Couldn't create dma map");
softc->aauring[i].desc = &aaudescs[i];
bus_dmamap_load(softc->dmatag, softc->aauring[i].map,
softc->aauring[i].desc, sizeof(i80321_aaudesc_t),
i80321_mapphys, &softc->aauring[i].phys_addr, 0);
bzero(softc->aauring[i].desc, sizeof(i80321_aaudesc_t));
}
aau_softc = softc;
_arm_bzero = aau_bzero;
_min_bzero_size = 1024;
return (0);
}
开发者ID:MattDooner,项目名称:freebsd-west,代码行数:39,代码来源:i80321_aau.c
示例19: device_get_name
static struct hog_device *hog_device_new(struct btd_device *device,
struct gatt_primary *prim)
{
struct hog_device *dev;
char name[248];
uint16_t vendor, product, version;
if (device_name_known(device))
device_get_name(device, name, sizeof(name));
else
strcpy(name, "bluez-hog-device");
vendor = btd_device_get_vendor(device);
product = btd_device_get_product(device);
version = btd_device_get_version(device);
DBG("name=%s vendor=0x%X, product=0x%X, version=0x%X", name, vendor,
product, version);
dev = new0(struct hog_device, 1);
dev->device = btd_device_ref(device);
dev->hog = bt_hog_new_default(name, vendor, product, version, prim);
/*
* TODO: Remove attio callback and use .accept once using
* bt_gatt_client.
*/
dev->attioid = btd_device_add_attio_callback(device,
attio_connected_cb,
attio_disconnected_cb,
dev);
if (!devices)
devices = queue_new();
queue_push_tail(devices, dev);
return dev;
}
开发者ID:electrikjesus,项目名称:android_external_bluetooth_bluez,代码行数:39,代码来源:hog.c
示例20: saost_attach
static int
saost_attach(device_t dev)
{
struct saost_softc *sc = device_get_softc(dev);
struct sa11x0_softc *sa = device_get_softc(device_get_parent(dev));
sc->sc_dev = dev;
sc->sc_iot = sa->sc_iot;
sc->sc_baseaddr = 0x90000000;
saost_sc = sc;
if(bus_space_map(sa->sc_iot, sc->sc_baseaddr, 8, 0,
&sc->sc_ioh))
panic("%s: Cannot map registers", device_get_name(dev));
/* disable all channel and clear interrupt status */
bus_space_write_4(saost_sc->sc_iot, saost_sc->sc_ioh, SAOST_IR, 0);
bus_space_write_4(saost_sc->sc_iot, saost_sc->sc_ioh, SAOST_SR, 0xf);
return (0);
}
开发者ID:BillTheBest,项目名称:libuinet,代码行数:22,代码来源:sa11x0_ost.c
注:本文中的device_get_name函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论