@@ -291,9 +291,8 @@ struct smi_info {
291291#define smi_get_stat (smi , stat ) \
292292 ((unsigned int) atomic_read(&(smi)->stats[SI_STAT_ ## stat]))
293293
294- #define SI_MAX_PARMS 4
295-
296- static int force_kipmid [SI_MAX_PARMS ];
294+ #define IPMI_MAX_INTFS 4
295+ static int force_kipmid [IPMI_MAX_INTFS ];
297296static int num_force_kipmid ;
298297#ifdef CONFIG_PCI
299298static bool pci_registered ;
@@ -302,7 +301,7 @@ static bool pci_registered;
302301static bool parisc_registered ;
303302#endif
304303
305- static unsigned int kipmid_max_busy_us [SI_MAX_PARMS ];
304+ static unsigned int kipmid_max_busy_us [IPMI_MAX_INTFS ];
306305static int num_max_busy_us ;
307306
308307static bool unload_when_empty = true;
@@ -1271,11 +1270,6 @@ static const struct ipmi_smi_handlers handlers = {
12711270 .poll = poll ,
12721271};
12731272
1274- /*
1275- * There can be 4 IO ports passed in (with or without IRQs), 4 addresses,
1276- * a default IO port, and 1 ACPI/SPMI address. That sets SI_MAX_DRIVERS.
1277- */
1278-
12791273static LIST_HEAD (smi_infos );
12801274static DEFINE_MUTEX (smi_infos_lock );
12811275static int smi_num ; /* Used to sequence the SMIs */
@@ -1290,23 +1284,6 @@ static bool si_tryplatform = true;
12901284#ifdef CONFIG_PCI
12911285static bool si_trypci = true;
12921286#endif
1293- static char * si_type [SI_MAX_PARMS ];
1294- #define MAX_SI_TYPE_STR 30
1295- static char si_type_str [MAX_SI_TYPE_STR ];
1296- static unsigned long addrs [SI_MAX_PARMS ];
1297- static unsigned int num_addrs ;
1298- static unsigned int ports [SI_MAX_PARMS ];
1299- static unsigned int num_ports ;
1300- static int irqs [SI_MAX_PARMS ];
1301- static unsigned int num_irqs ;
1302- static int regspacings [SI_MAX_PARMS ];
1303- static unsigned int num_regspacings ;
1304- static int regsizes [SI_MAX_PARMS ];
1305- static unsigned int num_regsizes ;
1306- static int regshifts [SI_MAX_PARMS ];
1307- static unsigned int num_regshifts ;
1308- static int slave_addrs [SI_MAX_PARMS ]; /* Leaving 0 chooses the default value */
1309- static unsigned int num_slave_addrs ;
13101287
13111288static const char * const addr_space_to_str [] = { "i/o" , "mem" };
13121289
@@ -1329,48 +1306,6 @@ module_param_named(trypci, si_trypci, bool, 0);
13291306MODULE_PARM_DESC (trypci , "Setting this to zero will disable the"
13301307 " default scan of the interfaces identified via pci" );
13311308#endif
1332- module_param_string (type , si_type_str , MAX_SI_TYPE_STR , 0 );
1333- MODULE_PARM_DESC (type , "Defines the type of each interface, each"
1334- " interface separated by commas. The types are 'kcs',"
1335- " 'smic', and 'bt'. For example si_type=kcs,bt will set"
1336- " the first interface to kcs and the second to bt" );
1337- module_param_hw_array (addrs , ulong , iomem , & num_addrs , 0 );
1338- MODULE_PARM_DESC (addrs , "Sets the memory address of each interface, the"
1339- " addresses separated by commas. Only use if an interface"
1340- " is in memory. Otherwise, set it to zero or leave"
1341- " it blank." );
1342- module_param_hw_array (ports , uint , ioport , & num_ports , 0 );
1343- MODULE_PARM_DESC (ports , "Sets the port address of each interface, the"
1344- " addresses separated by commas. Only use if an interface"
1345- " is a port. Otherwise, set it to zero or leave"
1346- " it blank." );
1347- module_param_hw_array (irqs , int , irq , & num_irqs , 0 );
1348- MODULE_PARM_DESC (irqs , "Sets the interrupt of each interface, the"
1349- " addresses separated by commas. Only use if an interface"
1350- " has an interrupt. Otherwise, set it to zero or leave"
1351- " it blank." );
1352- module_param_hw_array (regspacings , int , other , & num_regspacings , 0 );
1353- MODULE_PARM_DESC (regspacings , "The number of bytes between the start address"
1354- " and each successive register used by the interface. For"
1355- " instance, if the start address is 0xca2 and the spacing"
1356- " is 2, then the second address is at 0xca4. Defaults"
1357- " to 1." );
1358- module_param_hw_array (regsizes , int , other , & num_regsizes , 0 );
1359- MODULE_PARM_DESC (regsizes , "The size of the specific IPMI register in bytes."
1360- " This should generally be 1, 2, 4, or 8 for an 8-bit,"
1361- " 16-bit, 32-bit, or 64-bit register. Use this if you"
1362- " the 8-bit IPMI register has to be read from a larger"
1363- " register." );
1364- module_param_hw_array (regshifts , int , other , & num_regshifts , 0 );
1365- MODULE_PARM_DESC (regshifts , "The amount to shift the data read from the."
1366- " IPMI register, in bits. For instance, if the data"
1367- " is read from a 32-bit word and the IPMI data is in"
1368- " bit 8-15, then the shift would be 8" );
1369- module_param_hw_array (slave_addrs , int , other , & num_slave_addrs , 0 );
1370- MODULE_PARM_DESC (slave_addrs , "Set the default IPMB slave address for"
1371- " the controller. Normally this is 0x20, but can be"
1372- " overridden by this parm. This is an array indexed"
1373- " by interface number." );
13741309module_param_array (force_kipmid , int , & num_force_kipmid , 0 );
13751310MODULE_PARM_DESC (force_kipmid , "Force the kipmi daemon to be enabled (1) or"
13761311 " disabled(0). Normally the IPMI driver auto-detects"
@@ -1691,64 +1626,6 @@ static struct smi_info *smi_info_alloc(void)
16911626 return info ;
16921627}
16931628
1694- static int hardcode_find_bmc (void )
1695- {
1696- int ret = - ENODEV ;
1697- int i ;
1698- struct si_sm_io io ;
1699-
1700- memset (& io , 0 , sizeof (io ));
1701- for (i = 0 ; i < SI_MAX_PARMS ; i ++ ) {
1702- if (!ports [i ] && !addrs [i ])
1703- continue ;
1704-
1705- io .addr_source = SI_HARDCODED ;
1706- pr_info (PFX "probing via hardcoded address\n" );
1707-
1708- if (!si_type [i ] || strcmp (si_type [i ], "kcs" ) == 0 ) {
1709- io .si_type = SI_KCS ;
1710- } else if (strcmp (si_type [i ], "smic" ) == 0 ) {
1711- io .si_type = SI_SMIC ;
1712- } else if (strcmp (si_type [i ], "bt" ) == 0 ) {
1713- io .si_type = SI_BT ;
1714- } else {
1715- pr_warn (PFX "Interface type specified for interface %d, was invalid: %s\n" ,
1716- i , si_type [i ]);
1717- continue ;
1718- }
1719-
1720- if (ports [i ]) {
1721- /* An I/O port */
1722- io .addr_data = ports [i ];
1723- io .addr_type = IPMI_IO_ADDR_SPACE ;
1724- } else if (addrs [i ]) {
1725- /* A memory port */
1726- io .addr_data = addrs [i ];
1727- io .addr_type = IPMI_MEM_ADDR_SPACE ;
1728- } else {
1729- pr_warn (PFX "Interface type specified for interface %d, but port and address were not set or set to zero.\n" ,
1730- i );
1731- continue ;
1732- }
1733-
1734- io .addr = NULL ;
1735- io .regspacing = regspacings [i ];
1736- if (!io .regspacing )
1737- io .regspacing = DEFAULT_REGSPACING ;
1738- io .regsize = regsizes [i ];
1739- if (!io .regsize )
1740- io .regsize = DEFAULT_REGSIZE ;
1741- io .regshift = regshifts [i ];
1742- io .irq = irqs [i ];
1743- if (io .irq )
1744- io .irq_setup = ipmi_std_irq_setup ;
1745- io .slave_addr = slave_addrs [i ];
1746-
1747- ret = ipmi_si_add_smi (& io );
1748- }
1749- return ret ;
1750- }
1751-
17521629#ifdef CONFIG_ACPI
17531630
17541631/*
@@ -3349,8 +3226,6 @@ static int try_smi_init(struct smi_info *new_smi)
33493226
33503227static int init_ipmi_si (void )
33513228{
3352- int i ;
3353- char * str ;
33543229 int rv ;
33553230 struct smi_info * e ;
33563231 enum ipmi_addr_src type = SI_INVALID ;
@@ -3366,26 +3241,11 @@ static int init_ipmi_si(void)
33663241 }
33673242 }
33683243
3369- /* Parse out the si_type string into its components. */
3370- str = si_type_str ;
3371- if (* str != '\0' ) {
3372- for (i = 0 ; (i < SI_MAX_PARMS ) && (* str != '\0' ); i ++ ) {
3373- si_type [i ] = str ;
3374- str = strchr (str , ',' );
3375- if (str ) {
3376- * str = '\0' ;
3377- str ++ ;
3378- } else {
3379- break ;
3380- }
3381- }
3382- }
3383-
33843244 pr_info ("IPMI System Interface driver.\n" );
33853245
33863246 /* If the user gave us a device, they presumably want us to use it */
3387- if (!hardcode_find_bmc ())
3388- return 0 ;
3247+ if (!ipmi_si_hardcode_find_bmc ())
3248+ goto do_scan ;
33893249
33903250#ifdef CONFIG_PCI
33913251 if (si_trypci ) {
@@ -3411,7 +3271,7 @@ static int init_ipmi_si(void)
34113271 with multiple BMCs we assume that there will be several instances
34123272 of a given type so if we succeed in registering a type then also
34133273 try to register everything else of the same type */
3414-
3274+ do_scan :
34153275 mutex_lock (& smi_infos_lock );
34163276 list_for_each_entry (e , & smi_infos , link ) {
34173277 /* Try to register a device if it has an IRQ and we either
0 commit comments