|  | @@ -294,6 +294,11 @@ static unsigned long phantom_crb_access_2m ( struct phantom_nic *phantom,
 | 
		
	
		
			
			| 294 | 294 |  		{ UNM_CRB_BLK_CAM,	0x416 },
 | 
		
	
		
			
			| 295 | 295 |  		{ UNM_CRB_BLK_ROMUSB,	0x421 },
 | 
		
	
		
			
			| 296 | 296 |  		{ UNM_CRB_BLK_TEST,	0x295 },
 | 
		
	
		
			
			|  | 297 | +		{ UNM_CRB_BLK_PEG_0,	0x340 },
 | 
		
	
		
			
			|  | 298 | +		{ UNM_CRB_BLK_PEG_1,	0x341 },
 | 
		
	
		
			
			|  | 299 | +		{ UNM_CRB_BLK_PEG_2,	0x342 },
 | 
		
	
		
			
			|  | 300 | +		{ UNM_CRB_BLK_PEG_3,	0x343 },
 | 
		
	
		
			
			|  | 301 | +		{ UNM_CRB_BLK_PEG_4,	0x34b },
 | 
		
	
		
			
			| 297 | 302 |  	};
 | 
		
	
		
			
			| 298 | 303 |  	unsigned int block = UNM_CRB_BLK ( reg );
 | 
		
	
		
			
			| 299 | 304 |  	unsigned long offset = UNM_CRB_OFFSET ( reg );
 | 
		
	
	
		
			
			|  | @@ -1687,6 +1692,39 @@ static int phantom_read_flash ( struct phantom_nic *phantom ) {
 | 
		
	
		
			
			| 1687 | 1692 |  	return 0;
 | 
		
	
		
			
			| 1688 | 1693 |  }
 | 
		
	
		
			
			| 1689 | 1694 |  
 | 
		
	
		
			
			|  | 1695 | +/**
 | 
		
	
		
			
			|  | 1696 | + * Halt all PEGs
 | 
		
	
		
			
			|  | 1697 | + *
 | 
		
	
		
			
			|  | 1698 | + * @v phantom		Phantom NIC
 | 
		
	
		
			
			|  | 1699 | + */
 | 
		
	
		
			
			|  | 1700 | +static void phantom_halt_pegs ( struct phantom_nic *phantom ) {
 | 
		
	
		
			
			|  | 1701 | +	phantom_writel ( phantom, 1, UNM_PEG_0_HALT );
 | 
		
	
		
			
			|  | 1702 | +	phantom_writel ( phantom, 1, UNM_PEG_1_HALT );
 | 
		
	
		
			
			|  | 1703 | +	phantom_writel ( phantom, 1, UNM_PEG_2_HALT );
 | 
		
	
		
			
			|  | 1704 | +	phantom_writel ( phantom, 1, UNM_PEG_3_HALT );
 | 
		
	
		
			
			|  | 1705 | +	phantom_writel ( phantom, 1, UNM_PEG_4_HALT );
 | 
		
	
		
			
			|  | 1706 | +}
 | 
		
	
		
			
			|  | 1707 | +
 | 
		
	
		
			
			|  | 1708 | +/**
 | 
		
	
		
			
			|  | 1709 | + * Unhalt all PEGs
 | 
		
	
		
			
			|  | 1710 | + *
 | 
		
	
		
			
			|  | 1711 | + * @v phantom		Phantom NIC
 | 
		
	
		
			
			|  | 1712 | + */
 | 
		
	
		
			
			|  | 1713 | +static void phantom_unhalt_pegs ( struct phantom_nic *phantom ) {
 | 
		
	
		
			
			|  | 1714 | +	uint32_t halt_status;
 | 
		
	
		
			
			|  | 1715 | +
 | 
		
	
		
			
			|  | 1716 | +	halt_status = phantom_readl ( phantom, UNM_PEG_0_HALT_STATUS );
 | 
		
	
		
			
			|  | 1717 | +	phantom_writel ( phantom, halt_status, UNM_PEG_0_HALT_STATUS );
 | 
		
	
		
			
			|  | 1718 | +	halt_status = phantom_readl ( phantom, UNM_PEG_1_HALT_STATUS );
 | 
		
	
		
			
			|  | 1719 | +	phantom_writel ( phantom, halt_status, UNM_PEG_1_HALT_STATUS );
 | 
		
	
		
			
			|  | 1720 | +	halt_status = phantom_readl ( phantom, UNM_PEG_2_HALT_STATUS );
 | 
		
	
		
			
			|  | 1721 | +	phantom_writel ( phantom, halt_status, UNM_PEG_2_HALT_STATUS );
 | 
		
	
		
			
			|  | 1722 | +	halt_status = phantom_readl ( phantom, UNM_PEG_3_HALT_STATUS );
 | 
		
	
		
			
			|  | 1723 | +	phantom_writel ( phantom, halt_status, UNM_PEG_3_HALT_STATUS );
 | 
		
	
		
			
			|  | 1724 | +	halt_status = phantom_readl ( phantom, UNM_PEG_4_HALT_STATUS );
 | 
		
	
		
			
			|  | 1725 | +	phantom_writel ( phantom, halt_status, UNM_PEG_4_HALT_STATUS );
 | 
		
	
		
			
			|  | 1726 | +}
 | 
		
	
		
			
			|  | 1727 | +
 | 
		
	
		
			
			| 1690 | 1728 |  /**
 | 
		
	
		
			
			| 1691 | 1729 |   * Initialise the Phantom command PEG
 | 
		
	
		
			
			| 1692 | 1730 |   *
 | 
		
	
	
		
			
			|  | @@ -1709,6 +1747,11 @@ static int phantom_init_cmdpeg ( struct phantom_nic *phantom ) {
 | 
		
	
		
			
			| 1709 | 1747 |  	if ( cmdpeg_state == UNM_NIC_REG_CMDPEG_STATE_INITIALIZE_ACK ) {
 | 
		
	
		
			
			| 1710 | 1748 |  		DBGC ( phantom, "Phantom %p command PEG already initialized\n",
 | 
		
	
		
			
			| 1711 | 1749 |  		       phantom );
 | 
		
	
		
			
			|  | 1750 | +		/* Unhalt the PEGs.  Previous firmware (e.g. BOFM) may
 | 
		
	
		
			
			|  | 1751 | +		 * have halted the PEGs to prevent internal bus
 | 
		
	
		
			
			|  | 1752 | +		 * collisions when the BIOS re-reads the expansion ROM.
 | 
		
	
		
			
			|  | 1753 | +		 */
 | 
		
	
		
			
			|  | 1754 | +		phantom_unhalt_pegs ( phantom );
 | 
		
	
		
			
			| 1712 | 1755 |  		return 0;
 | 
		
	
		
			
			| 1713 | 1756 |  	}
 | 
		
	
		
			
			| 1714 | 1757 |  
 | 
		
	
	
		
			
			|  | @@ -1942,6 +1985,7 @@ static int phantom_probe ( struct pci_device *pci,
 | 
		
	
		
			
			| 1942 | 1985 |  	for ( ; i >= 0 ; i-- )
 | 
		
	
		
			
			| 1943 | 1986 |  		unregister_netdev ( phantom->netdev[i] );
 | 
		
	
		
			
			| 1944 | 1987 |   err_init_rcvpeg:
 | 
		
	
		
			
			|  | 1988 | +	phantom_halt_pegs ( phantom );
 | 
		
	
		
			
			| 1945 | 1989 |   err_init_cmdpeg:
 | 
		
	
		
			
			| 1946 | 1990 |  	free_dma ( phantom->dma_buf, sizeof ( *(phantom->dma_buf) ) );
 | 
		
	
		
			
			| 1947 | 1991 |  	phantom->dma_buf = NULL;
 | 
		
	
	
		
			
			|  | @@ -1970,6 +2014,7 @@ static void phantom_remove ( struct pci_device *pci ) {
 | 
		
	
		
			
			| 1970 | 2014 |  
 | 
		
	
		
			
			| 1971 | 2015 |  	for ( i = ( phantom->num_ports - 1 ) ; i >= 0 ; i-- )
 | 
		
	
		
			
			| 1972 | 2016 |  		unregister_netdev ( phantom->netdev[i] );
 | 
		
	
		
			
			|  | 2017 | +	phantom_halt_pegs ( phantom );
 | 
		
	
		
			
			| 1973 | 2018 |  	free_dma ( phantom->dma_buf, sizeof ( *(phantom->dma_buf) ) );
 | 
		
	
		
			
			| 1974 | 2019 |  	phantom->dma_buf = NULL;
 | 
		
	
		
			
			| 1975 | 2020 |  	for ( i = ( phantom->num_ports - 1 ) ; i >= 0 ; i-- ) {
 |