/* * Description: * save some important register's value, then do reset, then restore register's value * * Parameters: * In: * dwIoBase - Base Address for MAC * Out: * none * * Return Value: true if success; otherwise false * */ bool MACbSafeSoftwareReset(void __iomem *dwIoBase) { unsigned char abyTmpRegData[MAC_MAX_CONTEXT_SIZE_PAGE0+MAC_MAX_CONTEXT_SIZE_PAGE1]; bool bRetVal; // PATCH.... // save some important register's value, then do // reset, then restore register's value // save MAC context MACvSaveContext(dwIoBase, abyTmpRegData); // do reset bRetVal = MACbSoftwareReset(dwIoBase); // restore MAC context, except CR0 MACvRestoreContext(dwIoBase, abyTmpRegData); return bRetVal; }
/* * Description: * save some important register's value, then do reset, then restore * register's value * * Parameters: * In: * io_base - Base Address for MAC * Out: * none * * Return Value: true if success; otherwise false * */ bool MACbSafeSoftwareReset(struct vnt_private *priv) { unsigned char abyTmpRegData[MAC_MAX_CONTEXT_SIZE_PAGE0 + MAC_MAX_CONTEXT_SIZE_PAGE1]; bool bRetVal; /* PATCH.... * save some important register's value, then do * reset, then restore register's value */ /* save MAC context */ MACvSaveContext(priv, abyTmpRegData); /* do reset */ bRetVal = MACbSoftwareReset(priv); /* restore MAC context, except CR0 */ MACvRestoreContext(priv, abyTmpRegData); return bRetVal; }