예제 #1
0
/*
 * hub_setup_prb(nasid, prbnum, credits, conveyor)
 *
 * 	Put a PRB into fire-and-forget mode if conveyor isn't set.  Otherwise,
 * 	put it into conveyor belt mode with the specified number of credits.
 */
static void hub_setup_prb(nasid_t nasid, int prbnum, int credits)
{
	iprb_t prb;
	int prb_offset;

	/*
	 * Get the current register value.
	 */
	prb_offset = IIO_IOPRB(prbnum);
	prb.iprb_regval = REMOTE_HUB_L(nasid, prb_offset);

	/*
	 * Clear out some fields.
	 */
	prb.iprb_ovflow = 1;
	prb.iprb_bnakctr = 0;
	prb.iprb_anakctr = 0;

	/*
	 * Enable or disable fire-and-forget mode.
	 */
	prb.iprb_ff = force_fire_and_forget ? 1 : 0;

	/*
	 * Set the appropriate number of PIO cresits for the widget.
	 */
	prb.iprb_xtalkctr = credits;

	/*
	 * Store the new value to the register.
	 */
	REMOTE_HUB_S(nasid, prb_offset, prb.iprb_regval);
}
예제 #2
0
파일: io.c 프로젝트: dot-Sean/linux_kernels
/*
 * hub_setup_prb(nasid, prbnum, credits, conveyor)
 *
 * 	Put a PRB into fire-and-forget mode if conveyor isn't set.  Otehrwise,
 * 	put it into conveyor belt mode with the specified number of credits.
 */
void
hub_setup_prb(nasid_t nasid, int prbnum, int credits, int conveyor)
{
    iprb_t prb;
    int prb_offset;
#ifdef IRIX
    extern int force_fire_and_forget;
    extern volatile int ignore_conveyor_override;

    if (force_fire_and_forget && !ignore_conveyor_override)
        if (conveyor == HUB_PIO_CONVEYOR)
            conveyor = HUB_PIO_FIRE_N_FORGET;
#endif

    /*
     * Get the current register value.
     */
    prb_offset = IIO_IOPRB(prbnum);
    prb.iprb_regval = REMOTE_HUB_L(nasid, prb_offset);

    /*
     * Clear out some fields.
     */
    prb.iprb_ovflow = 1;
    prb.iprb_bnakctr = 0;
    prb.iprb_anakctr = 0;

    /*
     * Enable or disable fire-and-forget mode.
     */
    prb.iprb_ff = ((conveyor == HUB_PIO_CONVEYOR) ? 0 : 1);

    /*
     * Set the appropriate number of PIO cresits for the widget.
     */
    prb.iprb_xtalkctr = credits;

    /*
     * Store the new value to the register.
     */
    REMOTE_HUB_S(nasid, prb_offset, prb.iprb_regval);
}