Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions
ibmphp_hpc.c File Reference
#include <linux/wait.h>
#include <linux/time.h>
#include <linux/delay.h>
#include <linux/module.h>
#include <linux/pci.h>
#include <linux/init.h>
#include <linux/mutex.h>
#include <linux/sched.h>
#include <linux/semaphore.h>
#include <linux/kthread.h>
#include "ibmphp.h"

Go to the source code of this file.

Macros

#define debug_polling(fmt, arg...)   do { if (to_debug) debug (fmt, arg); } while (0)
 
#define CMD_COMPLETE_TOUT_SEC   60
 
#define HPC_CTLR_WORKING_TOUT   60
 
#define HPC_GETACCESS_TIMEOUT   60
 
#define POLL_INTERVAL_SEC   2
 
#define POLL_LATCH_CNT   5
 
#define WPG_I2CMBUFL_OFFSET   0x08
 
#define WPG_I2CMOSUP_OFFSET   0x10
 
#define WPG_I2CMCNTL_OFFSET   0x20
 
#define WPG_I2CPARM_OFFSET   0x40
 
#define WPG_I2CSTAT_OFFSET   0x70
 
#define WPG_I2C_AND   0x1000
 
#define WPG_I2C_OR   0x2000
 
#define WPG_READATADDR_MASK   0x00010000
 
#define WPG_WRITEATADDR_MASK   0x40010000
 
#define WPG_READDIRECT_MASK   0x10010000
 
#define WPG_WRITEDIRECT_MASK   0x60010000
 
#define WPG_I2CMCNTL_STARTOP_MASK   0x00000002
 
#define WPG_I2C_IOREMAP_SIZE   0x2044
 
#define WPG_1ST_SLOT_INDEX   0x01
 
#define WPG_CTLR_INDEX   0x0F
 
#define WPG_1ST_EXTSLOT_INDEX   0x10
 
#define WPG_1ST_BUS_INDEX   0x1F
 
#define HPC_I2CSTATUS_CHECK(s)   ((u8)((s & 0x00000A76) ? 0 : 1))
 
#define POLL_LATCH_REGISTER   0
 
#define POLL_SLOTS   1
 
#define POLL_SLEEP   2
 

Functions

void __init ibmphp_hpc_initvars (void)
 
int ibmphp_hpc_readslot (struct slot *pslot, u8 cmd, u8 *pstatus)
 
int ibmphp_hpc_writeslot (struct slot *pslot, u8 cmd)
 
void ibmphp_lock_operations (void)
 
void ibmphp_unlock_operations (void)
 
int __init ibmphp_hpc_start_poll_thread (void)
 
void __exit ibmphp_hpc_stop_poll_thread (void)
 

Macro Definition Documentation

#define CMD_COMPLETE_TOUT_SEC   60

Definition at line 48 of file ibmphp_hpc.c.

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

Definition at line 43 of file ibmphp_hpc.c.

#define HPC_CTLR_WORKING_TOUT   60

Definition at line 49 of file ibmphp_hpc.c.

#define HPC_GETACCESS_TIMEOUT   60

Definition at line 50 of file ibmphp_hpc.c.

#define HPC_I2CSTATUS_CHECK (   s)    ((u8)((s & 0x00000A76) ? 0 : 1))

Definition at line 100 of file ibmphp_hpc.c.

#define POLL_INTERVAL_SEC   2

Definition at line 51 of file ibmphp_hpc.c.

#define POLL_LATCH_CNT   5

Definition at line 52 of file ibmphp_hpc.c.

#define POLL_LATCH_REGISTER   0

Definition at line 816 of file ibmphp_hpc.c.

#define POLL_SLEEP   2

Definition at line 818 of file ibmphp_hpc.c.

#define POLL_SLOTS   1

Definition at line 817 of file ibmphp_hpc.c.

#define WPG_1ST_BUS_INDEX   0x1F

Definition at line 94 of file ibmphp_hpc.c.

#define WPG_1ST_EXTSLOT_INDEX   0x10

Definition at line 93 of file ibmphp_hpc.c.

#define WPG_1ST_SLOT_INDEX   0x01

Definition at line 91 of file ibmphp_hpc.c.

#define WPG_CTLR_INDEX   0x0F

Definition at line 92 of file ibmphp_hpc.c.

#define WPG_I2C_AND   0x1000

Definition at line 66 of file ibmphp_hpc.c.

#define WPG_I2C_IOREMAP_SIZE   0x2044

Definition at line 86 of file ibmphp_hpc.c.

#define WPG_I2C_OR   0x2000

Definition at line 67 of file ibmphp_hpc.c.

#define WPG_I2CMBUFL_OFFSET   0x08

Definition at line 57 of file ibmphp_hpc.c.

#define WPG_I2CMCNTL_OFFSET   0x20

Definition at line 59 of file ibmphp_hpc.c.

#define WPG_I2CMCNTL_STARTOP_MASK   0x00000002

Definition at line 81 of file ibmphp_hpc.c.

#define WPG_I2CMOSUP_OFFSET   0x10

Definition at line 58 of file ibmphp_hpc.c.

#define WPG_I2CPARM_OFFSET   0x40

Definition at line 60 of file ibmphp_hpc.c.

#define WPG_I2CSTAT_OFFSET   0x70

Definition at line 61 of file ibmphp_hpc.c.

#define WPG_READATADDR_MASK   0x00010000

Definition at line 72 of file ibmphp_hpc.c.

#define WPG_READDIRECT_MASK   0x10010000

Definition at line 74 of file ibmphp_hpc.c.

#define WPG_WRITEATADDR_MASK   0x40010000

Definition at line 73 of file ibmphp_hpc.c.

#define WPG_WRITEDIRECT_MASK   0x60010000

Definition at line 75 of file ibmphp_hpc.c.

Function Documentation

void __init ibmphp_hpc_initvars ( void  )

Definition at line 131 of file ibmphp_hpc.c.

int ibmphp_hpc_readslot ( struct slot pslot,
u8  cmd,
u8 pstatus 
)

Definition at line 536 of file ibmphp_hpc.c.

int __init ibmphp_hpc_start_poll_thread ( void  )

Definition at line 1053 of file ibmphp_hpc.c.

void __exit ibmphp_hpc_stop_poll_thread ( void  )

Definition at line 1070 of file ibmphp_hpc.c.

int ibmphp_hpc_writeslot ( struct slot pslot,
u8  cmd 
)

Definition at line 675 of file ibmphp_hpc.c.

void ibmphp_lock_operations ( void  )

Definition at line 796 of file ibmphp_hpc.c.

void ibmphp_unlock_operations ( void  )

Definition at line 805 of file ibmphp_hpc.c.