
From: Stephen Rothwell <sfr@canb.auug.org.au>

This patch changes the externally referenced names in mf.c to not use Study
Caps and removes a couple of no longer used functions.

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 25-akpm/arch/ppc64/kernel/iSeries_pci.c   |    6 +-
 25-akpm/arch/ppc64/kernel/iSeries_setup.c |    8 +--
 25-akpm/arch/ppc64/kernel/mf.c            |   77 +++++-------------------------
 25-akpm/arch/ppc64/kernel/rtc.c           |    4 -
 25-akpm/arch/ppc64/kernel/viopath.c       |    4 -
 25-akpm/drivers/net/iseries_veth.c        |    6 +-
 25-akpm/include/asm-ppc64/iSeries/mf.h    |   19 +++----
 7 files changed, 37 insertions(+), 87 deletions(-)

diff -puN arch/ppc64/kernel/iSeries_pci.c~ppc64-iseries-remove-some-studly-caps arch/ppc64/kernel/iSeries_pci.c
--- 25/arch/ppc64/kernel/iSeries_pci.c~ppc64-iseries-remove-some-studly-caps	2004-11-09 00:08:38.674811560 -0800
+++ 25-akpm/arch/ppc64/kernel/iSeries_pci.c	2004-11-09 00:08:38.694808520 -0800
@@ -309,7 +309,7 @@ void __init iSeries_pci_final_fixup(void
 	PPCDBG(PPCDBG_BUSWALK, "iSeries_pcibios_fixup Entry.\n"); 
 
 	/* Fix up at the device node and pci_dev relationship */
-	mf_displaySrc(0xC9000100);
+	mf_display_src(0xC9000100);
 
 	printk("pcibios_final_fixup\n");
 	for_each_pci_dev(pdev) {
@@ -335,7 +335,7 @@ void __init iSeries_pci_final_fixup(void
 		pdev->irq = node->Irq;
 	}
 	iSeries_activate_IRQs();
-	mf_displaySrc(0xC9000200);
+	mf_display_src(0xC9000200);
 }
 
 void pcibios_fixup_bus(struct pci_bus *PciBus)
@@ -677,7 +677,7 @@ static int CheckReturnCode(char *TextHdr
 		 */
 		if ((DevNode->IoRetry > Pci_Retry_Max) &&
 				(Pci_Error_Flag > 0)) {
-			mf_displaySrc(0xB6000103);
+			mf_display_src(0xB6000103);
 			panic_timeout = 0; 
 			panic("PCI: Hardware I/O Error, SRC B6000103, "
 					"Automatic Reboot Disabled.\n");
diff -puN arch/ppc64/kernel/iSeries_setup.c~ppc64-iseries-remove-some-studly-caps arch/ppc64/kernel/iSeries_setup.c
--- 25/arch/ppc64/kernel/iSeries_setup.c~ppc64-iseries-remove-some-studly-caps	2004-11-09 00:08:38.678810952 -0800
+++ 25-akpm/arch/ppc64/kernel/iSeries_setup.c	2004-11-09 00:08:38.695808368 -0800
@@ -732,7 +732,7 @@ void iSeries_restart(char *cmd)
  */
 void iSeries_power_off(void)
 {
-	mf_powerOff();
+	mf_power_off();
 }
 
 /*
@@ -740,7 +740,7 @@ void iSeries_power_off(void)
  */
 void iSeries_halt(void)
 {
-	mf_powerOff();
+	mf_power_off();
 }
 
 /* JDH Hack */
@@ -796,9 +796,9 @@ void __init iSeries_progress(char * st, 
 	printk("Progress: [%04x] - %s\n", (unsigned)code, st);
 	if (!piranha_simulator && mf_initialized) {
 		if (code != 0xffff)
-			mf_displayProgress(code);
+			mf_display_progress(code);
 		else
-			mf_clearSrc();
+			mf_clear_src();
 	}
 }
 
diff -puN arch/ppc64/kernel/mf.c~ppc64-iseries-remove-some-studly-caps arch/ppc64/kernel/mf.c
--- 25/arch/ppc64/kernel/mf.c~ppc64-iseries-remove-some-studly-caps	2004-11-09 00:08:38.681810496 -0800
+++ 25-akpm/arch/ppc64/kernel/mf.c	2004-11-09 00:08:38.697808064 -0800
@@ -357,7 +357,7 @@ static int shutdown(void)
 	if (rc) {
 		printk(KERN_ALERT "mf.c: SIGINT to init failed (%d), "
 				"hard shutdown commencing\n", rc);
-		mf_powerOff();
+		mf_power_off();
 	} else
 		printk(KERN_INFO "mf.c: init has been successfully notified "
 				"to proceed with shutdown\n");
@@ -533,7 +533,7 @@ static void hvHandler(struct HvLpEvent *
  * Global kernel interface to allocate and seed events into the
  * Hypervisor.
  */
-void mf_allocateLpEvents(HvLpIndex targetLp, HvLpEvent_Type type,
+void mf_allocate_lp_events(HvLpIndex targetLp, HvLpEvent_Type type,
 		unsigned size, unsigned count, MFCompleteHandler hdlr,
 		void *userToken)
 {
@@ -560,13 +560,13 @@ void mf_allocateLpEvents(HvLpIndex targe
 	if ((rc != 0) && (hdlr != NULL))
 		(*hdlr)(userToken, rc);
 }
-EXPORT_SYMBOL(mf_allocateLpEvents);
+EXPORT_SYMBOL(mf_allocate_lp_events);
 
 /*
  * Global kernel interface to unseed and deallocate events already in
  * Hypervisor.
  */
-void mf_deallocateLpEvents(HvLpIndex targetLp, HvLpEvent_Type type,
+void mf_deallocate_lp_events(HvLpIndex targetLp, HvLpEvent_Type type,
 		unsigned count, MFCompleteHandler hdlr, void *userToken)
 {
 	struct pending_event *ev = new_pending_event();
@@ -591,13 +591,13 @@ void mf_deallocateLpEvents(HvLpIndex tar
 	if ((rc != 0) && (hdlr != NULL))
 		(*hdlr)(userToken, rc);
 }
-EXPORT_SYMBOL(mf_deallocateLpEvents);
+EXPORT_SYMBOL(mf_deallocate_lp_events);
 
 /*
  * Global kernel interface to tell the VSP object in the primary
  * partition to power this partition off.
  */
-void mf_powerOff(void)
+void mf_power_off(void)
 {
 	printk(KERN_INFO "mf.c: Down it goes...\n");
 	signal_ce_msg("\x00\x00\x00\x4D\x00\x00\x00\x00\x00\x00\x00\x00", NULL);
@@ -618,7 +618,7 @@ void mf_reboot(void)
 /*
  * Display a single word SRC onto the VSP control panel.
  */
-void mf_displaySrc(u32 word)
+void mf_display_src(u32 word)
 {
 	u8 ce[12];
 
@@ -633,7 +633,7 @@ void mf_displaySrc(u32 word)
 /*
  * Display a single word SRC of the form "PROGXXXX" on the VSP control panel.
  */
-void mf_displayProgress(u16 value)
+void mf_display_progress(u16 value)
 {
 	u8 ce[12];
 	u8 src[72];
@@ -657,7 +657,7 @@ void mf_displayProgress(u16 value)
  * Clear the VSP control panel.  Used to "erase" an SRC that was
  * previously displayed.
  */
-void mf_clearSrc(void)
+void mf_clear_src(void)
 {
 	signal_ce_msg("\x00\x00\x00\x4B\x00\x00\x00\x00\x00\x00\x00\x00", NULL);
 }
@@ -909,15 +909,6 @@ int mf_getVmlinuxChunk(char *buffer, int
 	return rc;
 }
 
-int mf_setRtcTime(unsigned long time)
-{
-	struct rtc_time tm;
-
-	to_tm(time, &tm);
-
-	return mf_setRtc(&tm);
-}
-
 struct RtcTimeData {
 	struct completion com;
 	struct CeMsgData xCeMsg;
@@ -933,47 +924,7 @@ void getRtcTimeComplete(void * token, st
 	complete(&rtc->com);
 }
 
-static unsigned long lastsec = 1;
-
-int mf_getRtcTime(unsigned long *time)
-{
-	u32 dataWord1 = *((u32 *)(&xSpCommArea.xBcdTimeAtIplStart));
-	u32 dataWord2 = *(((u32 *)&(xSpCommArea.xBcdTimeAtIplStart)) + 1);
-	int year = 1970;
-	int year1 = (dataWord1 >> 24) & 0x000000FF;
-	int year2 = (dataWord1 >> 16) & 0x000000FF;
-	int sec = (dataWord1 >> 8) & 0x000000FF;
-	int min = dataWord1 & 0x000000FF;
-	int hour = (dataWord2 >> 24) & 0x000000FF;
-	int day = (dataWord2 >> 8) & 0x000000FF;
-	int mon = dataWord2 & 0x000000FF;
-
-	BCD_TO_BIN(sec);
-	BCD_TO_BIN(min);
-	BCD_TO_BIN(hour);
-	BCD_TO_BIN(day);
-	BCD_TO_BIN(mon);
-	BCD_TO_BIN(year1);
-	BCD_TO_BIN(year2);
-	year = year1 * 100 + year2;
-
-	*time = mktime(year, mon, day, hour, min, sec);
-	*time += (jiffies / HZ);
-
-	/*
-	 * Now THIS is a nasty hack!
-	 * It ensures that the first two calls to mf_getRtcTime get different
-	 * answers.  That way the loop in init_time (time.c) will not think
-	 * the clock is stuck.
-	 */
-	if (lastsec) {
-		*time -= lastsec;
-		--lastsec;
-	}
-	return 0;
-}
-
-int mf_getRtc(struct rtc_time *tm)
+int mf_get_rtc(struct rtc_time *tm)
 {
 	struct CeMsgCompleteData ceComplete;
 	struct RtcTimeData rtcData;
@@ -999,7 +950,7 @@ int mf_getRtc(struct rtc_time *tm)
 				tm->tm_mday = 10;
 				tm->tm_mon = 8;
 				tm->tm_year = 71;
-				mf_setRtc(tm);
+				mf_set_rtc(tm);
 			}
 			{
 				u32 dataWord1 = *((u32 *)(rtcData.xCeMsg.ce_msg+4));
@@ -1046,7 +997,7 @@ int mf_getRtc(struct rtc_time *tm)
 	return rc;
 }
 
-int mf_setRtc(struct rtc_time * tm)
+int mf_set_rtc(struct rtc_time * tm)
 {
 	char ceTime[12] = "\x00\x00\x00\x41\x00\x00\x00\x00\x00\x00\x00\x00";
 	u8 day, mon, hour, min, sec, y1, y2;
@@ -1210,9 +1161,9 @@ static int proc_mf_change_src(struct fil
 		return -EFAULT;
 
 	if ((count == 1) && (*stkbuf == '\0'))
-		mf_clearSrc();
+		mf_clear_src();
 	else
-		mf_displaySrc(*(u32 *)stkbuf);
+		mf_display_src(*(u32 *)stkbuf);
 
 	return count;
 }
diff -puN arch/ppc64/kernel/rtc.c~ppc64-iseries-remove-some-studly-caps arch/ppc64/kernel/rtc.c
--- 25/arch/ppc64/kernel/rtc.c~ppc64-iseries-remove-some-studly-caps	2004-11-09 00:08:38.682810344 -0800
+++ 25-akpm/arch/ppc64/kernel/rtc.c	2004-11-09 00:08:38.697808064 -0800
@@ -275,7 +275,7 @@ void iSeries_get_rtc_time(struct rtc_tim
 	if (piranha_simulator)
 		return;
 
-	mf_getRtc(rtc_tm);
+	mf_get_rtc(rtc_tm);
 	rtc_tm->tm_mon--;
 }
 
@@ -285,7 +285,7 @@ void iSeries_get_rtc_time(struct rtc_tim
  */
 int iSeries_set_rtc_time(struct rtc_time *tm)
 {
-	mf_setRtc(tm);
+	mf_set_rtc(tm);
 	return 0;
 }
 
diff -puN arch/ppc64/kernel/viopath.c~ppc64-iseries-remove-some-studly-caps arch/ppc64/kernel/viopath.c
--- 25/arch/ppc64/kernel/viopath.c~ppc64-iseries-remove-some-studly-caps	2004-11-09 00:08:38.684810040 -0800
+++ 25-akpm/arch/ppc64/kernel/viopath.c	2004-11-09 00:08:38.698807912 -0800
@@ -473,7 +473,7 @@ static int allocateEvents(HvLpIndex remo
 		parms.used_wait_atomic = 0;
 		parms.sem = &Semaphore;
 	}
-	mf_allocateLpEvents(remoteLp, HvLpEvent_Type_VirtualIo, 250,	/* It would be nice to put a real number here! */
+	mf_allocate_lp_events(remoteLp, HvLpEvent_Type_VirtualIo, 250,	/* It would be nice to put a real number here! */
 			    numEvents, &viopath_donealloc, &parms);
 	if (in_atomic()) {
 		while (atomic_read(&wait_atomic))
@@ -582,7 +582,7 @@ int viopath_close(HvLpIndex remoteLp, in
 
 	doneAllocParms.used_wait_atomic = 0;
 	doneAllocParms.sem = &Semaphore;
-	mf_deallocateLpEvents(remoteLp, HvLpEvent_Type_VirtualIo,
+	mf_deallocate_lp_events(remoteLp, HvLpEvent_Type_VirtualIo,
 			      numReq, &viopath_donealloc, &doneAllocParms);
 	down(&Semaphore);
 
diff -puN drivers/net/iseries_veth.c~ppc64-iseries-remove-some-studly-caps drivers/net/iseries_veth.c
--- 25/drivers/net/iseries_veth.c~ppc64-iseries-remove-some-studly-caps	2004-11-09 00:08:38.686809736 -0800
+++ 25-akpm/drivers/net/iseries_veth.c	2004-11-09 00:08:38.699807760 -0800
@@ -248,7 +248,7 @@ static int veth_allocate_events(HvLpInde
 {
 	struct veth_allocation vc = { COMPLETION_INITIALIZER(vc.c), 0 };
 
-	mf_allocateLpEvents(rlp, HvLpEvent_Type_VirtualLan,
+	mf_allocate_lp_events(rlp, HvLpEvent_Type_VirtualLan,
 			    sizeof(struct VethLpEvent), number,
 			    &veth_complete_allocation, &vc);
 	wait_for_completion(&vc.c);
@@ -662,12 +662,12 @@ static void veth_destroy_connection(u8 r
 	del_timer_sync(&cnx->ack_timer);
 
 	if (cnx->num_events > 0)
-		mf_deallocateLpEvents(cnx->remote_lp,
+		mf_deallocate_lp_events(cnx->remote_lp,
 				      HvLpEvent_Type_VirtualLan,
 				      cnx->num_events,
 				      NULL, NULL);
 	if (cnx->num_ack_events > 0)
-		mf_deallocateLpEvents(cnx->remote_lp,
+		mf_deallocate_lp_events(cnx->remote_lp,
 				      HvLpEvent_Type_VirtualLan,
 				      cnx->num_ack_events,
 				      NULL, NULL);
diff -puN include/asm-ppc64/iSeries/mf.h~ppc64-iseries-remove-some-studly-caps include/asm-ppc64/iSeries/mf.h
--- 25/include/asm-ppc64/iSeries/mf.h~ppc64-iseries-remove-some-studly-caps	2004-11-09 00:08:38.688809432 -0800
+++ 25-akpm/include/asm-ppc64/iSeries/mf.h	2004-11-09 00:08:38.700807608 -0800
@@ -1,6 +1,7 @@
 /*
  * mf.h
  * Copyright (C) 2001  Troy D. Armstrong IBM Corporation
+ * Copyright (C) 2004  Stephen Rothwell IBM Corporation
  *
  * This modules exists as an interface between a Linux secondary partition
  * running on an iSeries and the primary partition's Virtual Service
@@ -35,18 +36,18 @@ struct rtc_time;
 
 typedef void (*MFCompleteHandler)(void *clientToken, int returnCode);
 
-extern void mf_allocateLpEvents(HvLpIndex targetLp, HvLpEvent_Type type,
+extern void mf_allocate_lp_events(HvLpIndex targetLp, HvLpEvent_Type type,
 		unsigned size, unsigned amount, MFCompleteHandler hdlr,
 		void *userToken);
-extern void mf_deallocateLpEvents(HvLpIndex targetLp, HvLpEvent_Type type,
+extern void mf_deallocate_lp_events(HvLpIndex targetLp, HvLpEvent_Type type,
 		unsigned count, MFCompleteHandler hdlr, void *userToken);
 
-extern void mf_powerOff(void);
+extern void mf_power_off(void);
 extern void mf_reboot(void);
 
-extern void mf_displaySrc(u32 word);
-extern void mf_displayProgress(u16 value);
-extern void mf_clearSrc(void);
+extern void mf_display_src(u32 word);
+extern void mf_display_progress(u16 value);
+extern void mf_clear_src(void);
 
 extern void mf_init(void);
 
@@ -62,9 +63,7 @@ extern int mf_setVmlinuxChunk(const char
 		u64 side);
 extern int mf_getVmlinuxChunk(char *buffer, int *size, int offset, u64 side);
 
-extern int mf_setRtcTime(unsigned long time);
-extern int mf_getRtcTime(unsigned long *time);
-extern int mf_getRtc( struct rtc_time * tm );
-extern int mf_setRtc( struct rtc_time * tm );
+extern int mf_get_rtc(struct rtc_time *tm);
+extern int mf_set_rtc(struct rtc_time *tm);
 
 #endif /* MF_H_INCLUDED */
_
