Exemple #1
0
uint64_t
Write::GetSLBA() const
{
    uint64_t lba = 0;
    LOG_NRM("Getting SLBA");
    lba =  (((uint64_t)GetDword(10)) << 0);
    lba |= (((uint64_t)GetDword(11)) << 32);
    return lba;
}
Exemple #2
0
void CYahooProto::send_msg(const char *id, int protocol, const char *msg, int utf8)
{
	LOG(("[send_msg] Who: %s: protocol: %d Msg: '%s', utf: %d", id, protocol, msg, utf8));
	
	int buddy_icon = (GetDword("AvatarHash", 0) != 0) ? 2: 0;
	yahoo_send_im(m_id, NULL, id, protocol, msg, utf8, buddy_icon);
}
Exemple #3
0
void
CreateIOSQ::Init(const SharedIOSQPtr iosq)
{
    // Setup the PRP buffer based upon contig or non-contig memory
    int prpField = MASK_PRP1_PAGE;
    if (iosq->GetIsContig() == false)
        prpField |= MASK_PRP1_LIST;
    SetPrpBuffer((send_64b_bitmask)prpField, iosq->GetQBuffer(),
        iosq->GetQSize());

    {   // Handle DWORD 10
        uint32_t dword10 = GetDword(10);

        // Handle q size
        dword10 &= ~0xffff0000;
        dword10 |= (((uint32_t)iosq->GetNumEntries()) << 16);

        // Handle Q ID
        dword10 &= ~0x0000ffff;
        dword10 |= (uint32_t)iosq->GetQId();

        SetDword(dword10, 10);
    }   // Handle DWORD 10

    {   // Handle DWORD 11
        uint32_t dword11 = GetDword(11);

        // Handle the PC bit
        if (iosq->GetIsContig())
            dword11 |= 0x00000001;
        else
            dword11 &= ~0x00000001;

        // Handle Q priority
        dword11 &= ~0x00000006;
        dword11 |= (((uint32_t)iosq->GetPriority()) << 1);

        // Handle CQ ID
        dword11 &= ~0xffff0000;
        dword11 |= (((uint32_t)iosq->GetCqId()) << 16);

        SetDword(dword11, 11);
    }   // Handle DWORD 11
}
Exemple #4
0
uint32 SOMFRecordPointer::GetNumeric(){
   // Read word or dword, depending on record type even or odd
   if (Type & 1) {
      // Odd record type. Number is 32 bits
      return GetDword();
   }
   else {
      // Even record type. Number is 16 bit s
      return GetWord();
   }
}
Exemple #5
0
uint32 SOMFRecordPointer::GetLength() {
   // Read 1, 2, 3 or 4 bytes, depending on value of first byte
   uint32 x = GetByte();
   switch (x) {
   case 0x81: // 16-bit value
      return GetWord();
   case 0x82: // 24-bit value
      x = GetWord();
      return (GetByte() << 16) + x;
   case 0x84: // 32-bit value
      return GetDword();
   default: // 8-bit value
      if (x > 0x80) err.submit(1203);
      return x;
   }
}
Exemple #6
0
int		FwdnWriteNandFirmware( unsigned char *pucRomBuffer, unsigned uFWSize )
{
	int res = 0;

#if defined(TNFTL_V8_INCLUDE)
	res = NAND_WriteFirmware(0,pucRomBuffer,uFWSize);
#else
	{
		U32 nSecureMode;
		U8 FlagofNewSizeBigger;
		unsigned int i;
		unsigned long ulBaseAddress = GetDword(&pucRomBuffer[ROM_FIRMWARE_BASE_OFFSET]);
		unsigned long ulNandLoaderOffset = GetDword(&pucRomBuffer[ROM_BL1_NAND_OFFSET]) - ulBaseAddress;
		unsigned long ulMemInitCodeOffset = GetDword(&pucRomBuffer[ROM_CONFIG_CODE_START_OFFSET]) - ulBaseAddress;
		unsigned int uiMemInitCodeSize = GetDword(&pucRomBuffer[ROM_CONFIG_CODE_END_OFFSET]) - GetDword(&pucRomBuffer[ROM_CONFIG_CODE_START_OFFSET]);

	    //===============================================================
	    //	Check Size and Prepare Buffer
	    //===============================================================
	    if ( uFWSize > gMAX_ROMSIZE )
		    return ERR_FWUG_FAIL_ROMFILESIZEBIG;

	    // NAND BOOT Only Mode Set
	    #ifdef NANDBOOTONLY_MODE
	    FWUG_NAND_SetEnableNandBootOnlyMode( ENABLE );
	    FWUG_NAND_SetNBAreaEndPBAdd(40);
	    #endif

	    //===============================================================
	    //	Write Code
	    //===============================================================
	    /* Setting Intial Parameters */
	    FWUG_NAND_SetFlagCopyExistingRom( DISABLE );
	    FWUG_NAND_SetEnableNandBootOnlyMode( ENABLE );
	    FWUG_NAND_SetNBAreaEndPBAdd(TNFTL_MAX_BLOCK_NUM_OF_NBAREA);
	    FWUG_NAND_PreMemInitCode( &pucRomBuffer[ulMemInitCodeOffset], uiMemInitCodeSize );	//Mem Init Code Setting

	    nSecureMode	= FWUG_NAND_GetFlagOfUseSecureMode();

	    /* PreProcess before write code */
	    if (( res = FWUG_NAND_PreProcess( uFWSize, &FlagofNewSizeBigger )) != SUCCESS )
		    return res;

	    /* Write CODE Data */
	    for ( i = 0 ; i < 2; ++i )
	    {
		    unsigned int srcAddr;
		    //unsigned uRemainSize = uFWSize;
			U8 GMC_Num;
			U32 nStBlockOffSet,nStPageOffSet;

		    srcAddr = 0;

		    if ( FlagofNewSizeBigger == TRUE )
			    GMC_Num = ( i == 0 ) ? FIRST : SECOND;
		    else
			    GMC_Num = ( i == 0 ) ? SECOND : FIRST;

		    if (( res = FWUG_NAND_WriteCodePreProcess( GMC_Num, uFWSize, &nStBlockOffSet, &nStPageOffSet, nSecureMode )) != SUCCESS )
			    return res;

		    //while ((int)uRemainSize > 0)
		    {
			    //unsigned int percent;
				U32 uReadSize,dwBlockOffSet,dwPageOffSet;

			    //percent = (srcAddr/(uFWSize/50));
			    //if( i == 1 )
				//    percent += 50;
			    //uReadSize = ( uRemainSize >= uiBufSize ) ? uiBufSize : uRemainSize;
				uReadSize = uFWSize;

			    if (( res = FWUG_NAND_WriteCodeNAND( GMC_Num, nStBlockOffSet, nStPageOffSet, (unsigned char* )(ROMFILE_TEMP_BUFFER + srcAddr), uReadSize, &dwBlockOffSet, &dwPageOffSet, nSecureMode )) != SUCCESS )
				    return res;

			    srcAddr += uReadSize;

			    nStBlockOffSet = dwBlockOffSet;
			    nStPageOffSet  = dwPageOffSet;
			    //uRemainSize	-= uReadSize;
		    }

		    if (( res = FWUG_NAND_WriteCodePostProcess( GMC_Num, nStBlockOffSet, nStPageOffSet )) != SUCCESS )
			    return res;
		}

		/* PostProcess after write code */
		{
			#ifdef _LINUX_
			unsigned char 	nSerialNumBuf[512]__attribute__((aligned(8)));
			#else
			unsigned char 	nSerialNumBuf[512];
			#endif

			FWDN_FNT_InsertSN( nSerialNumBuf );
			if (( res = FWUG_NAND_PostProcess( nSerialNumBuf, g_uiFWDN_WriteSNFlag, nSecureMode )) != SUCCESS )
				return res;
		}
	}
#endif

	return res;
}
uint32_t
SetFeatures::GetArbitration() const
{
    LOG_NRM("Getting cmd arbitration");
    return GetDword(11);
}
uint32_t
SetFeatures::GetIntVecConfig() const
{
    LOG_NRM("Getting interrupt vector configuration");
    return GetDword(11);
}
uint32_t
SetFeatures::GetIntCoalescing() const
{
    LOG_NRM("Getting interrupt coalescing (TIME|THR)");
    return GetDword(11);
}
uint32_t
SetFeatures::GetNumberOfQueues() const
{
    LOG_NRM("Getting Set Features(Number of Queues)");
    return GetDword(11);
}
Exemple #11
0
uint32_t
Write::GetILBRT() const
{
    LOG_NRM("Getting ILBRT");
    return GetDword(13);
}
Exemple #12
0
void
CreateIOCQ::Init(const SharedIOCQPtr iocq)
{
    // Setup the PRP buffer based upon contig or non-contig memory
    int prpField = MASK_PRP1_PAGE;
    if (iocq->GetIsContig() == false)
        prpField |= MASK_PRP1_LIST;
    SetPrpBuffer((send_64b_bitmask)prpField, iocq->GetQBuffer(),
        iocq->GetQSize());

    {   // Handle DWORD 10
        uint32_t dword10 = GetDword(10);

        // Handle q size
        dword10 &= ~0xffff0000;
        dword10 |= (((uint32_t)(iocq->GetNumEntries() - 1)) << 16);

        // Handle Q ID
        dword10 &= ~0x0000ffff;
        dword10 |= (uint32_t)iocq->GetQId();

        SetDword(dword10, 10);
    }   // Handle DWORD 10

    {   // Handle DWORD 11
        uint32_t dword11 = GetDword(11);

        // Handle the PC bit
        if (iocq->GetIsContig())
            dword11 |= 0x00000001;
        else
            dword11 &= ~0x00000001;

        // Handle IRQ support
        if (iocq->GetIrqEnabled()) {
            dword11 |=  0x00000002;
            dword11 &= ~0xffff0000;    // clear it, then set it

            enum nvme_irq_type irq;
            uint16_t numIrqs;
            if (gCtrlrConfig->GetIrqScheme(irq, numIrqs) == false)
                throw FrmwkEx(HERE, "Unable to retrieve current IRQ scheme");

            switch (irq) {
            case INT_MSI_MULTI:
            case INT_MSIX:
                dword11 |= (((uint32_t)iocq->GetIrqVector()) << 16);
                break;
            case INT_MSI_SINGLE:
            case INT_NONE:
                ;   // Required to be zero
                break;
            default:
                throw FrmwkEx(HERE, "Unsupported IRQ scheme, what to do?");
            }
        } else {
            dword11 &= ~0x00000002;
            dword11 &= ~0xffff0000;
        }

        SetDword(dword11, 11);
    }   // Handle DWORD 11
}