]> git.neil.brown.name Git - history.git/commitdiff
Linux 2.2.17pre15 2.2.17pre15
authorAlan Cox <alan@lxorguk.ukuu.org.uk>
Fri, 23 Nov 2007 20:21:54 +0000 (15:21 -0500)
committerAlan Cox <alan@lxorguk.ukuu.org.uk>
Fri, 23 Nov 2007 20:21:54 +0000 (15:21 -0500)
o Pull the 3ware update - causes oopses ? (Alan Cox)
o Fix emu10k build error with no PCI (Arjan van de Ven)
o display7 LED driver  (Eric Brower)
o TLB multi-match bugs in sparc64 (Dave Miller)
o Fix CPP string concatenation in sparc ksyms (Dave Miller)
o Fix lost copyright credit to ALi in the
trident.c driver (Alan Cox)
o Add alternate ALi ID to the trident driver (Alan Cox)
o ATI video fixes for PPC (Benjamin Herrenschmidt)
o Further HDLC fixes (Krzysztof Halasa)
o Fix sign handling bugs (Andrew Morton, Alan Cox)
o Fix wrong comment in fs/exec.c (Robert Love)

33 files changed:
Makefile
arch/sparc/kernel/sparc_ksyms.c
arch/sparc64/config.in
arch/sparc64/kernel/ebus.c
arch/sparc64/kernel/ioctl32.c
arch/sparc64/kernel/psycho.c
arch/sparc64/kernel/rtrap.S
arch/sparc64/kernel/sparc64_ksyms.c
arch/sparc64/lib/blockops.S
drivers/char/epca.c
drivers/isdn/avmb1/b1.c
drivers/isdn/avmb1/b1dma.c
drivers/isdn/avmb1/c4.c
drivers/isdn/avmb1/t1isa.c
drivers/net/hdlc.c
drivers/sbus/char/Makefile
drivers/sbus/char/display7seg.c [new file with mode: 0644]
drivers/scsi/3w-xxxx.c
drivers/scsi/3w-xxxx.h
drivers/sound/cs46xx.c
drivers/sound/emu10k1/emu_wrapper.c
drivers/sound/trident.c
drivers/telephony/ixj.c
drivers/video/Config.in
drivers/video/aty.h
drivers/video/atyfb.c
drivers/video/igafb.c
fs/exec.c
include/asm-sparc64/display7seg.h [new file with mode: 0644]
include/asm-sparc64/pbm.h
include/linux/fb.h
include/linux/pci.h
net/bridge/br.c

index 7bc418919b8faa49710df678b059fa8d3515560b..9ee6170336c90589750f664a2e49f42459f1e1f1 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
 VERSION = 2
 PATCHLEVEL = 2
 SUBLEVEL = 17
-EXTRAVERSION = pre14
+EXTRAVERSION = pre15
 
 ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ -e s/arm.*/arm/ -e s/sa110/arm/)
 
index e52c91ba234b195e2571c6d9289efab956bdc45a..451e1a5b483e015307204a84cb508a97f646e4f6 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: sparc_ksyms.c,v 1.77.2.4 1999/09/28 16:47:30 davem Exp $
+/* $Id: sparc_ksyms.c,v 1.77.2.5 2000/07/17 18:44:26 jj Exp $
  * arch/sparc/kernel/ksyms.c: Sparc specific ksyms support.
  *
  * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu)
@@ -82,10 +82,10 @@ extern int __sparc_dot_ ## sym (int) __asm__("." #sym);             \
 __EXPORT_SYMBOL(__sparc_dot_ ## sym, "." #sym)
 
 #define EXPORT_SYMBOL_PRIVATE(sym)                             \
-extern int __sparc_priv_ ## sym (int) __asm__("__" ## #sym);   \
+extern int __sparc_priv_ ## sym (int) __asm__("__" #sym);      \
 const struct module_symbol __export_priv_##sym                 \
 __attribute__((section("__ksymtab"))) =                                \
-{ (unsigned long) &__sparc_priv_ ## sym, "__" ## #sym }
+{ (unsigned long) &__sparc_priv_ ## sym, "__" #sym }
 
 /* used by various drivers */
 EXPORT_SYMBOL(sparc_cpu_model);
index 5036f3dac5450ac7a0e90826991cea19c7b60de5..78cb350958e842002928255ca9b2938f857dc95c 100644 (file)
@@ -1,4 +1,4 @@
-# $Id: config.in,v 1.67.2.5 1999/10/19 16:49:37 davem Exp $
+# $Id: config.in,v 1.67.2.11 2000/07/27 01:50:59 davem Exp $
 # For a description of the syntax of this configuration file,
 # see Documentation/kbuild/config-language.txt.
 #
@@ -87,6 +87,7 @@ if [ "$CONFIG_PCI" = "y" ]; then
     fi
   fi
   tristate 'SUNW,envctrl support' CONFIG_ENVCTRL
+  tristate '7-Segment Display support' CONFIG_DISPLAY7SEG
 fi
 endmenu
 
index 66647ce06827fb9e6b0ef43d650b463db23fb7d1..4f7c928982726fd87b83f56b5063eb481224d429 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: ebus.c,v 1.36.2.4 1999/11/08 23:25:45 davem Exp $
+/* $Id: ebus.c,v 1.36.2.5 2000/07/27 01:50:59 davem Exp $
  * ebus.c: PCI to EBus bridge device.
  *
  * Copyright (C) 1997  Eddie C. Dost  (ecd@skynet.be)
@@ -44,6 +44,9 @@ extern int flash_init(void);
 #ifdef CONFIG_ENVCTRL
 extern int envctrl_init(void);
 #endif
+#ifdef CONFIG_DISPLAY7SEG
+extern int d7s_init(void);
+#endif
 
 static inline unsigned long ebus_alloc(size_t size)
 {
@@ -423,6 +426,9 @@ __initfunc(void ebus_init(void))
 #endif
 #ifdef CONFIG_OBP_FLASH
        flash_init();
+#endif
+#ifdef CONFIG_DISPLAY7SEG
+       d7s_init();
 #endif
        clock_probe();
        power_init();
index f56e8f60b1d69fcb751e0ca8ba1b1fbf1e35c57b..1a131cce8a92ab3d35063ec3f43ae28ea22d2f2e 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: ioctl32.c,v 1.62.2.12 2000/05/27 04:46:26 davem Exp $
+/* $Id: ioctl32.c,v 1.62.2.13 2000/07/27 01:50:59 davem Exp $
  * ioctl32.c: Conversion between 32bit and 64bit native ioctls.
  *
  * Copyright (C) 1997  Jakub Jelinek  (jj@sunsite.mff.cuni.cz)
@@ -59,6 +59,7 @@
 #include <asm/envctrl.h>
 #include <asm/audioio.h>
 #include <asm/ethtool.h>
+#include <asm/display7seg.h>
 
 #include <linux/soundcard.h>
 
@@ -2167,7 +2168,7 @@ asmlinkage int sys32_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg)
        case _IOR('v' , BASE_VIDIOCPRIVATE+6, int):
        case _IOR('v' , BASE_VIDIOCPRIVATE+7, int):
 
-       /* Little p (/dev/rtc, /dev/envctrl, etc.) */
+       /* Little p (/dev/rtc, /dev/envctrl, /dev/d7s, etc.) */
        case RTCGET:
        case RTCSET:
        case ENVCTRL_RD_WARNING_TEMPERATURE:
@@ -2179,6 +2180,9 @@ asmlinkage int sys32_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg)
        case ENVCTRL_RD_ETHERNET_TEMPERATURE:
        case ENVCTRL_RD_MTHRBD_TEMPERATURE:
        case ENVCTRL_RD_CPU_VOLTAGE:
+       case D7SIOCWR:
+       /* case D7SIOCRD: Same value as ENVCTRL_RD_VOLTAGE_STATUS */
+       case D7SIOCTM:
 
 
        /* Little m */
index 1f3ee859e9538ad360d111193d654023b7642b3f..21acaf1865790695659052cea94e73643ac4d8c0 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: psycho.c,v 1.85.2.9 2000/05/01 06:33:49 davem Exp $
+/* $Id: psycho.c,v 1.85.2.10 2000/06/14 07:41:19 davem Exp $
  * psycho.c: Ultra/AX U2P PCI controller support.
  *
  * Copyright (C) 1997 David S. Miller (davem@caipfs.rutgers.edu)
index a3137ee509fd3cd120ae0c4b7676f59baeb15cad..6b7815bf532a5a6816cbe21f9fa6056a594d7c42 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: rtrap.S,v 1.45 1998/11/09 15:33:29 davem Exp $
+/* $Id: rtrap.S,v 1.45.2.1 2000/07/28 02:10:55 davem Exp $
  * rtrap.S: Preparing for return from trap on Sparc V9.
  *
  * Copyright (C) 1997,1998 Jakub Jelinek (jj@sunsite.mff.cuni.cz)
@@ -140,6 +140,14 @@ check_signal:      brz,a,pt                %l0, check_user_wins
                 add                    %sp, STACK_BIAS + REGWIN_SZ, %o1
                clr                     %l6
 
+               /* Signal delivery can change ptregs->tstate so we must
+                * reload it into %l1 here.
+                */
+               ldx                     [%sp + PTREGS_OFF + PT_V9_TSTATE], %l1
+               sethi                   %hi(0xf << 20), %l4
+               and                     %l1, %l4, %l4
+               andn                    %l1, %l4, %l1
+
                /* We must not take any traps between here and the actual
                 * return to user-space.  If we do we risk having windows
                 * saved to the thread struct between the test and the
index 3fd6b4c1e8ed0310d5ae4806a7a37b5ae19036f6..3cde9448d47818c82e358fb8c9c4a946bb5cd974 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: sparc64_ksyms.c,v 1.58.2.7 2000/05/27 04:46:26 davem Exp $
+/* $Id: sparc64_ksyms.c,v 1.58.2.8 2000/06/14 07:41:19 davem Exp $
  * arch/sparc64/kernel/sparc64_ksyms.c: Sparc64 specific ksyms support.
  *
  * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu)
index a84304362655fb3cdfbad846f6278ab0dc7094a8..7c1723ac77b303653628d04bb60b3fc72d44d91a 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: blockops.S,v 1.16.2.2 2000/03/03 23:50:32 davem Exp $
+/* $Id: blockops.S,v 1.16.2.4 2000/07/14 01:11:29 davem Exp $
  * blockops.S: UltraSparc block zero optimized routines.
  *
  * Copyright (C) 1996,1998 David S. Miller (davem@caip.rutgers.edu)
@@ -43,21 +43,23 @@ copy_page: /* %o0=dest, %o1=src */
        sethi           %hi(DCACHE_SIZE), %o1
        add             %o0, %o3, %o0
        add             %o0, %o1, %o1
-       sethi           %hi(TLBTEMP_ENT1), %o3
+       mov             TLBTEMP_ENT1, %o3
        rdpr            %pstate, %g3
        wrpr            %g3, PSTATE_IE, %pstate
 
        /* Spitfire Errata #32 workaround */
        mov             0x8, %o4
        stxa            %g0, [%o4] ASI_DMMU
-       flush           %g6
+       sethi           %hi(empty_zero_page), %o4
+       flush           %o4
 
        ldxa            [%o3] ASI_DTLB_TAG_READ, %o4
 
        /* Spitfire Errata #32 workaround */
        mov             0x8, %o5
        stxa            %g0, [%o5] ASI_DMMU
-       flush           %g6
+       sethi           %hi(empty_zero_page), %o5
+       flush           %o5
 
        ldxa            [%o3] ASI_DTLB_DATA_ACCESS, %o5
        stxa            %o0, [%o2] ASI_DMMU
@@ -68,14 +70,16 @@ copy_page: /* %o0=dest, %o1=src */
        /* Spitfire Errata #32 workaround */
        mov             0x8, %g5
        stxa            %g0, [%g5] ASI_DMMU
-       flush           %g6
+       sethi           %hi(empty_zero_page), %g5
+       flush           %g5
 
        ldxa            [%o3] ASI_DTLB_TAG_READ, %g5
 
        /* Spitfire Errata #32 workaround */
        mov             0x8, %g7
        stxa            %g0, [%g7] ASI_DMMU
-       flush           %g6
+       sethi           %hi(empty_zero_page), %g7
+       flush           %g7
 
        ldxa            [%o3] ASI_DTLB_DATA_ACCESS, %g7
        stxa            %o1, [%o2] ASI_DMMU
@@ -141,21 +145,23 @@ clear_page:               /* %o0=dest */
        mov             TLB_TAG_ACCESS, %o2
        sethi           %hi(TLBTEMP_BASE), %o3
        add             %o0, %o3, %o0
-       sethi           %hi(TLBTEMP_ENT2), %o3
+       mov             TLBTEMP_ENT2, %o3
        rdpr            %pstate, %g3
        wrpr            %g3, PSTATE_IE, %pstate
 
        /* Spitfire Errata #32 workaround */
        mov             0x8, %g5
        stxa            %g0, [%g5] ASI_DMMU
-       flush           %g6
+       sethi           %hi(empty_zero_page), %g5
+       flush           %g5
 
        ldxa            [%o3] ASI_DTLB_TAG_READ, %g5
 
        /* Spitfire Errata #32 workaround */
        mov             0x8, %g7
        stxa            %g0, [%g7] ASI_DMMU
-       flush           %g6
+       sethi           %hi(empty_zero_page), %g7
+       flush           %g7
 
        ldxa            [%o3] ASI_DTLB_DATA_ACCESS, %g7
        stxa            %o0, [%o2] ASI_DMMU
index a5f458e30c45610dbd288928bcb4eafe650b94e3..42a7544864f5a8a960375614e38c52a05683dcfb 100644 (file)
@@ -3833,7 +3833,7 @@ void epca_setup(char *str, int *ints)
 
                        case 5:
                                board.port = (unsigned char *)ints[index];
-                               if (board.port <= 0)
+                               if ((signed long)board.port <= 0)
                                {
                                        printk(KERN_ERR "<Error> - epca_setup: Invalid io port 0x%x\n", (unsigned int)board.port);
                                        invalid_lilo_config = 1;
@@ -3845,7 +3845,7 @@ void epca_setup(char *str, int *ints)
 
                        case 6:
                                board.membase = (unsigned char *)ints[index];
-                               if (board.membase <= 0)
+                               if ((signed long)board.membase <= 0)
                                {
                                        printk(KERN_ERR "<Error> - epca_setup: Invalid memory base 0x%x\n",(unsigned int)board.membase);
                                        invalid_lilo_config = 1;
index 65c4368cdf962a7570f6d3df5fcd5c0a9fd5a1f2..e7b0898f3ecfceb3c2eeeee4992e792f0c60ada0 100644 (file)
@@ -507,7 +507,7 @@ void b1_handle_interrupt(avmcard * card)
        struct sk_buff *skb;
 
        unsigned ApplId;
-       unsigned MsgLen;
+       signed MsgLen;
        unsigned DataB3Len;
        unsigned NCCI;
        unsigned WindowSize;
index 1785e174021287322735835495f77c24efdd884f..a5a7cd72b6138b5bc50beeba0cf53dfe6ccfb25f 100644 (file)
@@ -462,7 +462,8 @@ static void b1dma_handle_rx(avmcard *card)
        struct capi_ctr *ctrl = cinfo->capi_ctrl;
        struct sk_buff *skb;
        void *p = dma->recvbuf+4;
-       __u32 ApplId, MsgLen, DataB3Len, NCCI, WindowSize;
+       __u32 ApplId, DataB3Len, NCCI, WindowSize;
+       __s32 MsgLen;
        __u8 b1cmd =  _get_byte(&p);
 
 #ifdef CONFIG_B1DMA_DEBUG
index 7e4f1f1c3da85b8e75a628d19791b5a91cc37c81..9a649dee9fa497f73833a3fe1071ff1d28983877 100644 (file)
@@ -535,7 +535,8 @@ static void c4_handle_rx(avmcard *card)
        avmctrl_info *cinfo;
        struct sk_buff *skb;
        void *p = dma->recvbuf;
-       __u32 ApplId, MsgLen, DataB3Len, NCCI, WindowSize;
+       __u32 ApplId, DataB3Len, NCCI, WindowSize;
+       __s32 MsgLen;
        __u8 b1cmd =  _get_byte(&p);
        __u32 cidx;
 
index e1efd3939ffbc54faaa591c0423190a5b10ad9fe..161f8add7361286eafc9242c9fec1ef51e31f911 100644 (file)
@@ -190,7 +190,7 @@ static void t1_handle_interrupt(avmcard * card)
        struct sk_buff *skb;
 
        unsigned ApplId;
-       unsigned MsgLen;
+       signed MsgLen;
        unsigned DataB3Len;
        unsigned NCCI;
        unsigned WindowSize;
index 53d11427576510a85367e374b82927a7f6641a05..a248b27227ed67939bb884996055c1c370bc28a4 100644 (file)
@@ -878,10 +878,6 @@ static int hdlc_open(struct device *dev)
        if (hdlc->mode==MODE_NONE)
                return -ENOSYS;
 
-       result=hdlc->open(hdlc);
-       if (result)
-               return result;
-  
        memset(&(hdlc->stats), 0, sizeof(struct net_device_stats));
 
        if (mode_is(hdlc, MODE_FR | MODE_SOFT) ||
@@ -898,12 +894,28 @@ static int hdlc_open(struct device *dev)
                result = sppp_open(dev);
                if (result) {
                        sppp_detach(dev);
-                       hdlc->close(hdlc);
                        return result;
                }
        }
 
-       return 0;
+       result=hdlc->open(hdlc);
+       if (result) {
+               if (mode_is(hdlc, MODE_FR | MODE_SOFT) ||
+                   mode_is(hdlc, MODE_CISCO | MODE_SOFT))
+                       fr_cisco_close(hdlc);
+
+               else if (mode_is(hdlc, MODE_PPP | MODE_SOFT)) {
+                       sppp_close(dev);
+                       sppp_detach(dev);
+                       dev->rebuild_header=NULL;
+                       dev->change_mtu=hdlc_change_mtu;
+                       dev->mtu=HDLC_MAX_MTU;
+                       dev->hard_header_len=16;
+               }
+
+       }
+
+       return result;
 }
 
 
@@ -912,6 +924,8 @@ static int hdlc_close(struct device *dev)
 {
        hdlc_device *hdlc=dev_to_hdlc(dev);
 
+       hdlc->close(hdlc);
+
        if (mode_is(hdlc, MODE_FR | MODE_SOFT) ||
            mode_is(hdlc, MODE_CISCO | MODE_SOFT))
                fr_cisco_close(hdlc);
@@ -925,7 +939,6 @@ static int hdlc_close(struct device *dev)
                dev->hard_header_len=16;
        }
 
-       hdlc->close(hdlc);
        return 0;
 }
 
index c516d98fdc7ace7c748fabb80438883cd3c4119f..cb83c35a66daa3a83208e63d734f662ec09045b0 100644 (file)
@@ -37,6 +37,14 @@ else
   endif
 endif
 
+ifeq ($(CONFIG_DISPLAY7SEG),y)
+O_OBJS += display7seg.o
+else
+  ifeq ($(CONFIG_DISPLAY7SEG),m)
+  M_OBJS += display7seg.o
+  endif
+endif
+
 endif # eq($(CONFIG_PCI,y)
 
 ifeq ($(CONFIG_OBP_FLASH),y)
diff --git a/drivers/sbus/char/display7seg.c b/drivers/sbus/char/display7seg.c
new file mode 100644 (file)
index 0000000..a8a32a1
--- /dev/null
@@ -0,0 +1,264 @@
+/* $Id: display7seg.c,v 1.1.2.1 2000/07/27 01:50:59 davem Exp $
+ *
+ * display7seg - Driver implementation for the 7-segment display
+ * present on Sun Microsystems CP1400 and CP1500
+ *
+ * Copyright (c) 2000 Eric Brower (ebrower@usa.net)
+ *
+ */
+
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/version.h>
+#include <linux/fs.h>
+#include <linux/errno.h>
+#include <linux/major.h>
+#include <linux/init.h>
+#include <linux/miscdevice.h>
+#include <linux/ioport.h>              /* request_region, check_region */
+#include <asm/ebus.h>                  /* EBus device                  */
+#include <asm/oplib.h>                 /* OpenProm Library             */
+#include <asm/uaccess.h>               /* put_/get_user_ret            */
+
+#include <asm/display7seg.h>
+
+#define D7S_MINOR      193
+#define D7S_OBPNAME    "display7seg"
+#define D7S_DEVNAME "d7s"
+
+static int sol_compat = 0;             /* Solaris compatibility mode   */
+
+#ifdef MODULE
+EXPORT_NO_SYMBOLS;
+
+/* Solaris compatibility flag -
+ * The Solaris implementation omits support for several
+ * documented driver features (ref Sun doc 806-0180-03).  
+ * By default, this module supports the documented driver 
+ * abilities, rather than the Solaris implementation:
+ *
+ *     1) Device ALWAYS reverts to OBP-specified FLIPPED mode
+ *        upon closure of device or module unload.
+ *     2) Device ioctls D7SIOCRD/D7SIOCWR honor toggling of
+ *        FLIP bit
+ *
+ * If you wish the device to operate as under Solaris,
+ * omitting above features, set this parameter to non-zero.
+ */
+MODULE_PARM
+       (sol_compat, "1i");
+MODULE_PARM_DESC
+       (sol_compat, 
+        "Disables documented functionality omitted from Solaris driver");
+
+MODULE_AUTHOR
+       ("Eric Brower <ebrower@usa.net>");
+MODULE_DESCRIPTION
+       ("7-Segment Display driver for Sun Microsystems CP1400/1500");
+MODULE_SUPPORTED_DEVICE
+       ("d7s");
+#endif /* ifdef MODULE */
+
+/*
+ * Register block- see header for details
+ * -----------------------------------------
+ * | DP | ALARM | FLIP | 4 | 3 | 2 | 1 | 0 |
+ * -----------------------------------------
+ *
+ * DP          - Toggles decimal point on/off 
+ * ALARM       - Toggles "Alarm" LED green/red
+ * FLIP                - Inverts display for upside-down mounted board
+ * bits 0-4    - 7-segment display contents
+ */
+
+struct d7s_regs {
+       volatile __u8 regblk;
+};
+
+volatile struct d7s_regs *regs;
+
+static inline void d7s_free(void)
+{
+       release_region((unsigned long)regs, sizeof(*regs));
+}
+
+static inline int d7s_obpflipped(void)
+{
+       int opt_node, ret;
+
+       opt_node = prom_getchild(prom_root_node);
+       opt_node = prom_searchsiblings(opt_node, "options");
+
+       ret = prom_getintdefault(opt_node, "d7s-flipped?", -1);
+       if (ret != -1)
+               ret = 0;
+       else
+               ret = 1;
+
+       return ret;
+}
+
+static int d7s_open(struct inode *inode, struct file *f)
+{
+       if (D7S_MINOR != MINOR(inode->i_rdev))
+               return -ENODEV;
+
+       MOD_INC_USE_COUNT;
+       return 0;
+}
+
+static int d7s_release(struct inode *inode, struct file *f)
+{
+       if (D7S_MINOR != MINOR(inode->i_rdev))
+               return -ENODEV;
+       
+       MOD_DEC_USE_COUNT;
+
+       /* Reset flipped state to OBP default only if
+        * no other users have the device open and we
+        * are not operating in solaris-compat mode.
+        */
+       if (MOD_IN_USE == 0 && sol_compat == 0) {
+               if (d7s_obpflipped() == 0)
+                       regs->regblk |= D7S_FLIP;
+               else
+                       regs->regblk &= ~D7S_FLIP;
+       }
+
+       return 0;
+}
+
+static int d7s_ioctl(struct inode *inode, struct file *f, 
+                    unsigned int cmd, unsigned long arg)
+{
+       __u8 ireg = 0;
+
+       if (D7S_MINOR != MINOR(inode->i_rdev))
+               return -ENODEV;
+
+       switch (cmd) {
+       case D7SIOCWR:
+               /* Assign device register values,
+                * we mask-out D7S_FLIP if in sol_compat mode.
+                */
+               get_user_ret(ireg, (int *) arg, -EFAULT);
+               if (sol_compat != 0) {
+                       if (regs->regblk & D7S_FLIP)
+                               ireg |= D7S_FLIP;
+                       else
+                               ireg &= ~D7S_FLIP;
+               }
+               regs->regblk = ireg;
+               break;
+       case D7SIOCRD:
+               /* Retrieve device register values.
+                *
+                * NOTE: Solaris implementation returns D7S_FLIP bit
+                * as toggled by user, even though it does not honor it.
+                * This driver will not misinform you about the state
+                * of your hardware while in sol_compat mode.
+                */
+               put_user_ret(regs->regblk, (int *) arg, -EFAULT);
+               break;
+       case D7SIOCTM:
+               /* Toggle device mode-- flip display orientation. */
+               if (regs->regblk & D7S_FLIP)
+                       regs->regblk &= ~D7S_FLIP;
+               else
+                       regs->regblk |= D7S_FLIP;
+               break;
+       };
+
+       return 0;
+}
+
+static struct file_operations d7s_fops = {
+       NULL,                   /* lseek                */
+       NULL,                   /* read                 */
+       NULL,                   /* write                */
+       NULL,                   /* readdir              */
+       NULL,                   /* select               */
+       d7s_ioctl,
+       NULL,                   /* mmap                 */
+       d7s_open,
+       NULL,                   /* flush                */
+       d7s_release,
+       NULL,                   /* fsync                */
+       NULL,                   /* fasync               */
+       NULL,                   /* chk media chg*/
+       NULL,                   /* revalidate   */
+       NULL,                   /* lock                 */
+};
+
+static struct miscdevice d7s_miscdev = { D7S_MINOR, D7S_DEVNAME, &d7s_fops };
+
+#ifdef MODULE
+int init_module(void)
+#else
+__initfunc(int d7s_init(void))
+#endif
+{
+       struct linux_ebus *ebus = NULL;
+       struct linux_ebus_device *edev = NULL;
+       int iTmp = 0;
+
+       for_each_ebus(ebus) {
+               for_each_ebusdev(edev, ebus) {
+                       if (!strcmp(edev->prom_name, D7S_OBPNAME))
+                               goto ebus_done;
+               }
+       }
+
+ebus_done:
+       if (!edev) {
+               printk("%s: unable to locate device\n", D7S_DEVNAME);
+               return -ENODEV;
+       }
+
+       if (check_region(edev->base_address[0], sizeof(*regs))) {
+               printk("%s: Can't get region %lx, %d\n",
+                      __FUNCTION__, edev->base_address[0], (int)sizeof(*regs));
+               return -ENODEV;
+       }
+
+       regs = (struct d7s_regs *) edev->base_address[0];
+       request_region((unsigned long) regs, sizeof(*regs), D7S_OBPNAME);
+       iTmp = misc_register(&d7s_miscdev);
+       if (iTmp != 0) {
+               printk("%s: unable to acquire miscdevice minor %i\n",
+                      D7S_DEVNAME, D7S_MINOR);
+               return iTmp;
+       }
+
+       /* OBP option "d7s-flipped?" is honored as default
+        * for the device, and reset default when detached
+        */
+       iTmp = d7s_obpflipped();
+       if (iTmp == 0)
+               regs->regblk |= D7S_FLIP;
+       else
+               regs->regblk &= ~D7S_FLIP;
+
+       printk("%s: 7-Segment Display%s at 0x%lx %s\n", 
+               D7S_DEVNAME,
+               (iTmp == 0) ? (" (FLIPPED)") : (""),
+               edev->base_address[0],
+               (sol_compat != 0) ? ("in sol_compat mode") : (""));
+       return 0;
+}
+
+#ifdef MODULE
+void cleanup_module(void)
+{
+       /* Honor OBP d7s-flipped? unless operating in solaris-compat mode. */
+       if (sol_compat == 0) {
+               if (d7s_obpflipped() == 0)
+                       regs->regblk |= D7S_FLIP;
+               else
+                       regs->regblk &= ~D7S_FLIP;
+       }
+
+       misc_deregister(&d7s_miscdev);
+       d7s_free();
+}
+#endif
index e1fb8e0a0d291afd599ea447cdc0a9b06f29e138..88fdfd6bd1224e7730e17224e12be519fd28dded 100644 (file)
@@ -2,8 +2,6 @@
    3w-xxxx.c -- 3ware Storage Controller device driver for Linux.
 
    Written By: Adam Radford <linux@3ware.com>
-   Modifications By: Joel Jacobson <linux@3ware.com>
-
    Copyright (C) 1999-2000 3ware Inc.
 
    Kernel compatablity By:     Andre Hedrick <andre@suse.com>
 
    For more information, goto:
    http://www.3ware.com
-
-   History
-   -------
-   0.1.000 -     Initial release.
-   0.4.000 -     Added support for Asynchronous Event Notification through
-                 ioctls for 3DM.
-   1.0.000 -     Added DPO & FUA bit support for WRITE_10 & WRITE_6 cdb
-                 to disable drive write-cache before writes.
-   1.1.000 -     Fixed performance bug with DPO & FUA not existing for WRITE_6.
-   1.2.000 -     Added support for clean shutdown notification/feature table.
-   1.02.00.001 - Added support for full command packet posts through ioctls
-                 for 3DM.
-                 Bug fix so hot spare drives don't show up.
 */
 
 #include <linux/module.h>
@@ -80,7 +65,6 @@ MODULE_DESCRIPTION ("3ware Storage Controller Linux Driver");
 #include <linux/string.h>
 #include <linux/delay.h>
 #include <linux/smp.h>
-#include <linux/reboot.h>
 
 #include <asm/spinlock.h>
 #include <asm/errno.h>
@@ -99,12 +83,6 @@ MODULE_DESCRIPTION ("3ware Storage Controller Linux Driver");
 static int tw_copy_info(TW_Info *info, char *fmt, ...);
 static void tw_copy_mem_info(TW_Info *info, char *data, int len);
 static void tw_interrupt(int irq, void *dev_instance, struct pt_regs *regs);
-static int tw_halt(struct notifier_block *nb, ulong event, void *buf);
-
-/* Notifier block to get a notify on system shutdown/halt/reboot */
-static struct notifier_block tw_notifier = {
-  tw_halt, NULL, 0
-};
 
 struct proc_dir_entry tw_scsi_proc_entry = {
        PROC_SCSI_3W_XXXX,
@@ -113,7 +91,7 @@ struct proc_dir_entry tw_scsi_proc_entry = {
 };
 
 /* Globals */
-char *tw_driver_version="1.02.00.001";
+char *tw_driver_version="1.1.000";
 TW_Device_Extension *tw_device_extension_list[TW_MAX_SLOT];
 int tw_device_extension_count = 0;
 
@@ -252,7 +230,7 @@ int tw_aen_drain_queue(TW_Device_Extension *tw_dev)
                                if (command_packet->status != 0) {
                                        if (command_packet->flags != TW_AEN_TABLE_UNDEFINED) {
                                                /* Bad response */
-                                               printk(KERN_WARNING "3w-xxxx: tw_aen_drain_queue(): Bad response, status = 0x%x, flags = 0x%x.\n", command_packet->status, command_packet->flags);
+                                               printk(KERN_WARNING "3w-xxxx: tw_aen_drain_queue(): Bad response, flags = 0x%x.\n", command_packet->flags);
                                                return 1;
                                        } else {
                                                /* We know this is a 3w-1x00, and doesn't support aen's */
@@ -590,7 +568,6 @@ int tw_findcards(Scsi_Host_Template *tw_host)
        TW_Device_Extension *tw_dev2;
        struct pci_dev *tw_pci_dev = pci_devices;
        u32 status_reg_value;
-       unsigned char c = 1;
 
        dprintk(KERN_NOTICE "3w-xxxx: tw_findcards()\n");
        while ((tw_pci_dev = pci_find_device(TW_VENDOR_ID, TW_DEVICE_ID, tw_pci_dev))) {
@@ -689,7 +666,7 @@ int tw_findcards(Scsi_Host_Template *tw_host)
                        continue;
                }
 
-               error = tw_initconnection(tw_dev, TW_INIT_MESSAGE_CREDITS);
+               error = tw_initconnection(tw_dev);
                if (error) {
                        printk(KERN_WARNING "3w-xxxx: tw_findcards(): Couldn't initconnection for card %d.\n", numcards);
                        release_region((tw_dev->tw_pci_dev->base_address[0]), TW_IO_ADDRESS_RANGE);
@@ -749,14 +726,10 @@ int tw_findcards(Scsi_Host_Template *tw_host)
                /* Free the temporary device extension */
                if (tw_dev)
                        kfree(tw_dev);
-               /* Tell the firmware we support shutdown notification*/
-               tw_setfeature(tw_dev, 2, 1, &c);
        }
 
        if (numcards == 0) 
                printk(KERN_WARNING "3w-xxxx: tw_findcards(): No cards found.\n");
-       else
-         register_reboot_notifier(&tw_notifier);
 
        return numcards;
 } /* End tw_findcards() */
@@ -778,22 +751,8 @@ void tw_free_device_extension(TW_Device_Extension *tw_dev)
        }
 } /* End tw_free_device_extension() */
 
-/* Clean shutdown routine */
-static int tw_halt(struct notifier_block *nb, ulong event, void *buf)
-{
-       int i;
-       
-       for (i=0;i<tw_device_extension_count;i++) {
-               printk(KERN_NOTICE "3w-xxxx: Notifying card #%d\n", i);
-               tw_shutdown_device(tw_device_extension_list[i]);
-       }
-       unregister_reboot_notifier(&tw_notifier);
-       
-       return NOTIFY_OK;
-} /* End tw_halt() */
-
 /* This function will send an initconnection command to controller */
-int tw_initconnection(TW_Device_Extension *tw_dev, int message_credits
+int tw_initconnection(TW_Device_Extension *tw_dev) 
 {
        u32 command_que_addr, command_que_value;
        u32 status_reg_addr, status_reg_value;
@@ -825,7 +784,7 @@ int tw_initconnection(TW_Device_Extension *tw_dev, int message_credits)
        command_packet->byte3.host_id = 0x0;
        command_packet->status = 0x0;
        command_packet->flags = 0x0;
-       command_packet->byte6.message_credits = message_credits
+       command_packet->byte6.message_credits = TW_INIT_MESSAGE_CREDITS
        command_packet->byte8.init_connection.response_queue_pointer = 0x0;
        command_que_value = tw_dev->command_packet_physical_address[request_id];
 
@@ -856,7 +815,7 @@ int tw_initconnection(TW_Device_Extension *tw_dev, int message_credits)
                        }
                        if (command_packet->status != 0) {
                                /* bad response */
-                               printk(KERN_WARNING "3w-xxxx: tw_initconnection(): Bad response, status = 0x%x, flags = 0x%x.\n", command_packet->status, command_packet->flags);
+                               printk(KERN_WARNING "3w-xxxx: tw_initconnection(): Bad response, flags = 0x%x.\n", command_packet->flags);
                                return 1;
                        }
                        break;  /* Response was okay, so we exit */
@@ -1003,7 +962,7 @@ int tw_initialize_units(TW_Device_Extension *tw_dev)
                        }
                        if (command_packet->status != 0) {
                                /* bad response */
-                               printk(KERN_WARNING "3w-xxxx: tw_initialize_units(): Bad response, status = 0x%x, flags = 0x%x.\n", command_packet->status, command_packet->flags);
+                               printk(KERN_WARNING "3w-xxxx: tw_initialize_units(): Bad response, flags = 0x%x.\n", command_packet->flags);
                                return 1;
                        }
                        found = 1;
@@ -1025,11 +984,9 @@ int tw_initialize_units(TW_Device_Extension *tw_dev)
                if (is_unit_present[i] == 0) {
                        tw_dev->is_unit_present[i] = FALSE;
                } else {
-                 if (is_unit_present[i] & TW_UNIT_ONLINE) {
                        dprintk(KERN_NOTICE "3w-xxxx: tw_initialize_units(): Unit %d found.\n", i);
                        tw_dev->is_unit_present[i] = TRUE;
                        num_units++;
-                 }
                }
        }
        tw_dev->num_units = num_units;
@@ -1133,7 +1090,7 @@ static void tw_interrupt(int irq, void *dev_instance, struct pt_regs *regs)
                                request_id = response_que.u.response_id;
                                command_packet = (TW_Command *)tw_dev->command_packet_virtual_address[request_id];
                                if (command_packet->status != 0) {
-                                       printk(KERN_WARNING "3w-xxxx: tw_interrupt(): Bad response, status = 0x%x, flags = 0x%x.\n", command_packet->status, command_packet->flags);
+                                       printk(KERN_WARNING "3w-xxxx: tw_interrupt(): Bad response, flags = 0x%x.\n", command_packet->flags);
                                }
                                if (tw_dev->state[request_id] != TW_S_POSTED) {
                                        printk(KERN_WARNING "3w-xxxx: tw_interrupt(): Received a request id (%d) (opcode = 0x%x) that wasn't posted.\n", request_id, command_packet->byte0.opcode);
@@ -1229,7 +1186,7 @@ int tw_ioctl(TW_Device_Extension *tw_dev, int request_id)
        /* Initialize command packet */
        command_packet = (TW_Command *)tw_dev->command_packet_virtual_address[request_id];
        if (command_packet == NULL) {
-               printk(KERN_WARNING "3w-xxxx: tw_ioctl(): Bad command packet virtual address.\n");
+               printk(KERN_WARNING "3w-xxxx: twioctl(): Bad command packet virtual address.\n");
                tw_dev->state[request_id] = TW_S_COMPLETED;
                tw_state_request_finish(tw_dev, request_id);
                tw_dev->srb[request_id]->result = (DID_OK << 16);
@@ -1299,12 +1256,6 @@ int tw_ioctl(TW_Device_Extension *tw_dev, int request_id)
                        tw_dev->srb[request_id]->result = (DID_OK << 16);
                        tw_dev->srb[request_id]->scsi_done(tw_dev->srb[request_id]);
                        return 0;
-               case TW_CMD_PACKET:
-                 memcpy(command_packet, ioctl->data, sizeof(TW_Command));
-                 command_packet->request_id = request_id;
-                 tw_post_command_packet(tw_dev, request_id);
-               
-                 return 0;
                default:
                        printk(KERN_WARNING "3w-xxxx: Unknown ioctl 0x%x.\n", opcode);
                        tw_dev->state[request_id] = TW_S_COMPLETED;
@@ -1529,7 +1480,7 @@ int tw_reset_sequence(TW_Device_Extension *tw_dev)
                return 1;
        }
 
-       error = tw_initconnection(tw_dev, TW_INIT_MESSAGE_CREDITS);
+       error = tw_initconnection(tw_dev);
        if (error) {
                printk(KERN_WARNING "3w-xxxx: tw_reset_sequence(): Couldn't initconnection for card %d.\n", tw_dev->host->host_no);
                return 1;
@@ -1853,11 +1804,6 @@ int tw_scsi_release(struct Scsi_Host *tw_host)
        /* Tell kernel scsi-layer we are gone */
        scsi_unregister(tw_host);
 
-       /* Fake like we just shut down, so notify the card that
-        * we "shut down cleanly".
-        */
-       tw_halt(0, 0, 0);  // parameters aren't actually used
-
        return 0;
 } /* End tw_scsi_release() */
 
@@ -1955,10 +1901,8 @@ int tw_scsiop_inquiry_complete(TW_Device_Extension *tw_dev, int request_id)
                if (is_unit_present[i] == 0) {
                        tw_dev->is_unit_present[i] = FALSE;
                } else {
-                 if (is_unit_present[i] & TW_UNIT_ONLINE) {
                        tw_dev->is_unit_present[i] = TRUE;
                        dprintk(KERN_NOTICE "3w-xxxx: tw_scsiop_inquiry_complete: Unit %d found.\n", i);
-                 }
                }
        }
 
@@ -2181,92 +2125,6 @@ int tw_scsiop_test_unit_ready(TW_Device_Extension *tw_dev, int request_id)
        return 0;
 } /* End tw_scsiop_test_unit_ready() */
 
-/* Set a value in the features table */
-int tw_setfeature(TW_Device_Extension *tw_dev, int parm, int param_size,
-                  unsigned char *val)
-{
-       TW_Param *param;
-       TW_Command  *command_packet;
-       TW_Response_Queue response_queue;
-       int request_id = 0;
-       u32 command_que_value, command_que_addr;
-       u32 status_reg_addr, status_reg_value;
-       u32 response_que_addr;
-       u32 param_value;
-       int imax, i;
-
-       /* Initialize SetParam command packet */
-       if (tw_dev->command_packet_virtual_address[request_id] == NULL) {
-               printk(KERN_WARNING "3w-xxxx: tw_setfeature(): Bad command packet virtual address.\n");
-               return 1;
-       }
-       command_packet = (TW_Command *)tw_dev->command_packet_virtual_address[request_id];
-       memset(command_packet, 0, sizeof(TW_Sector));
-       param = (TW_Param *)tw_dev->alignment_virtual_address[request_id];
-
-       command_packet->byte0.opcode = TW_OP_SET_PARAM;
-       command_packet->byte0.sgl_offset  = 2;
-       param->table_id = 0x404;  /* Features table */
-       param->parameter_id = parm;
-       param->parameter_size_bytes = param_size;
-       memcpy(param->data, val, param_size);
-
-       param_value = tw_dev->alignment_physical_address[request_id];
-       if (param_value == 0) {
-               printk(KERN_WARNING "3w-xxxx: tw_ioctl(): Bad alignment physical address.\n");
-               tw_dev->state[request_id] = TW_S_COMPLETED;
-               tw_state_request_finish(tw_dev, request_id);
-               tw_dev->srb[request_id]->result = (DID_OK << 16);
-               tw_dev->srb[request_id]->scsi_done(tw_dev->srb[request_id]);
-       }
-       command_packet->byte8.param.sgl[0].address = param_value;
-       command_packet->byte8.param.sgl[0].length = sizeof(TW_Sector);
-
-       command_packet->size = 4;
-       command_packet->request_id = request_id;
-       command_packet->byte6.parameter_count = 1;
-
-       command_que_value = tw_dev->command_packet_physical_address[request_id];
-       if (command_que_value == 0) {
-               printk(KERN_WARNING "3w-xxxx: tw_setfeature(): Bad command packet physical address.\n");
-               return 1;
-       }
-       command_que_addr = tw_dev->registers.command_que_addr;
-       status_reg_addr = tw_dev->registers.status_reg_addr;
-       response_que_addr = tw_dev->registers.response_que_addr;
-
-       /* Send command packet to the board */
-       outl(command_que_value, command_que_addr);
-
-       /* Poll for completion */
-       imax = TW_POLL_MAX_RETRIES;
-       for (i=0;i<imax;i++) {
-               mdelay(10);
-               status_reg_value = inl(status_reg_addr);
-               if (tw_check_bits(status_reg_value)) {
-                       printk(KERN_WARNING "3w-xxxx: tw_setfeature(): Unexpected bits.\n");
-                       return 1;
-               }
-               if ((status_reg_value & TW_STATUS_RESPONSE_QUEUE_EMPTY) == 0) {
-                       response_queue.value = inl(response_que_addr);
-                       request_id = (unsigned char)response_queue.u.response_id;
-                       if (request_id != 0) {
-                               /* unexpected request id */
-                               printk(KERN_WARNING "3w-xxxx: tw_setfeature(): Unexpected request id.\n");
-                               return 1;
-                       }
-                       if (command_packet->status != 0) {
-                               /* bad response */
-                               printk(KERN_WARNING "3w-xxxx: tw_setfeature(): Bad response, status = 0x%x, flags = 0x%x.\n", command_packet->status, command_packet->flags);
-                               return 1;
-                       }
-                       break; /* Response was okay, so we exit */
-               }
-       }
-
-       return 0;
-} /* End tw_setfeature() */
-
 /* This function will setup the interrupt handler */
 int tw_setup_irq(TW_Device_Extension *tw_dev)
 {
@@ -2283,29 +2141,6 @@ int tw_setup_irq(TW_Device_Extension *tw_dev)
        return 0;
 } /* End tw_setup_irq() */
 
-/* This function will tell the controller we're shutting down by sending
-   initconnection with a 1 */
-int tw_shutdown_device(TW_Device_Extension *tw_dev)
-{
-       int error;
-
-       /* Disable interrupts */
-       tw_disable_interrupts(tw_dev);
-
-       /* poke the board */
-       error = tw_initconnection(tw_dev, 1);
-       if (error) {
-               printk(KERN_WARNING "3w-xxxx: tw_shutdown_device(): Couldn't initconnection for card %d.\n", tw_dev->host->host_no);
-       } else {
-               printk(KERN_NOTICE "3w-xxxx shutdown succeeded\n");
-       }
-
-       /* Re-enable interrupts */
-       tw_enable_interrupts(tw_dev);
-
-       return 0;
-} /* End tw_shutdown_device() */
-
 /* This function will soft reset the controller */
 void tw_soft_reset(TW_Device_Extension *tw_dev) 
 {
index a48dc9ea8801f5214a0905a687fc6e8cc1c45720..b3989c71cf48920b323fa682010ce55480acafaf 100644 (file)
@@ -2,9 +2,7 @@
    3w-xxxx.h -- 3ware Storage Controller device driver for Linux.
    
    Written By: Adam Radford <linux@3ware.com>
-   Modifications By: Joel Jacobson <linux@3ware.com>
-
-   Copyright (C) 1999, 2000 3ware Inc.
+   Copyright (C) 1999 3ware Inc.
 
    Kernel compatablity By:     Andre Hedrick <andre@suse.com>
    Non-Copyright (C) 2000      Andre Hedrick <andre@suse.com>
 #define TW_OP_SET_PARAM              0x13
 #define TW_OP_SECTOR_INFO     0x1a
 #define TW_OP_AEN_LISTEN      0x1c
-#define TW_CMD_PACKET         0x1d
 
 /* Asynchronous Event Notification (AEN) Codes */
 #define TW_AEN_QUEUE_EMPTY       0x0000
 #define TW_BLOCK_SIZE                        0x200 /* 512-byte blocks */
 #define TW_IOCTL                              0x80
 #define TW_MAX_AEN_TRIES                      100
-#define TW_UNIT_ONLINE                        1
+
 #define TW_IN_INTR                            1
 
 /* Macros */
@@ -308,7 +305,7 @@ int tw_empty_response_que(TW_Device_Extension *tw_dev);
 void tw_enable_interrupts(TW_Device_Extension *tw_dev);
 int tw_findcards(Scsi_Host_Template *tw_host);
 void tw_free_device_extension(TW_Device_Extension *tw_dev);
-int tw_initconnection(TW_Device_Extension *tw_dev, int message_credits);
+int tw_initconnection(TW_Device_Extension *tw_dev);
 int tw_initialize_device_extension(TW_Device_Extension *tw_dev);
 int tw_initialize_units(TW_Device_Extension *tw_dev);
 int tw_ioctl(TW_Device_Extension *tw_dev, int request_id);
@@ -331,9 +328,7 @@ int tw_scsiop_read_capacity(TW_Device_Extension *tw_dev, int request_id);
 int tw_scsiop_read_capacity_complete(TW_Device_Extension *tw_dev, int request_id);
 int tw_scsiop_read_write(TW_Device_Extension *tw_dev, int request_id);
 int tw_scsiop_test_unit_ready(TW_Device_Extension *tw_dev, int request_id);
-int tw_setfeature(TW_Device_Extension *tw_dev, int parm, int param_size, unsigned char *val);
 int tw_setup_irq(TW_Device_Extension *tw_dev);
-int tw_shutdown_device(TW_Device_Extension *tw_dev);
 void tw_soft_reset(TW_Device_Extension *tw_dev);
 int tw_state_request_finish(TW_Device_Extension *tw_dev,int request_id);
 int tw_state_request_start(TW_Device_Extension *tw_dev, int *request_id);
@@ -356,8 +351,6 @@ void tw_unmask_command_interrupt(TW_Device_Extension *tw_dev);
        eh_strategy_handler : NULL,                     \
        eh_abort_handler : tw_scsi_eh_abort,            \
        eh_device_reset_handler : NULL,                 \
-        eh_bus_reset_handler : NULL,                    \
-        eh_host_reset_handler : tw_scsi_eh_reset,       \
        abort : NULL,                                   \
        reset : NULL,                                   \
        slave_attach : NULL,                            \
index 0228eff1b800634f21f7ed4656eefef51c18ae22..da5f7a5b5efcef3c4ea8287c94fb0bd3abeb46aa 100644 (file)
@@ -1272,8 +1272,11 @@ static int cs_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un
                        dmabuf->ready = 0;
                        if(val)
                                dmabuf->fmt |= CS_FMT_STEREO;
+#if 0                          
+                       /* Needs extra work to support this */                          
                        else
                                dmabuf->fmt &= ~CS_FMT_STEREO;
+#endif                         
                }
                return 0;
 
@@ -1290,12 +1293,12 @@ static int cs_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un
                }
 
        case SNDCTL_DSP_GETFMTS: /* Returns a mask of supported sample format*/
-               return put_user(AFMT_S16_LE|AFMT_U8, (int *)arg);
+               return put_user(AFMT_S16_LE, (int *)arg);
 
        case SNDCTL_DSP_SETFMT: /* Select sample format */
                get_user_ret(val, (int *)arg, -EFAULT);
                if (val != AFMT_QUERY) {
-                       if(val==AFMT_S16_LE || val==AFMT_U8)
+                       if(val==AFMT_S16_LE/* || val==AFMT_U8*/)
                        {
                                if (file->f_mode & FMODE_WRITE) {
                                        stop_dac(state);
@@ -1322,13 +1325,18 @@ static int cs_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un
                        if (file->f_mode & FMODE_WRITE) {
                                stop_dac(state);
                                dmabuf->ready = 0;
+                               if(val>1)
+                                       dmabuf->fmt |= CS_FMT_STEREO;
+                               else
+                                       dmabuf->fmt &= ~CS_FMT_STEREO;
                        }
                        if (file->f_mode & FMODE_READ) {
                                stop_adc(state);
                                dmabuf->ready = 0;
                        }
                }
-               return put_user(2, (int *)arg);
+               return put_user((dmabuf->fmt & CS_FMT_STEREO) ? 2 : 1,
+                               (int *)arg);
 
        case SNDCTL_DSP_POST:
                /* FIXME: the same as RESET ?? */
@@ -1393,7 +1401,7 @@ static int cs_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un
                return 0;
 
        case SNDCTL_DSP_GETCAPS:
-           return put_user(DSP_CAP_REALTIME|DSP_CAP_TRIGGER|DSP_CAP_MMAP,
+               return put_user(DSP_CAP_REALTIME|DSP_CAP_TRIGGER|DSP_CAP_MMAP,
                            (int *)arg);
 
        case SNDCTL_DSP_GETTRIGGER:
@@ -1543,21 +1551,23 @@ static int cs_open(struct inode *inode, struct file *file)
           should be default to unsigned 8-bits, mono, with sample rate 8kHz and
           /dev/dspW will accept 16-bits sample */
        if (file->f_mode & FMODE_WRITE) {
+               /* Output is 16bit only mono or stereo */
                dmabuf->fmt &= ~CS_FMT_MASK;
                dmabuf->fmt |= CS_FMT_16BIT;
                dmabuf->ossfragshift = 0;
                dmabuf->ossmaxfrags  = 0;
                dmabuf->subdivision  = 0;
-               cs_set_dac_rate(state, 48000);
+               cs_set_dac_rate(state, 8000);
        }
 
        if (file->f_mode & FMODE_READ) {
+               /* Input is 16bit stereo only */
                dmabuf->fmt &= ~CS_FMT_MASK;
-               dmabuf->fmt |= CS_FMT_16BIT;
+               dmabuf->fmt |= CS_FMT_16BIT|CS_FMT_STEREO;
                dmabuf->ossfragshift = 0;
                dmabuf->ossmaxfrags  = 0;
                dmabuf->subdivision  = 0;
-               cs_set_adc_rate(state, 48000);
+               cs_set_adc_rate(state, 8000);
        }
 
        state->open_mode |= file->f_mode & (FMODE_READ | FMODE_WRITE);
@@ -2212,7 +2222,7 @@ static int cs_hardware_init(struct cs_card *card)
                        break;
                current->state = TASK_UNINTERRUPTIBLE;
                schedule_timeout(1);
-       } while (end_time - (signed long)jiffies >= 0);
+       } while (time_before(end_time, jiffies));
 
        /*
         *  Make sure CODEC is READY.
@@ -2243,7 +2253,7 @@ static int cs_hardware_init(struct cs_card *card)
                        break;
                current->state = TASK_UNINTERRUPTIBLE;
                schedule_timeout(1);
-       } while (end_time - (signed long)jiffies >= 0);
+       } while (time_before(end_time, jiffies));
 
        /*
         *  Make sure input slots 3 and 4 are valid.  If not, then return
index f8c5945d5ad598185412ff6351f44fdb1d6e837b..5f71a5d16cd73e014e3d132e6ef69978fd0a4076 100644 (file)
@@ -90,7 +90,7 @@ pci_compat_register_driver(struct pci_driver *drv)
 {
         struct pci_dev *dev;
         int count = 0, found, i;
-
+#ifdef CONFIG_PCI
         list_add_tail(&drv->node, &pci_drivers);
         pci_for_each_dev(dev) {
                 found = 0;
@@ -100,6 +100,7 @@ pci_compat_register_driver(struct pci_driver *drv)
                 if (!found)
                         count += pci_announce_device(drv, dev);
         }
+#endif        
         return count;
 }
 
@@ -108,7 +109,7 @@ pci_compat_unregister_driver(struct pci_driver *drv)
 {
         struct pci_dev *dev;
         int i, found;
-
+#ifdef CONFIG_PCI
         list_del(&drv->node);
         pci_for_each_dev(dev) {
                 found = 0;
@@ -121,6 +122,7 @@ pci_compat_unregister_driver(struct pci_driver *drv)
                         drvmap[i].dev = NULL;
                 }
         }
+#endif        
 }
 
 unsigned long pci_compat_get_size (struct pci_dev *dev, int n_base)
index 86e14781c65e06cc294309edfdc7639e34b9a6e2..d7ffa7d60a32f1d44db60b883190be2b8fcac681 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- *     Trident 4D-Wave/SiS 7018 OSS driver for Linux 2.2.x
+ *     Trident 4D-Wave/SiS 7018/ALi 5451 OSS driver for Linux 2.2.x
  *
  *     Driver: Alan Cox <alan@redhat.com>
  *
@@ -12,6 +12,7 @@
  *  Hacked up by:
  *     Aaron Holtzman <aholtzma@ess.engr.uvic.ca>
  *     Ollie Lho <ollie@sis.com.tw> SiS 7018 Audio Core Support
+ *     Ching Ling Lee <cling-li@ali.com.tw> ALi 5451 Audio Core Support 
  *
  *
  *     This program is free software; you can redistribute it and/or modify
index eaa3c9928a71b118e75c351e41c5740d61596813..46ec916989d8a4d248c4373173900b7e39b019fb 100644 (file)
@@ -3026,7 +3026,7 @@ static void aec_stop(int board)
 
                ixj_WriteDSPCommand(0x0700, board);
        }
-       if (ixj[board].play_mode != -1 && ixj[board].rec_mode != -1);
+       if (ixj[board].play_mode != -1 && ixj[board].rec_mode != -1)
        {
                ixj_WriteDSPCommand(0xB002, board);     // AEC Stop
 
index c68cb5082890a73382874d71eafa100e58fd31b3..d07c626e51d053aab3c3cd24b548121b6a9a18cc 100644 (file)
@@ -92,7 +92,7 @@ if [ "$CONFIG_FB" = "y" ]; then
         bool '  G100/G200 support' CONFIG_FB_MATROX_G100
         bool '  Multihead support' CONFIG_FB_MATROX_MULTIHEAD
       fi
-      #bool 'ATI Rage128 display support' CONFIG_FB_ATY128
+      bool 'ATI Rage128 display support' CONFIG_FB_ATY128
     fi
   fi
   if [ "$ARCH" = "sparc" -o "$ARCH" = "sparc64" ]; then
index 2a42d064b2a8c2bf6309639bd7e9d96e4c92f7d7..baf75de595f252c2d639c2ed7d5cf85dc8ee6f83 100644 (file)
 #define GI_CHIP_ID     0x4749  /* RAGE PRO, BGA, PCI33 only */
 #define GP_CHIP_ID     0x4750  /* RAGE PRO, PQFP, PCI33, full 3D */
 #define GQ_CHIP_ID     0x4751  /* RAGE PRO, PQFP, PCI33, limited 3D */
-#define LN_CHIP_ID     0x4c4d  /* RAGE Mobility AGP */
+#define LM_CHIP_ID     0x4c4d  /* RAGE Mobility PCI */
+#define LN_CHIP_ID     0x4c4e  /* RAGE Mobility AGP */
 
 
 /* Mach64 major ASIC revisions */
index dacea73c1c55b037e82b7756e761f6b23713c47a..9cc8f7478ee61b5cfb8e836b3eadc5083f4252a7 100644 (file)
@@ -1,4 +1,4 @@
-/*  $Id: atyfb.c,v 1.106.2.8 2000/04/28 04:40:09 davem Exp $
+/*  $Id: atyfb.c,v 1.106.2.9 2000/06/23 12:06:38 davem Exp $
  *  linux/drivers/video/atyfb.c -- Frame buffer device for ATI Mach64
  *
  *     Copyright (C) 1997-1998  Geert Uytterhoeven
@@ -466,7 +466,8 @@ static struct aty_features {
     { 0x4749, 0x4749, "3D RAGE PRO (BGA, PCI)" },
     { 0x4750, 0x4750, "3D RAGE PRO (PQFP, PCI)" },
     { 0x4751, 0x4751, "3D RAGE PRO (PQFP, PCI, limited 3D)" },
-    { 0x4c4e, 0x4c4e, "3D RAGE Mobility (AGP)" }, /* Doesn't quite work yet */
+    { 0x4c4d, 0x4c4d, "3D RAGE Mobility (PCI)" },
+    { 0x4c4e, 0x4c4e, "3D RAGE Mobility (AGP)" },
 };
 
 static const char *aty_gx_ram[8] __initdata = {
@@ -1795,7 +1796,7 @@ static void atyfb_set_par(const struct atyfb_par *par,
        } else if ((Gx == VT_CHIP_ID) || (Gx == VU_CHIP_ID)) {
            aty_st_le32(DAC_CNTL, 0x87010184, info);
            aty_st_le32(BUS_CNTL, 0x680000f9, info);
-       } else if (Gx == LN_CHIP_ID) {
+       } else if ((Gx == LN_CHIP_ID) || (Gx == LM_CHIP_ID)) {
            aty_st_le32(DAC_CNTL, 0x80010102, info);
            aty_st_le32(BUS_CNTL, 0x7b33a040, info);
        } else {
@@ -2583,10 +2584,10 @@ __initfunc(static int aty_init(struct fb_info_aty *info, const char *name))
                /* Rage LT */
                pll = 230;
                mclk = 63;
-           } else if (Gx == LN_CHIP_ID) {
-               /* Rage mobility */
+           } else if ((Gx == LN_CHIP_ID) || (Gx == LM_CHIP_ID)) {
+               /* Rage mobility M1 */
                pll = 230;
-               mclk = 100;
+               mclk = 50;
            } else {
                /* other RAGE */
                pll = 135;
index c6c3dd0fefb62dcaee4033d9d53e58f6aba7cb49..dc1fab9d3576969f23289c83ddf2acfe7a9d33bb 100644 (file)
@@ -367,7 +367,7 @@ static int iga_setcolreg(unsigned regno, unsigned red, unsigned green,
        pci_outb(info, green, DAC_DATA);
        pci_outb(info, blue,  DAC_DATA);
 
-       if (regno << 16)
+       if (regno < 16) {
                switch (default_var.bits_per_pixel) {
 #ifdef FBCON_HAS_CFB16
                case 16:
@@ -383,11 +383,14 @@ static int iga_setcolreg(unsigned regno, unsigned red, unsigned green,
 #endif
 #ifdef FBCON_HAS_CFB32
                case 32:
+                       { int i;
                        i = (regno << 8) | regno;
                        info->fbcon_cmap.cfb32[regno] = (i << 16) | i;
+                       }
                        break;
 #endif
                }
+       }
        return 0;
 }
 
@@ -508,19 +511,19 @@ static void igafb_set_disp(int con, struct fb_info_iga *info)
         case 15:
         case 16:
                 sw = &fbcon_cfb16;
-               display->dispsw_data = fbcon_cmap.cfb16;
+               display->dispsw_data = info->fbcon_cmap.cfb16;
                 break;
 #endif
 #ifdef FBCON_HAS_CFB24
        case 24:
                sw = &fbcon_cfb24;
-               display->dispsw_data = fbcon_cmap.cfb24;
+               display->dispsw_data = info->fbcon_cmap.cfb24;
                break;
 #endif
 #ifdef FBCON_HAS_CFB32
         case 32:
                 sw = &fbcon_cfb32;
-               display->dispsw_data = fbcon_cmap.cfb32;
+               display->dispsw_data = info->fbcon_cmap.cfb32;
                 break;
 #endif
         default:
index ff6d02705a45f198c70ec2fa9c7bdb2491505454..67d4220c7024c5e785b01bfebde46705a1dba55c 100644 (file)
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -561,7 +561,7 @@ static inline int must_not_trace_exec(struct task_struct * p)
 
 /* 
  * Fill the binprm structure from the inode. 
- * Check permissions, then read the first 512 bytes
+ * Check permissions, then read the first 128 bytes
  */
 int prepare_binprm(struct linux_binprm *bprm)
 {
diff --git a/include/asm-sparc64/display7seg.h b/include/asm-sparc64/display7seg.h
new file mode 100644 (file)
index 0000000..c0f56ab
--- /dev/null
@@ -0,0 +1,79 @@
+/* $Id: display7seg.h,v 1.1.2.1 2000/07/27 01:50:59 davem Exp $
+ *
+ * display7seg - Driver interface for the 7-segment display
+ * present on Sun Microsystems CP1400 and CP1500
+ *
+ * Copyright (c) 2000 Eric Brower <ebrower@usa.net>
+ *
+ */
+
+#ifndef __display7seg_h__
+#define __display7seg_h__
+
+#define D7S_IOC        'p'
+
+#define D7SIOCRD _IOR(D7S_IOC, 0x45, int)      /* Read device state    */
+#define D7SIOCWR _IOW(D7S_IOC, 0x46, int)      /* Write device state   */
+#define D7SIOCTM _IO (D7S_IOC, 0x47)           /* Translate mode (FLIP)*/
+
+/*
+ * ioctl flag definitions
+ *
+ * POINT       - Toggle decimal point  (0=absent 1=present)
+ * ALARM       - Toggle alarm LED              (0=green  1=red)
+ * FLIP                - Toggle inverted mode  (0=normal 1=flipped) 
+ * bits 0-4    - Character displayed   (see definitions below)
+ *
+ * Display segments are defined as follows, 
+ * subject to D7S_FLIP register state:
+ *
+ *    a
+ *   ---
+ * f|   |b
+ *   -g-
+ * e|   |c
+ *   ---
+ *    d
+ */
+
+#define D7S_POINT      (1 << 7)        /* Decimal point*/
+#define D7S_ALARM      (1 << 6)        /* Alarm LED    */
+#define D7S_FLIP       (1 << 5)        /* Flip display */
+
+#define D7S_0          0x00            /* Numerals 0-9 */
+#define D7S_1          0x01
+#define D7S_2          0x02
+#define D7S_3          0x03
+#define D7S_4          0x04
+#define D7S_5          0x05
+#define D7S_6          0x06
+#define D7S_7          0x07
+#define D7S_8          0x08
+#define D7S_9          0x09
+#define D7S_A          0x0A            /* Letters A-F, H, L, P */
+#define D7S_B          0x0B
+#define D7S_C          0x0C
+#define D7S_D          0x0D
+#define D7S_E          0x0E
+#define D7S_F          0x0F
+#define D7S_H          0x10
+#define D7S_E2         0x11
+#define D7S_L          0x12
+#define D7S_P          0x13
+#define D7S_SEGA       0x14            /* Individual segments */
+#define D7S_SEGB       0x15
+#define D7S_SEGC       0x16
+#define D7S_SEGD       0x17
+#define D7S_SEGE       0x18
+#define D7S_SEGF       0x19
+#define D7S_SEGG       0x1A
+#define D7S_SEGABFG 0x1B               /* Segment groupings */
+#define D7S_SEGCDEG    0x1C
+#define D7S_SEGBCEF 0x1D
+#define D7S_SEGADG     0x1E
+#define D7S_BLANK      0x1F            /* Clear all segments */
+
+#define D7S_MIN_VAL    0x0
+#define D7S_MAX_VAL    0x1F
+
+#endif /* ifndef __display7seg_h__ */
index 79031f79a2edcaf5c3ba9d998ba27e86767b79c1..12baff70a9f1a3414985e35068fbe1e1e4f16faf 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: pbm.h,v 1.16 1999/03/14 18:13:03 davem Exp $
+/* $Id: pbm.h,v 1.16.2.1 2000/06/14 07:41:19 davem Exp $
  * pbm.h: U2P PCI bus module pseudo driver software state.
  *
  * Copyright (C) 1997 David S. Miller (davem@caip.rutgers.edu)
index 4170e030ee58548a692ab7d46a760f85ff8543f4..459dcaeb64f0d62c4fc7af75f09aa213db943985 100644 (file)
@@ -74,6 +74,7 @@
 #define FB_ACCEL_SUN_CGTHREE   24      /* Sun cgthree                   */
 #define FB_ACCEL_SUN_TCX       25      /* Sun tcx                       */
 #define FB_ACCEL_MATROX_MGAG400 26     /* Matrox G400                   */
+#define FB_ACCEL_ATI_RAGE128   32      /* ATI Rage 128                  */
 
 struct fb_fix_screeninfo {
        char id[16];                    /* identification string eg "TT Builtin" */
index 6d7008cb2eb8e3cb1e62c9a8516e528a63f0b769..00c7514e0781d4e3fe17ea656647572e21e00711 100644 (file)
 #define PCI_DEVICE_ID_ATI_215LG                0x4c47
 #define PCI_DEVICE_ID_ATI_264LT                0x4c54
 #define PCI_DEVICE_ID_ATI_264VT                0x5654
+#define PCI_DEVICE_ID_ATI_RAGE128_RE   0x5245
+#define PCI_DEVICE_ID_ATI_RAGE128_RF   0x5246
+#define PCI_DEVICE_ID_ATI_RAGE128_RK   0x524b
+#define PCI_DEVICE_ID_ATI_RAGE128_RL   0x524c
+#define PCI_DEVICE_ID_ATI_RAGE128_PF   0x5046
+#define PCI_DEVICE_ID_ATI_RAGE128_PR   0x5052
+#define PCI_DEVICE_ID_ATI_RAGE128_LE   0x4c45
+#define PCI_DEVICE_ID_ATI_RAGE128_LF   0x4c46
 
 #define PCI_VENDOR_ID_VLSI             0x1004
 #define PCI_DEVICE_ID_VLSI_82C592      0x0005
index e54cd4075589773e0b45428fece9d9a0ceb840df..ccc61d5abb4134538a11cda143e9e9228cc1d215 100644 (file)
@@ -2258,7 +2258,7 @@ int br_ioctl(unsigned int cmd, void *arg)
                                        break;
                                case BRCMD_IF_ENABLE:
                                        bcf.arg1 = br_find_port(bcf.arg1);
-                                       if (bcf.arg1 < 0)
+                                       if ((signed)bcf.arg1 < 0)
                                                return(bcf.arg1);
                                case BRCMD_PORT_ENABLE:
                                        if (port_info[bcf.arg1].dev == 0)
@@ -2276,7 +2276,7 @@ int br_ioctl(unsigned int cmd, void *arg)
                                        break;
                                case BRCMD_IF_DISABLE:
                                        bcf.arg1 = br_find_port(bcf.arg1);
-                                       if (bcf.arg1 < 0)
+                                       if ((signed)bcf.arg1 < 0)
                                                return(bcf.arg1);
                                case BRCMD_PORT_DISABLE:
                                        if (port_info[bcf.arg1].dev == 0)
@@ -2299,7 +2299,7 @@ int br_ioctl(unsigned int cmd, void *arg)
                                        break;
                                case BRCMD_SET_IF_PRIORITY:
                                        bcf.arg1 = br_find_port(bcf.arg1);
-                                       if (bcf.arg1 < 0)
+                                       if ((signed)bcf.arg1 < 0)
                                                return(bcf.arg1);
                                case BRCMD_SET_PORT_PRIORITY:
                                        if((port_info[bcf.arg1].dev == 0)
@@ -2310,7 +2310,7 @@ int br_ioctl(unsigned int cmd, void *arg)
                                        break;
                                case BRCMD_SET_IF_PATH_COST:
                                        bcf.arg1 = br_find_port(bcf.arg1);
-                                       if (bcf.arg1 < 0)
+                                       if ((signed)bcf.arg1 < 0)
                                                return(bcf.arg1);
                                case BRCMD_SET_PATH_COST:
                                        if (port_info[bcf.arg1].dev == 0)