コード例 #1
0
ファイル: nx1394.c プロジェクト: andreiw/polaris
/*
 * nx1394_dma_allochdl()
 *    Merges the ddi_dma_attr_t passed in by the target (using
 *    ddi_dma_alloc_handle() call) with that of the hal and passes the alloc
 *    handle request up the device by calling ddi_dma_allochdl().
 */
static int
nx1394_dma_allochdl(dev_info_t *dip, dev_info_t *rdip, ddi_dma_attr_t *attr,
    int (*waitfnp)(caddr_t), caddr_t arg, ddi_dma_handle_t *handlep)
{
	s1394_hal_t *hal;
	ddi_dma_attr_t *hal_attr;
	int status;

	_NOTE(SCHEME_PROTECTS_DATA("unique (per thread)", ddi_dma_attr_t))

	TNF_PROBE_0_DEBUG(nx1394_dma_allochdl_enter, S1394_TNF_SL_NEXUS_STACK,
	    "");

	/*
	 * If hal calls ddi_dma_alloc_handle, dip == rdip == hal dip.
	 * Unfortunately, we cannot verify this (by way of looking up for hal
	 * dip) here because h1394_attach() may happen much later.
	 */
	if (dip != rdip) {
		hal = s1394_dip_to_hal(ddi_get_parent(rdip));
		ASSERT(hal);
		hal_attr = &hal->halinfo.dma_attr;
		ASSERT(hal_attr);
		ddi_dma_attr_merge(attr, hal_attr);
	}
	status = ddi_dma_allochdl(dip, rdip, attr, waitfnp, arg, handlep);
	TNF_PROBE_1_DEBUG(nx1394_dma_allochdl_exit, S1394_TNF_SL_NEXUS_STACK,
	    "", tnf_int, status, status);
	return (status);
}
コード例 #2
0
static int	wusb_df_reconnect_callback(dev_info_t *);
static void	wusb_df_restore_device_state(dev_info_t *, wusb_df_state_t *);
static int	wusb_df_cpr_suspend(dev_info_t *);
static void	wusb_df_cpr_resume(dev_info_t *);
static void	wusb_df_pm_busy_component(wusb_df_state_t *);
static void	wusb_df_pm_idle_component(wusb_df_state_t *);
static int	wusb_df_power(dev_info_t *, int, int);
static void	wusb_df_init_power_mgmt(wusb_df_state_t *);
static void	wusb_df_destroy_power_mgmt(wusb_df_state_t *);
static int	wusb_df_serialize_access(wusb_df_state_t *, boolean_t);
static void	wusb_df_release_access(wusb_df_state_t *);
static int	wusb_df_firmware_download(wusb_df_state_t *wusbp);


/* _NOTE is an advice for locklint.  Locklint checks lock use for deadlocks. */
_NOTE(SCHEME_PROTECTS_DATA("unique per call", usb_ctrl_req))
_NOTE(SCHEME_PROTECTS_DATA("unique per call", buf))

/* module loading stuff */
struct cb_ops wusb_df_cb_ops = {
	nodev,			/* open  */
	nodev,  		/* close */
	nodev,			/* strategy */
	nulldev,		/* print */
	nulldev,		/* dump */
	nodev,			/* read */
	nodev,			/* write */
	nodev,			/* ioctl */
	nulldev,		/* devmap */
	nodev,			/* mmap */
	nodev,			/* segmap */
コード例 #3
0
ファイル: ibcm_arp_link.c プロジェクト: apprisi/illumos-gate
 * Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
 * Use is subject to license terms.
 */

#include <sys/types.h>
#include <net/if.h>
#include <net/if_types.h>
#include <inet/ip.h>
#include <inet/ip_ire.h>
#include <inet/ip_if.h>
#include <sys/ethernet.h>
#include <sys/ib/mgt/ibcm/ibcm_arp.h>

extern char cmlog[];

_NOTE(SCHEME_PROTECTS_DATA("Unshared data", ibcm_arp_streams_t))

static void ibcm_resolver_ack(ip2mac_t *, void *);
static int ibcm_nce_lookup(ibcm_arp_prwqn_t *wqnp, ill_t *ill, zoneid_t zid);

/*
 * delete a wait queue node from the list.
 * assumes mutex is acquired
 */
void
ibcm_arp_delete_prwqn(ibcm_arp_prwqn_t *wqnp)
{
	ibcm_arp_streams_t *ib_s;

	IBTF_DPRINTF_L4(cmlog, "ibcm_arp_delete_prwqn(%p)", wqnp);
コード例 #4
0
ファイル: ibcm_arp.c プロジェクト: apprisi/illumos-gate
#include <sys/pathname.h>

#include <sys/ib/mgt/ibcm/ibcm_arp.h>

#include <sys/kstr.h>
#include <sys/t_kuser.h>

#include <sys/dls.h>

extern char cmlog[];

extern int ibcm_resolver_pr_lookup(ibcm_arp_streams_t *ib_s,
    ibt_ip_addr_t *dst_addr, ibt_ip_addr_t *src_addr, zoneid_t myzoneid);
extern void ibcm_arp_delete_prwqn(ibcm_arp_prwqn_t *wqnp);

_NOTE(SCHEME_PROTECTS_DATA("Unshared data", ibt_ip_addr_s))
_NOTE(SCHEME_PROTECTS_DATA("Unshared data", ibcm_arp_ip_t))
_NOTE(SCHEME_PROTECTS_DATA("Unshared data", ibcm_arp_ibd_insts_t))
_NOTE(SCHEME_PROTECTS_DATA("Unshared data", ibcm_arp_prwqn_t))
_NOTE(SCHEME_PROTECTS_DATA("Unshared data", sockaddr_in))
_NOTE(SCHEME_PROTECTS_DATA("Unshared data", sockaddr_in6))

int ibcm_printip = 0;

/*
 * Function:
 *	ibcm_ip_print
 * Input:
 *	label		Arbitrary qualifying string
 *	ipa		Pointer to IP Address to print
 */
コード例 #5
0
ファイル: sdev_vtops.c プロジェクト: apprisi/illumos-gate
#include <sys/types.h>
#include <sys/param.h>
#include <sys/sysmacros.h>
#include <sys/sunndi.h>
#include <fs/fs_subr.h>
#include <sys/fs/dv_node.h>
#include <sys/fs/sdev_impl.h>
#include <sys/policy.h>
#include <sys/stat.h>
#include <sys/vfs_opreg.h>
#include <sys/tty.h>
#include <sys/vt_impl.h>
#include <sys/note.h>

/* warlock in this file only cares about variables shared by vt and devfs */
_NOTE(SCHEME_PROTECTS_DATA("Do not care", sdev_node vattr vnode))

#define	DEVVT_UID_DEFAULT	SDEV_UID_DEFAULT
#define	DEVVT_GID_DEFAULT	(0)
#define	DEVVT_DEVMODE_DEFAULT	(0600)
#define	DEVVT_ACTIVE_NAME	"active"
#define	DEVVT_CONSUSER_NAME	"console_user"

#define	isdigit(ch)	((ch) >= '0' && (ch) <= '9')

/* attributes for VT nodes */
static vattr_t devvt_vattr = {
	AT_TYPE|AT_MODE|AT_UID|AT_GID,		/* va_mask */
	VCHR,					/* va_type */
	S_IFCHR | DEVVT_DEVMODE_DEFAULT,	/* va_mode */
	DEVVT_UID_DEFAULT,			/* va_uid */
コード例 #6
0
	uchar_t	encVen[1];
} SesEncDesc;

typedef struct {
	uchar_t	enc_type;		/* type of element */
	uchar_t	enc_maxelt;		/* maximum supported */
	uchar_t	enc_subenc;		/* in SubEnc # N */
	uchar_t	enc_tlen;		/* Type Descriptor Text Length */
} SesThdr;

typedef struct {
	uchar_t	comstatus;
	uchar_t	comstat[3];
} SesComStat;
#if	!defined(lint)
_NOTE(SCHEME_PROTECTS_DATA("because I said so", SesComStat))
#endif

struct typidx {
	int ses_tidx;
	int ses_oidx;
};
#if	!defined(lint)
_NOTE(SCHEME_PROTECTS_DATA("because I said so", typidx))
#endif

struct sscfg {
	uchar_t ses_ntypes;	/* total number of types supported */

	/*
	 * We need to keep a type index as well as an object index
コード例 #7
0
ファイル: nlist.c プロジェクト: AlainODea/illumos-gate
			}
		}
		break;
		/*
		 * Currently there is only one symbol table section
		 * in an object file, but this restriction may be
		 * relaxed in the future.
		 */
	}
	(void) elf_end(elfdes);
	(void) close(fd);
	return (0);
}


NOTE(SCHEME_PROTECTS_DATA("user provides buffers", nlist))

int
nlist(const char * name, struct nlist * list)
{
	register struct nlist *p;
	char magic_buf[EI_NIDENT];
	int fd;

	for (p = list; p->n_name && p->n_name[0]; p++) { /* n_name can be ptr */
		p->n_type = 0;
		p->n_value = 0L;
		p->n_scnum = 0;
		p->n_sclass = 0;
		p->n_numaux = 0;
	}
コード例 #8
0
ファイル: uwba.c プロジェクト: MatiasNAmendola/AuroraUX-SunOS
/* list for uwba_dev, the radio host devices */
static list_t	uwba_dev_list;

/* modload support */
extern struct mod_ops mod_miscops;

static struct modlmisc modlmisc	= {
	&mod_miscops,	/* Type	of module */
	"UWBA: UWB Architecture"
};

static struct modlinkage modlinkage = {
	MODREV_1, (void	*)&modlmisc, NULL
};

_NOTE(SCHEME_PROTECTS_DATA("unique per call", uwba_client_dev))
_NOTE(SCHEME_PROTECTS_DATA("unique per call", uwb_notif_wrapper))
/* This table is for data decode */
uwba_evt_size_t uwba_evt_size_table[] = {
	[UWB_NOTIF_IE_RECEIVED] = {
		.struct_len = UWB_RESULT_CODE_SIZE,
		.buf_len_offset	= 6
	},
	[UWB_NOTIF_BEACON_RECEIVED] = {
		.struct_len = sizeof (uwb_rceb_beacon_t),
		.buf_len_offset	= UWB_BEACONINFOLEN_OFFSET
	},
	[UWB_NOTIF_BEACON_SIZE_CHANGE] = {
		.struct_len = sizeof (uwb_rceb_beacon_size_change_t),
		.buf_len_offset	= UWB_EVT_NO_BUF_LEN_OFFSET
	},