Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions
hvcserver.c File Reference
#include <linux/kernel.h>
#include <linux/list.h>
#include <linux/module.h>
#include <linux/slab.h>
#include <asm/hvcall.h>
#include <asm/hvcserver.h>
#include <asm/io.h>

Go to the source code of this file.

Macros

#define HVCS_ARCH_VERSION   "1.0.0"
 

Functions

 MODULE_AUTHOR ("Ryan S. Arnold <[email protected]>")
 
 MODULE_DESCRIPTION ("IBM hvcs ppc64 API")
 
 MODULE_LICENSE ("GPL")
 
 MODULE_VERSION (HVCS_ARCH_VERSION)
 
int hvcs_free_partner_info (struct list_head *head)
 
 EXPORT_SYMBOL (hvcs_free_partner_info)
 
int hvcs_get_partner_info (uint32_t unit_address, struct list_head *head, unsigned long *pi_buff)
 
 EXPORT_SYMBOL (hvcs_get_partner_info)
 
int hvcs_register_connection (uint32_t unit_address, uint32_t p_partition_ID, uint32_t p_unit_address)
 
 EXPORT_SYMBOL (hvcs_register_connection)
 
int hvcs_free_connection (uint32_t unit_address)
 
 EXPORT_SYMBOL (hvcs_free_connection)
 

Macro Definition Documentation

#define HVCS_ARCH_VERSION   "1.0.0"

Definition at line 31 of file hvcserver.c.

Function Documentation

EXPORT_SYMBOL ( hvcs_free_partner_info  )
EXPORT_SYMBOL ( hvcs_get_partner_info  )
EXPORT_SYMBOL ( hvcs_register_connection  )
EXPORT_SYMBOL ( hvcs_free_connection  )
int hvcs_free_connection ( uint32_t  unit_address)

hvcs_free_connection - free the connection between a vty-server and vty : The unit address of the vty-server that is to have its connection severed.

This function is used to free the partner connection between a vty-server adapter and a vty adapter.

If -EBUSY is returned continue to call this function until 0 is returned.

Definition at line 245 of file hvcserver.c.

int hvcs_free_partner_info ( struct list_head head)

hvcs_free_partner_info - free pi allocated by hvcs_get_partner_info : list_head pointer for an allocated list of partner info structs to free.

This function is used to free the partner info list that was returned by calling hvcs_get_partner_info().

Definition at line 74 of file hvcserver.c.

int hvcs_get_partner_info ( uint32_t  unit_address,
struct list_head head,
unsigned long pi_buff 
)

hvcs_get_partner_info - Get all of the partner info for a vty-server adapter : The unit_address of the vty-server adapter for which this function is fetching partner info. : An initialized list_head pointer to an empty list to use to return the list of partner info fetched from the hypervisor to the caller. : A page sized buffer pre-allocated prior to calling this function that is to be used to be used by firmware as an iterator to keep track of the partner info retrieval.

This function returns non-zero on success, or if there is no partner info.

The pi_buff is pre-allocated prior to calling this function because this function may be called with a spin_lock held and kmalloc of a page is not recommended as GFP_ATOMIC.

The first long of this buffer is used to store a partner unit address. The second long is used to store a partner partition ID and starting at pi_buff[2] is the 79 character Converged Location Code (diff size than the unsigned longs, hence the casting mumbo jumbo you see later).

Invocation of this function should always be followed by an invocation of hvcs_free_partner_info() using a pointer to the SAME list head instance that was passed as a parameter to this function.

Definition at line 131 of file hvcserver.c.

int hvcs_register_connection ( uint32_t  unit_address,
uint32_t  p_partition_ID,
uint32_t  p_unit_address 
)

hvcs_register_connection - establish a connection between this vty-server and a vty. : The unit address of the vty-server adapter that is to be establish a connection. : The partition ID of the vty adapter that is to be connected. : The unit address of the vty adapter to which the vty-server is to be connected.

If this function is called once and -EINVAL is returned it may indicate that the partner info needs to be refreshed for the target unit address at which point the caller must invoke hvcs_get_partner_info() and then call this function again. If, for a second time, -EINVAL is returned then it indicates that there is probably already a partner connection registered to a different vty-server adapter. It is also possible that a second -EINVAL may indicate that one of the parms is not valid, for instance if the link was removed between the vty-server adapter and the vty adapter that you are trying to open. Don't shoot the messenger. Firmware implemented it this way.

Definition at line 225 of file hvcserver.c.

MODULE_AUTHOR ( "Ryan S. Arnold <[email protected]>"  )
MODULE_DESCRIPTION ( "IBM hvcs ppc64 API"  )
MODULE_LICENSE ( "GPL"  )
MODULE_VERSION ( HVCS_ARCH_VERSION  )