FreeBSD/sys/dev/cxgb/common/cxgb_t3_hw.c
/**
 *	t3_flash_erase_sectors - erase a range of flash sectors
 *	@adapter: the adapter
 *	@start: the first sector to erase
 *	@end: the last sector to erase
 *
 *	Erases the sectors in the given range.
 */
erase a range of flash sectors
@adapter: the adapter
@start: the first sector to erase
@end: the last sector to erase

Erases the sectors in the given range.
erase a range of flash sectors @adapter : the adapter @start : the first sector to erase @end : the last sector to erase Erases the sectors in the given range .
static int t3_flash_erase_sectors(adapter_t *adapter, int start, int end)
{
	while (start <= end) {
		int ret;
		if ((ret = sf1_write(adapter, 1, 0, SF_WR_ENABLE)) != 0 ||
		    (ret = sf1_write(adapter, 4, 0,
				     SF_ERASE_SECTOR | (start << 8))) != 0 ||
		    (ret = flash_wait_op(adapter, 5, 500)) != 0)
			return ret;
		start++;
	}
	return 0;
}
static int t3_flash_erase_sectors ( adapter_t * adapter , int start , int end ) { while ( start <= end ) { int ret ; if ( ( ret = sf1_write ( adapter , 1 , 0 , SF_WR_ENABLE ) ) != 0 || ( ret = sf1_write ( adapter , 4 , 0 , SF_ERASE_SECTOR | ( start << 8 ) ) ) != 0 || ( ret = flash_wait_op ( adapter , 5 , 500 ) ) != 0 ) return ret ; start ++ ; } return 0 ; }
t3_flash_erase_sectors - erase a range of flash sectors
      @adapter: the adapter
      @start: the first sector to erase
      @end: the last sector to erase
t3_flash_erase_sectors - erase a range of flash sectors @adapter : the adapter @start : the first sector to erase @end : the last sector to erase