Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7aa55fce authored by Adrian Bunk's avatar Adrian Bunk Committed by Jeff Garzik
Browse files

[PATCH] drivers/net/skfp/: cleanups



This patch contains the following cleanups:
- make needlessly global code static
- remove the completely unused smtparse.c
- remove the following unused global functions:
  - drvfbi.c: init_dma
  - drvfbi.c: dis_dma
  - drvfbi.c: get_rom_byte
  - drvfbi.c: mac_drv_vpd_read
  - drvfbi.c: mac_drv_pci_fix
  - fplustm.c: mac_set_func_addr
  - fplustm.c: mac_del_multicast
  - hwmtm.c: mac_drv_rx_frag
  - pcmplc.c: pcm_set_lct_short
  - smt.c: smt_please_reconnect
  - smt.c: smt_change_t_neg
  - smtdef.c: smt_set_defaults

Signed-off-by: default avatarAdrian Bunk <bunk@stusta.de>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
parent 9b25978e
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -6,8 +6,8 @@ obj-$(CONFIG_SKFP) += skfp.o

skfp-objs :=  skfddi.o    hwmtm.o    fplustm.o  smt.o      cfm.o     \
              ecm.o       pcmplc.o   pmf.o      queue.o    rmt.o     \
	      smtdef.o    smtinit.o  smttimer.o srf.o      smtparse.o\
	      hwt.o      drvfbi.o   ess.o
	      smtdef.o    smtinit.o  smttimer.o srf.o      hwt.o     \
	      drvfbi.o   ess.o

# NOTE:
#   Compiling this driver produces some warnings (and some more are 
+4 −218
Original line number Diff line number Diff line
@@ -105,8 +105,8 @@ extern int AIX_vpdReadByte() ;
#endif


/* Prototypes of local functions. */
void smt_stop_watchdog(struct s_smc *smc);
/* Prototype of a local function. */
static void smt_stop_watchdog(struct s_smc *smc);

#ifdef MCA
static int read_card_id() ;
@@ -631,7 +631,7 @@ void plc_clear_irq(struct s_smc *smc, int p)
 *	LED_Y_OFF	just switch yellow LED off
 *	LED_Y_ON	just switch yello LED on
 */
void led_indication(struct s_smc *smc, int led_event)
static void led_indication(struct s_smc *smc, int led_event)
{
	/* use smc->hw.mac_ring_is_up == TRUE 
	 * as indication for Ring Operational
@@ -764,122 +764,6 @@ void llc_recover_tx(struct s_smc *smc)
#endif
}

/*--------------------------- DMA init ----------------------------*/
#ifdef	ISA

/*
 * init DMA
 */
void init_dma(struct s_smc *smc, int dma)
{
	SK_UNUSED(smc) ;

	/*
	 * set cascade mode,
	 * clear mask bit (enable DMA cannal)
	 */
	if (dma > 3) {
		outp(0xd6,(dma & 0x03) | 0xc0) ;
		outp(0xd4, dma & 0x03) ;
	}
	else {
		outp(0x0b,(dma & 0x03) | 0xc0) ;
		outp(0x0a,dma & 0x03) ;
	}
}

/*
 * disable DMA
 */
void dis_dma(struct s_smc *smc, int dma)
{
	SK_UNUSED(smc) ;

	/*
	 * set mask bit (disable DMA cannal)
	 */
	if (dma > 3) {
		outp(0xd4,(dma & 0x03) | 0x04) ;
	}
	else {
		outp(0x0a,(dma & 0x03) | 0x04) ;
	}
}

#endif	/* ISA */

#ifdef	EISA

/*arrays with io addresses of dma controller length and address registers*/
static const int cntr[8] = { 0x001,0x003,0x005,0x007,0,0x0c6,0x0ca,0x0ce } ;
static const int base[8] = { 0x000,0x002,0x004,0x006,0,0x0c4,0x0c8,0x0cc } ;
static const int page[8] = { 0x087,0x083,0x081,0x082,0,0x08b,0x089,0x08a } ;

void init_dma(struct s_smc *smc, int dma)
{
	/*
	 * extended mode register
	 * 32 bit IO
	 * type c
	 * TC output
	 * disable stop
	 */

	/* mode read (write) demand */
	smc->hw.dma_rmode = (dma & 3) | 0x08 | 0x0 ;
	smc->hw.dma_wmode = (dma & 3) | 0x04 | 0x0 ;

	/* 32 bit IO's, burst DMA mode (type "C") */
	smc->hw.dma_emode = (dma & 3) | 0x08 | 0x30 ;

	outp((dma < 4) ? 0x40b : 0x4d6,smc->hw.dma_emode) ;

	/* disable chaining */
	outp((dma < 4) ? 0x40a : 0x4d4,(dma&3)) ;

	/*load dma controller addresses for fast access during set dma*/
	smc->hw.dma_base_word_count = cntr[smc->hw.dma];
	smc->hw.dma_base_address = base[smc->hw.dma];
	smc->hw.dma_base_address_page = page[smc->hw.dma];

}

void dis_dma(struct s_smc *smc, int dma)
{
	SK_UNUSED(smc) ;

	outp((dma < 4) ? 0x0a : 0xd4,(dma&3)|4) ;/* mask bit */
}
#endif	/* EISA */

#ifdef	MCA
void init_dma(struct s_smc *smc, int dma)
{
	SK_UNUSED(smc) ;
	SK_UNUSED(dma) ;
}

void dis_dma(struct s_smc *smc, int dma)
{
	SK_UNUSED(smc) ;
	SK_UNUSED(dma) ;
}
#endif

#ifdef	PCI
void init_dma(struct s_smc *smc, int dma)
{
	SK_UNUSED(smc) ;
	SK_UNUSED(dma) ;
}

void dis_dma(struct s_smc *smc, int dma)
{
	SK_UNUSED(smc) ;
	SK_UNUSED(dma) ;
}
#endif

#ifdef MULT_OEM
static int is_equal_num(char comp1[], char comp2[], int num)
{
@@ -1407,7 +1291,7 @@ void smt_start_watchdog(struct s_smc *smc)
#endif	/* DEBUG */
}

void smt_stop_watchdog(struct s_smc *smc)
static void smt_stop_watchdog(struct s_smc *smc)
{
	SK_UNUSED(smc) ;	/* Make LINT happy. */
#ifndef	DEBUG
@@ -1422,104 +1306,6 @@ void smt_stop_watchdog(struct s_smc *smc)
}

#ifdef	PCI
static char get_rom_byte(struct s_smc *smc, u_short addr)
{
	GET_PAGE(addr) ;
	return (READ_PROM(ADDR(B2_FDP))) ;
}

/*
 * ROM image defines
 */
#define	ROM_SIG_1	0
#define ROM_SIG_2	1
#define PCI_DATA_1	0x18
#define PCI_DATA_2	0x19

/*
 * PCI data structure defines
 */
#define	VPD_DATA_1	0x08
#define	VPD_DATA_2	0x09
#define IMAGE_LEN_1	0x10
#define IMAGE_LEN_2	0x11
#define	CODE_TYPE	0x14
#define	INDICATOR	0x15

/*
 *	BEGIN_MANUAL_ENTRY(mac_drv_vpd_read)
 *	mac_drv_vpd_read(smc,buf,size,image)
 *
 * function	DOWNCALL	(FDDIWARE)
 *		reads the VPD data of the FPROM and writes it into the
 *		buffer
 *
 * para	buf	points to the buffer for the VPD data
 *	size	size of the VPD data buffer
 *	image	boot image; code type of the boot image
 *		image = 0	Intel x86, PC-AT compatible
 *			1	OPENBOOT standard for PCI
 *			2-FF	reserved
 *
 * returns	len	number of VPD data bytes read form the FPROM
 *		<0	number of read bytes
 *		>0	error: data invalid
 *
 *	END_MANUAL_ENTRY
 */
int mac_drv_vpd_read(struct s_smc *smc, char *buf, int size, char image)
{
	u_short	ibase ;
	u_short pci_base ;
	u_short vpd ;
	int	len ;

	len = 0 ;
	ibase = 0 ;
	/*
	 * as long images defined
	 */
	while (get_rom_byte(smc,ibase+ROM_SIG_1) == 0x55 &&
		(u_char) get_rom_byte(smc,ibase+ROM_SIG_2) == 0xaa) {
		/*
		 * get the pointer to the PCI data structure
		 */
		pci_base = ibase + get_rom_byte(smc,ibase+PCI_DATA_1) +
				(get_rom_byte(smc,ibase+PCI_DATA_2) << 8) ;

		if (image == get_rom_byte(smc,pci_base+CODE_TYPE)) {
			/*
			 * we have the right image, read the VPD data
			 */
			vpd = ibase + get_rom_byte(smc,pci_base+VPD_DATA_1) +
				(get_rom_byte(smc,pci_base+VPD_DATA_2) << 8) ;
			if (vpd == ibase) {
				break ;		/* no VPD data */
			}
			for (len = 0; len < size; len++,buf++,vpd++) {
				*buf = get_rom_byte(smc,vpd) ;
			}
			break ;
		}
		else {
			/*
			 * try the next image
			 */
			if (get_rom_byte(smc,pci_base+INDICATOR) & 0x80) {
				break ;		/* this was the last image */
			}
			ibase = ibase + get_rom_byte(smc,ibase+IMAGE_LEN_1) +
				(get_rom_byte(smc,ibase+IMAGE_LEN_2) << 8) ;
		}
	}

	return(len) ;
}

void mac_drv_pci_fix(struct s_smc *smc, u_long fix_value)
{
	smc->hw.pci_fix_value = fix_value ;
}

void mac_do_pci_fix(struct s_smc *smc)
{
+2 −2
Original line number Diff line number Diff line
@@ -102,7 +102,7 @@ void ess_timer_poll(struct s_smc *smc);
void ess_para_change(struct s_smc *smc);
int ess_raf_received_pack(struct s_smc *smc, SMbuf *mb, struct smt_header *sm,
			  int fs);
int process_bw_alloc(struct s_smc *smc, long int payload, long int overhead);
static int process_bw_alloc(struct s_smc *smc, long int payload, long int overhead);


/*
@@ -375,7 +375,7 @@ int ess_raf_received_pack(struct s_smc *smc, SMbuf *mb, struct smt_header *sm,
 * determines the synchronous bandwidth, set the TSYNC register and the
 * mib variables SBAPayload, SBAOverhead and fddiMACT-NEG.
 */
int process_bw_alloc(struct s_smc *smc, long int payload, long int overhead)
static int process_bw_alloc(struct s_smc *smc, long int payload, long int overhead)
{
	/*
	 * determine the synchronous bandwidth (sync_bw) in bytes per T-NEG,
+0 −70
Original line number Diff line number Diff line
@@ -1114,30 +1114,6 @@ void mac_clear_multicast(struct s_smc *smc)
	}
}

/*
	BEGIN_MANUAL_ENTRY(if,func;others;2)

	int mac_set_func_addr(smc,f_addr)
	struct s_smc *smc ;
	u_long f_addr ;

Function	DOWNCALL	(SMT, fplustm.c)
		Set a Token-Ring functional address, the address will
		be activated after calling mac_update_multicast()

Para	f_addr	functional bits in non-canonical format

Returns	0: always success

	END_MANUAL_ENTRY()
 */
int mac_set_func_addr(struct s_smc *smc, u_long f_addr)
{
	smc->hw.fp.func_addr = f_addr ;
	return(0) ;
}


/*
	BEGIN_MANUAL_ENTRY(if,func;others;2)

@@ -1202,52 +1178,6 @@ int mac_add_multicast(struct s_smc *smc, struct fddi_addr *addr, int can)
	return(0) ;
}

/*
	BEGIN_MANUAL_ENTRY(if,func;others;2)

	void mac_del_multicast(smc,addr,can)
	struct s_smc *smc ;
	struct fddi_addr *addr ;
	int can ;

Function	DOWNCALL	(SMT, fplustm.c)
		Delete an entry from the multicast table

Para	addr	pointer to a multicast address
	can	= 0:	the multicast address has the physical format
		= 1:	the multicast address has the canonical format
		| 0x80	permanent

	END_MANUAL_ENTRY()
 */
void mac_del_multicast(struct s_smc *smc, struct fddi_addr *addr, int can)
{
	SK_LOC_DECL(struct fddi_addr,own) ;
	struct s_fpmc	*tb ;

	if (!(tb = mac_get_mc_table(smc,addr,&own,1,can & ~0x80)))
		return ;
	/*
	 * permanent addresses must be deleted with perm bit
	 * and vice versa
	 */
	if (( tb->perm &&  (can & 0x80)) ||
	    (!tb->perm && !(can & 0x80))) {
		/*
		 * delete it
		 */
		if (tb->n) {
			tb->n-- ;
			if (tb->perm) {
				smc->hw.fp.smt_slots_used-- ;
			}
			else {
				smc->hw.fp.os_slots_used-- ;
			}
		}
	}
}

/*
 * mode
 */
+0 −7
Original line number Diff line number Diff line
@@ -507,7 +507,6 @@ void pcm_status_state(struct s_smc *smc, int np, int *type, int *state,
		      int *remote, int *mac);
void plc_config_mux(struct s_smc *smc, int mux);
void sm_lem_evaluate(struct s_smc *smc);
void smt_clear_una_dna(struct s_smc *smc);
void mac_update_counter(struct s_smc *smc);
void sm_pm_ls_latch(struct s_smc *smc, int phy, int on_off);
void sm_ma_control(struct s_smc *smc, int mode);
@@ -541,11 +540,9 @@ void smt_timer_poll(struct s_smc *smc);
u_long smt_get_time(void);
u_long smt_get_tid(struct s_smc *smc);
void smt_timer_done(struct s_smc *smc);
void smt_set_defaults(struct s_smc *smc);
void smt_fixup_mib(struct s_smc *smc);
void smt_reset_defaults(struct s_smc *smc, int level);
void smt_agent_task(struct s_smc *smc);
void smt_please_reconnect(struct s_smc *smc, int reconn_time);
int smt_check_para(struct s_smc *smc, struct smt_header *sm,
		   const u_short list[]);
void driver_get_bia(struct s_smc *smc, struct fddi_addr *bia_addr);
@@ -568,7 +565,6 @@ int pcm_get_s_port(struct s_smc *smc);
int pcm_rooted_station(struct s_smc *smc);
int cfm_get_mac_input(struct s_smc *smc);
int cfm_get_mac_output(struct s_smc *smc);
int port_to_mib(struct s_smc *smc, int p);
int cem_build_path(struct s_smc *smc, char *to, int path_index);
int sm_mac_get_tx_state(struct s_smc *smc);
char *get_pcmstate(struct s_smc *smc, int np);
@@ -580,8 +576,6 @@ void smt_send_frame(struct s_smc *smc, SMbuf *mb, int fc, int local);
void smt_set_timestamp(struct s_smc *smc, u_char *p);
void mac_set_rx_mode(struct s_smc *smc,	int mode);
int mac_add_multicast(struct s_smc *smc, struct fddi_addr *addr, int can);
int mac_set_func_addr(struct s_smc *smc, u_long f_addr);
void mac_del_multicast(struct s_smc *smc, struct fddi_addr *addr, int can);
void mac_update_multicast(struct s_smc *smc);
void mac_clear_multicast(struct s_smc *smc);
void set_formac_tsync(struct s_smc *smc, long sync_bw);
@@ -599,7 +593,6 @@ void plc_irq(struct s_smc *smc, int np, unsigned int cmd);
int smt_set_mac_opvalues(struct s_smc *smc);

#ifdef TAG_MODE
void mac_drv_pci_fix(struct s_smc *smc, u_long fix_value);
void mac_do_pci_fix(struct s_smc *smc);
void mac_drv_clear_tx_queue(struct s_smc *smc);
void mac_drv_repair_descr(struct s_smc *smc);
Loading