Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 23225
b: refs/heads/master
c: dc6712d
h: refs/heads/master
i:
  23223: d456fce
v: v3
  • Loading branch information
Kristen Accardi authored and Greg Kroah-Hartman committed Mar 23, 2006
1 parent 4569ad0 commit c955a55
Show file tree
Hide file tree
Showing 7 changed files with 84 additions and 86 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 783c49fc506d9afe4784390b556fa25ede5d6d1f
refs/heads/master: dc6712d1261ee4585771724320d28580888818eb
2 changes: 0 additions & 2 deletions trunk/drivers/pci/hotplug/ibmphp.h
Original file line number Diff line number Diff line change
Expand Up @@ -406,8 +406,6 @@ extern void ibmphp_hpc_stop_poll_thread (void);
//----------------------------------------------------------------------------
// HPC return codes
//----------------------------------------------------------------------------
#define FALSE 0x00
#define TRUE 0x01
#define HPC_ERROR 0xFF

//-----------------------------------------------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/pci/hotplug/ibmphp_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1239,9 +1239,9 @@ int ibmphp_do_disable_slot(struct slot *slot_cur)
}

flag = slot_cur->flag;
slot_cur->flag = TRUE;
slot_cur->flag = 1;

if (flag == TRUE) {
if (flag == 1) {
rc = validate(slot_cur, DISABLE);
/* checking if powered off already & valid slot # */
if (rc)
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/pci/hotplug/ibmphp_ebda.c
Original file line number Diff line number Diff line change
Expand Up @@ -944,7 +944,7 @@ static int __init ebda_rsrc_controller (void)
goto error_no_slot;
}

tmp_slot->flag = TRUE;
tmp_slot->flag = 1;

tmp_slot->capabilities = hpc_ptr->slots[index].slot_cap;
if ((hpc_ptr->slots[index].slot_cap & EBDA_SLOT_133_MAX) == EBDA_SLOT_133_MAX)
Expand Down
54 changes: 27 additions & 27 deletions trunk/drivers/pci/hotplug/ibmphp_hpc.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@

#include "ibmphp.h"

static int to_debug = FALSE;
static int to_debug = 0;
#define debug_polling(fmt, arg...) do { if (to_debug) debug (fmt, arg); } while (0)

//----------------------------------------------------------------------------
Expand Down Expand Up @@ -95,8 +95,8 @@ static int to_debug = FALSE;
//----------------------------------------------------------------------------
// macro utilities
//----------------------------------------------------------------------------
// if bits 20,22,25,26,27,29,30 are OFF return TRUE
#define HPC_I2CSTATUS_CHECK(s) ((u8)((s & 0x00000A76) ? FALSE : TRUE))
// if bits 20,22,25,26,27,29,30 are OFF return 1
#define HPC_I2CSTATUS_CHECK(s) ((u8)((s & 0x00000A76) ? 0 : 1))

//----------------------------------------------------------------------------
// global variables
Expand Down Expand Up @@ -136,8 +136,8 @@ void __init ibmphp_hpc_initvars (void)
mutex_init(&sem_hpcaccess);
init_MUTEX (&semOperations);
init_MUTEX_LOCKED (&sem_exit);
to_debug = FALSE;
ibmphp_shutdown = FALSE;
to_debug = 0;
ibmphp_shutdown = 0;
tid_poll = 0;

debug ("%s - Exit\n", __FUNCTION__);
Expand Down Expand Up @@ -739,21 +739,21 @@ int ibmphp_hpc_writeslot (struct slot * pslot, u8 cmd)
// check controller is still not working on the command
//--------------------------------------------------------------------
timeout = CMD_COMPLETE_TOUT_SEC;
done = FALSE;
done = 0;
while (!done) {
rc = hpc_wait_ctlr_notworking (HPC_CTLR_WORKING_TOUT, ctlr_ptr, wpg_bbar,
&status);
if (!rc) {
if (NEEDTOCHECK_CMDSTATUS (cmd)) {
if (CTLR_FINISHED (status) == HPC_CTLR_FINISHED_YES)
done = TRUE;
done = 1;
} else
done = TRUE;
done = 1;
}
if (!done) {
msleep(1000);
if (timeout < 1) {
done = TRUE;
done = 1;
err ("%s - Error command complete timeout\n", __FUNCTION__);
rc = -EFAULT;
} else
Expand Down Expand Up @@ -799,7 +799,7 @@ void free_hpc_access (void)
void ibmphp_lock_operations (void)
{
down (&semOperations);
to_debug = TRUE;
to_debug = 1;
}

/*----------------------------------------------------------------------
Expand All @@ -809,7 +809,7 @@ void ibmphp_unlock_operations (void)
{
debug ("%s - Entry\n", __FUNCTION__);
up (&semOperations);
to_debug = FALSE;
to_debug = 0;
debug ("%s - Exit\n", __FUNCTION__);
}

Expand Down Expand Up @@ -937,40 +937,40 @@ static int process_changeinstatus (struct slot *pslot, struct slot *poldslot)
{
u8 status;
int rc = 0;
u8 disable = FALSE;
u8 update = FALSE;
u8 disable = 0;
u8 update = 0;

debug ("process_changeinstatus - Entry pslot[%p], poldslot[%p]\n", pslot, poldslot);

// bit 0 - HPC_SLOT_POWER
if ((pslot->status & 0x01) != (poldslot->status & 0x01))
update = TRUE;
update = 1;

// bit 1 - HPC_SLOT_CONNECT
// ignore

// bit 2 - HPC_SLOT_ATTN
if ((pslot->status & 0x04) != (poldslot->status & 0x04))
update = TRUE;
update = 1;

// bit 3 - HPC_SLOT_PRSNT2
// bit 4 - HPC_SLOT_PRSNT1
if (((pslot->status & 0x08) != (poldslot->status & 0x08))
|| ((pslot->status & 0x10) != (poldslot->status & 0x10)))
update = TRUE;
update = 1;

// bit 5 - HPC_SLOT_PWRGD
if ((pslot->status & 0x20) != (poldslot->status & 0x20))
// OFF -> ON: ignore, ON -> OFF: disable slot
if ((poldslot->status & 0x20) && (SLOT_CONNECT (poldslot->status) == HPC_SLOT_CONNECTED) && (SLOT_PRESENT (poldslot->status)))
disable = TRUE;
disable = 1;

// bit 6 - HPC_SLOT_BUS_SPEED
// ignore

// bit 7 - HPC_SLOT_LATCH
if ((pslot->status & 0x80) != (poldslot->status & 0x80)) {
update = TRUE;
update = 1;
// OPEN -> CLOSE
if (pslot->status & 0x80) {
if (SLOT_PWRGD (pslot->status)) {
Expand All @@ -979,25 +979,25 @@ static int process_changeinstatus (struct slot *pslot, struct slot *poldslot)
msleep(1000);
rc = ibmphp_hpc_readslot (pslot, READ_SLOTSTATUS, &status);
if (SLOT_PWRGD (status))
update = TRUE;
update = 1;
else // overwrite power in pslot to OFF
pslot->status &= ~HPC_SLOT_POWER;
}
}
// CLOSE -> OPEN
else if ((SLOT_PWRGD (poldslot->status) == HPC_SLOT_PWRGD_GOOD)
&& (SLOT_CONNECT (poldslot->status) == HPC_SLOT_CONNECTED) && (SLOT_PRESENT (poldslot->status))) {
disable = TRUE;
disable = 1;
}
// else - ignore
}
// bit 4 - HPC_SLOT_BLINK_ATTN
if ((pslot->ext_status & 0x08) != (poldslot->ext_status & 0x08))
update = TRUE;
update = 1;

if (disable) {
debug ("process_changeinstatus - disable slot\n");
pslot->flag = FALSE;
pslot->flag = 0;
rc = ibmphp_do_disable_slot (pslot);
}

Expand Down Expand Up @@ -1102,7 +1102,7 @@ void __exit ibmphp_hpc_stop_poll_thread (void)
{
debug ("%s - Entry\n", __FUNCTION__);

ibmphp_shutdown = TRUE;
ibmphp_shutdown = 1;
debug ("before locking operations \n");
ibmphp_lock_operations ();
debug ("after locking operations \n");
Expand Down Expand Up @@ -1136,22 +1136,22 @@ static int hpc_wait_ctlr_notworking (int timeout, struct controller *ctlr_ptr, v
u8 * pstatus)
{
int rc = 0;
u8 done = FALSE;
u8 done = 0;

debug_polling ("hpc_wait_ctlr_notworking - Entry timeout[%d]\n", timeout);

while (!done) {
*pstatus = ctrl_read (ctlr_ptr, wpg_bbar, WPG_CTLR_INDEX);
if (*pstatus == HPC_ERROR) {
rc = HPC_ERROR;
done = TRUE;
done = 1;
}
if (CTLR_WORKING (*pstatus) == HPC_CTLR_WORKING_NO)
done = TRUE;
done = 1;
if (!done) {
msleep(1000);
if (timeout < 1) {
done = TRUE;
done = 1;
err ("HPCreadslot - Error ctlr timeout\n");
rc = HPC_ERROR;
} else
Expand Down
Loading

0 comments on commit c955a55

Please sign in to comment.