The patch titled

     pcmcia: remove client services version

has been added to the -mm tree.  Its filename is

     pcmcia-remove-client-services-version.patch

Patches currently in -mm which might be from [EMAIL PROTECTED] are

pcmcia-remove-client-services-version.patch



From: Pavel Roskin <[EMAIL PROTECTED]>

The Linux PCMCIA code has some data that was apparently used (or meant to be
used) to ensure that only proper client drivers are loaded.  This is now
ensured (to a certain degree) by the fact that the most client drivers are
part of the kernel.  Also, the version information has not been updated
despite major changes in PCMCIA API.  This has made it meaningless.

This patch removes servinfo_t and pcmcia_get_card_services_info.  They are not
used in any userspace utilities such as pcmcia-cs and pcmciautils. 
drivers/pcmcia/pcmcia_ioctl.c is adjusted accordingly.

CS_RELEASE and CS_RELEASE_CODE are removed.  include/pcmcia/version.h is empty
now.  It will be removed later, but for now it's left in the tree to avoid
touching all PCMCIA clients.

The only driver that needs to be changed is drivers/scsi/pcmcia/nsp_cs.c,
which uses CS_RELEASE_CODE.

Signed-off-by: Pavel Roskin <[EMAIL PROTECTED]>
Signed-off-by: Dominik Brodowski <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 drivers/pcmcia/pcmcia_ioctl.c |   26 --------------------------
 drivers/scsi/pcmcia/nsp_cs.c  |    4 ----
 include/pcmcia/cs.h           |    8 --------
 include/pcmcia/ds.h           |    2 --
 include/pcmcia/version.h      |    3 +--
 5 files changed, 1 insertion(+), 42 deletions(-)

diff -puN drivers/pcmcia/pcmcia_ioctl.c~pcmcia-remove-client-services-version 
drivers/pcmcia/pcmcia_ioctl.c
--- devel/drivers/pcmcia/pcmcia_ioctl.c~pcmcia-remove-client-services-version   
2005-07-06 01:15:35.000000000 -0700
+++ devel-akpm/drivers/pcmcia/pcmcia_ioctl.c    2005-07-06 01:15:35.000000000 
-0700
@@ -71,29 +71,6 @@ extern int ds_pc_debug;
 #define ds_dbg(lvl, fmt, arg...) do { } while (0)
 #endif
 
-static const char *release = "Linux Kernel Card Services";
-
-/** pcmcia_get_card_services_info
- *
- * Return information about this version of Card Services
- */
-static int pcmcia_get_card_services_info(servinfo_t *info)
-{
-       unsigned int socket_count = 0;
-       struct list_head *tmp;
-       info->Signature[0] = 'C';
-       info->Signature[1] = 'S';
-       down_read(&pcmcia_socket_list_rwsem);
-       list_for_each(tmp, &pcmcia_socket_list)
-               socket_count++;
-       up_read(&pcmcia_socket_list_rwsem);
-       info->Count = socket_count;
-       info->Revision = CS_RELEASE_CODE;
-       info->CSLevel = 0x0210;
-       info->VendorString = (char *)release;
-       return CS_SUCCESS;
-} /* get_card_services_info */
-
 
 /* backwards-compatible accessing of driver --- by name! */
 
@@ -591,9 +568,6 @@ static int ds_ioctl(struct inode * inode
     case DS_ADJUST_RESOURCE_INFO:
        ret = pcmcia_adjust_resource_info(&buf->adjust);
        break;
-    case DS_GET_CARD_SERVICES_INFO:
-       ret = pcmcia_get_card_services_info(&buf->servinfo);
-       break;
     case DS_GET_CONFIGURATION_INFO:
        if (buf->config.Function &&
           (buf->config.Function >= s->functions))
diff -puN drivers/scsi/pcmcia/nsp_cs.c~pcmcia-remove-client-services-version 
drivers/scsi/pcmcia/nsp_cs.c
--- devel/drivers/scsi/pcmcia/nsp_cs.c~pcmcia-remove-client-services-version    
2005-07-06 01:15:35.000000000 -0700
+++ devel-akpm/drivers/scsi/pcmcia/nsp_cs.c     2005-07-06 01:15:35.000000000 
-0700
@@ -2155,10 +2155,6 @@ static int __init nsp_cs_init(void)
 
        nsp_msg(KERN_INFO, "loading...");
        pcmcia_get_card_services_info(&serv);
-       if (serv.Revision != CS_RELEASE_CODE) {
-               nsp_msg(KERN_DEBUG, "Card Services release does not match!");
-               return -EINVAL;
-       }
        register_pcmcia_driver(&dev_info, &nsp_cs_attach, &nsp_cs_detach);
 
        nsp_dbg(NSP_DEBUG_INIT, "out");
diff -puN include/pcmcia/cs.h~pcmcia-remove-client-services-version 
include/pcmcia/cs.h
--- devel/include/pcmcia/cs.h~pcmcia-remove-client-services-version     
2005-07-06 01:15:35.000000000 -0700
+++ devel-akpm/include/pcmcia/cs.h      2005-07-06 01:15:35.000000000 -0700
@@ -68,14 +68,6 @@ typedef struct adjust_t {
 #define RES_ALLOCATED                  0x20
 #define RES_REMOVED                    0x40
 
-typedef struct servinfo_t {
-    char       Signature[2];
-    u_int      Count;
-    u_int      Revision;
-    u_int      CSLevel;
-    char       *VendorString;
-} servinfo_t;
-
 typedef struct event_callback_args_t {
        struct pcmcia_device    *client_handle;
        void                    *client_data;
diff -puN include/pcmcia/ds.h~pcmcia-remove-client-services-version 
include/pcmcia/ds.h
--- devel/include/pcmcia/ds.h~pcmcia-remove-client-services-version     
2005-07-06 01:15:35.000000000 -0700
+++ devel-akpm/include/pcmcia/ds.h      2005-07-06 01:15:35.000000000 -0700
@@ -49,7 +49,6 @@ typedef struct mtd_info_t {
 } mtd_info_t;
 
 typedef union ds_ioctl_arg_t {
-    servinfo_t         servinfo;
     adjust_t           adjust;
     config_info_t      config;
     tuple_t            tuple;
@@ -65,7 +64,6 @@ typedef union ds_ioctl_arg_t {
     cisdump_t          cisdump;
 } ds_ioctl_arg_t;
 
-#define DS_GET_CARD_SERVICES_INFO      _IOR ('d', 1, servinfo_t)
 #define DS_ADJUST_RESOURCE_INFO                _IOWR('d', 2, adjust_t)
 #define DS_GET_CONFIGURATION_INFO      _IOWR('d', 3, config_info_t)
 #define DS_GET_FIRST_TUPLE             _IOWR('d', 4, tuple_t)
diff -puN include/pcmcia/version.h~pcmcia-remove-client-services-version 
include/pcmcia/version.h
--- devel/include/pcmcia/version.h~pcmcia-remove-client-services-version        
2005-07-06 01:15:35.000000000 -0700
+++ devel-akpm/include/pcmcia/version.h 2005-07-06 01:15:35.000000000 -0700
@@ -1,4 +1,3 @@
 /* version.h 1.94 2000/10/03 17:55:48 (David Hinds) */
 
-#define CS_RELEASE "3.1.22"
-#define CS_RELEASE_CODE 0x3116
+/* This file will be removed, please don't include it */
_
-
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to