kernels/linux-2.4.0/drivers/ieee1394/aic5800.c
/* moved out to make interrupt routine more readable */
moved out to make interrupt routine more readable
moved out to make interrupt routine more readable
inline static void handle_selfid(struct aic5800 *aic, struct hpsb_host *host,
                          int phyid, int isroot, size_t size)
{
    quadlet_t *q = aic->rcv_page;
    quadlet_t lsid;
    lsid = generate_own_selfid(aic, phyid);
    if (size==8) {
	hpsb_selfid_received(host, lsid);
    }
    while (size > 0) {
	if (q[0] == 0xe0) {
	    q += 1;
	    size -= 4;
	    continue;
	};
	if (q[0] == 0x1) {
	    q += 1;
	    size -= 4;
	    break;
	};
	if (q[0] == ~q[1]) {
	    if ((q[0] & 0x3f800000) == ((phyid + 1) << 24)) {
		hpsb_selfid_received(host, lsid);
	    }
	    aic->id, "selfid packet 0x%x rcvd", q[0]);
	    hpsb_selfid_received(host, q[0]);
	    q += 2;
	    size -= 8;
	    continue;
	};
    }
    if (isroot && phyid != 0) {
	hpsb_selfid_received(host, lsid);
    }
    hpsb_selfid_complete(host, phyid, isroot);
}
inline static void handle_selfid ( struct aic5800 * aic , struct hpsb_host * host , int phyid , int isroot , size_t size ) { quadlet_t * q = aic -> rcv_page ; quadlet_t lsid ; lsid = generate_own_selfid ( aic , phyid ) ; if ( size == 8 ) { hpsb_selfid_received ( host , lsid ) ; } while ( size > 0 ) { if ( q [ 0 ] == 0xe0 ) { q += 1 ; size -= 4 ; continue ; } ; if ( q [ 0 ] == 0x1 ) { q += 1 ; size -= 4 ; break ; } ; if ( q [ 0 ] == ~ q [ 1 ] ) { if ( ( q [ 0 ] & 0x3f800000 ) == ( ( phyid + 1 ) << 24 ) ) { hpsb_selfid_received ( host , lsid ) ; } hpsb_selfid_received ( host , q [ 0 ] ) ; q += 2 ; size -= 8 ; continue ; } ; } if ( isroot && phyid != 0 ) { hpsb_selfid_received ( host , lsid ) ; } hpsb_selfid_complete ( host , phyid , isroot ) ; }
moved out to make interrupt routine more readable
moved out to make interrupt routine more readable
/* we need our own self-id packet */ /* unconnected state? only begin and end marker in rcv_page */ /* process buffer... AIC's FIFO often contains some strangenesses */ /* marker */ /* marker */ /* correct self-id */ /* its our turn now! */ //PRINT(KERN_INFO,  //      aic->id, "selfid packet 0x%x included", lsid); //PRINT(KERN_INFO, aic->id, "selfid packet 0x%x rcvd", q[0]); /* if we are root, our self-id packet is last */