s390/cio: rename struct channel_path_desc
Rename struct channel_path_desc to struct channel_path_desc_fmt0 to fit the scheme. Provide a macro for the function wrappers that gather this and related data from firmware. Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com> Reviewed-by: Peter Oberparleiter <oberpar@linux.vnet.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
This commit is contained in:
parent
135a8b4ce5
commit
ded27d8d2e
@ -230,5 +230,5 @@ int ccw_device_siosl(struct ccw_device *);
|
||||
|
||||
extern void ccw_device_get_schid(struct ccw_device *, struct subchannel_id *);
|
||||
|
||||
struct channel_path_desc *ccw_device_get_chp_desc(struct ccw_device *, int);
|
||||
struct channel_path_desc_fmt0 *ccw_device_get_chp_desc(struct ccw_device *, int);
|
||||
#endif /* _S390_CCWDEV_H_ */
|
||||
|
@ -9,7 +9,7 @@
|
||||
#include <uapi/asm/chpid.h>
|
||||
#include <asm/cio.h>
|
||||
|
||||
struct channel_path_desc {
|
||||
struct channel_path_desc_fmt0 {
|
||||
u8 flags;
|
||||
u8 lsn;
|
||||
u8 desc;
|
||||
|
@ -994,7 +994,7 @@ static int dasd_eckd_read_conf(struct dasd_device *device)
|
||||
struct dasd_eckd_private *private, path_private;
|
||||
struct dasd_uid *uid;
|
||||
char print_path_uid[60], print_device_uid[60];
|
||||
struct channel_path_desc *chp_desc;
|
||||
struct channel_path_desc_fmt0 *chp_desc;
|
||||
struct subchannel_id sch_id;
|
||||
|
||||
private = device->private;
|
||||
|
@ -422,7 +422,7 @@ int chp_update_desc(struct channel_path *chp)
|
||||
{
|
||||
int rc;
|
||||
|
||||
rc = chsc_determine_base_channel_path_desc(chp->chpid, &chp->desc);
|
||||
rc = chsc_determine_fmt0_channel_path_desc(chp->chpid, &chp->desc);
|
||||
if (rc)
|
||||
return rc;
|
||||
|
||||
@ -506,20 +506,20 @@ out:
|
||||
* On success return a newly allocated copy of the channel-path description
|
||||
* data associated with the given channel-path ID. Return %NULL on error.
|
||||
*/
|
||||
struct channel_path_desc *chp_get_chp_desc(struct chp_id chpid)
|
||||
struct channel_path_desc_fmt0 *chp_get_chp_desc(struct chp_id chpid)
|
||||
{
|
||||
struct channel_path *chp;
|
||||
struct channel_path_desc *desc;
|
||||
struct channel_path_desc_fmt0 *desc;
|
||||
|
||||
chp = chpid_to_chp(chpid);
|
||||
if (!chp)
|
||||
return NULL;
|
||||
desc = kmalloc(sizeof(struct channel_path_desc), GFP_KERNEL);
|
||||
desc = kmalloc(sizeof(*desc), GFP_KERNEL);
|
||||
if (!desc)
|
||||
return NULL;
|
||||
|
||||
mutex_lock(&chp->lock);
|
||||
memcpy(desc, &chp->desc, sizeof(struct channel_path_desc));
|
||||
memcpy(desc, &chp->desc, sizeof(*desc));
|
||||
mutex_unlock(&chp->lock);
|
||||
return desc;
|
||||
}
|
||||
|
@ -44,7 +44,7 @@ struct channel_path {
|
||||
struct chp_id chpid;
|
||||
struct mutex lock; /* Serialize access to below members. */
|
||||
int state;
|
||||
struct channel_path_desc desc;
|
||||
struct channel_path_desc_fmt0 desc;
|
||||
struct channel_path_desc_fmt1 desc_fmt1;
|
||||
/* Channel-measurement related stuff: */
|
||||
int cmg;
|
||||
@ -61,7 +61,7 @@ static inline struct channel_path *chpid_to_chp(struct chp_id chpid)
|
||||
int chp_get_status(struct chp_id chpid);
|
||||
u8 chp_get_sch_opm(struct subchannel *sch);
|
||||
int chp_is_registered(struct chp_id chpid);
|
||||
struct channel_path_desc *chp_get_chp_desc(struct chp_id chpid);
|
||||
struct channel_path_desc_fmt0 *chp_get_chp_desc(struct chp_id chpid);
|
||||
void chp_remove_cmg_attr(struct channel_path *chp);
|
||||
int chp_add_cmg_attr(struct channel_path *chp);
|
||||
int chp_update_desc(struct channel_path *chp);
|
||||
|
@ -940,43 +940,29 @@ int chsc_determine_channel_path_desc(struct chp_id chpid, int fmt, int rfmt,
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(chsc_determine_channel_path_desc);
|
||||
|
||||
int chsc_determine_base_channel_path_desc(struct chp_id chpid,
|
||||
struct channel_path_desc *desc)
|
||||
{
|
||||
struct chsc_scpd *scpd_area;
|
||||
unsigned long flags;
|
||||
int ret;
|
||||
|
||||
spin_lock_irqsave(&chsc_page_lock, flags);
|
||||
scpd_area = chsc_page;
|
||||
ret = chsc_determine_channel_path_desc(chpid, 0, 0, 0, 0, scpd_area);
|
||||
if (ret)
|
||||
goto out;
|
||||
|
||||
memcpy(desc, scpd_area->data, sizeof(*desc));
|
||||
out:
|
||||
spin_unlock_irqrestore(&chsc_page_lock, flags);
|
||||
return ret;
|
||||
#define chsc_det_chp_desc(FMT, c) \
|
||||
int chsc_determine_fmt##FMT##_channel_path_desc( \
|
||||
struct chp_id chpid, struct channel_path_desc_fmt##FMT *desc) \
|
||||
{ \
|
||||
struct chsc_scpd *scpd_area; \
|
||||
unsigned long flags; \
|
||||
int ret; \
|
||||
\
|
||||
spin_lock_irqsave(&chsc_page_lock, flags); \
|
||||
scpd_area = chsc_page; \
|
||||
ret = chsc_determine_channel_path_desc(chpid, 0, FMT, c, 0, \
|
||||
scpd_area); \
|
||||
if (ret) \
|
||||
goto out; \
|
||||
\
|
||||
memcpy(desc, scpd_area->data, sizeof(*desc)); \
|
||||
out: \
|
||||
spin_unlock_irqrestore(&chsc_page_lock, flags); \
|
||||
return ret; \
|
||||
}
|
||||
|
||||
int chsc_determine_fmt1_channel_path_desc(struct chp_id chpid,
|
||||
struct channel_path_desc_fmt1 *desc)
|
||||
{
|
||||
struct chsc_scpd *scpd_area;
|
||||
unsigned long flags;
|
||||
int ret;
|
||||
|
||||
spin_lock_irqsave(&chsc_page_lock, flags);
|
||||
scpd_area = chsc_page;
|
||||
ret = chsc_determine_channel_path_desc(chpid, 0, 1, 1, 0, scpd_area);
|
||||
if (ret)
|
||||
goto out;
|
||||
|
||||
memcpy(desc, scpd_area->data, sizeof(*desc));
|
||||
out:
|
||||
spin_unlock_irqrestore(&chsc_page_lock, flags);
|
||||
return ret;
|
||||
}
|
||||
chsc_det_chp_desc(0, 0)
|
||||
chsc_det_chp_desc(1, 1)
|
||||
|
||||
static void
|
||||
chsc_initialize_cmg_chars(struct channel_path *chp, u8 cmcv,
|
||||
|
@ -147,8 +147,8 @@ int __chsc_do_secm(struct channel_subsystem *css, int enable);
|
||||
int chsc_chp_vary(struct chp_id chpid, int on);
|
||||
int chsc_determine_channel_path_desc(struct chp_id chpid, int fmt, int rfmt,
|
||||
int c, int m, void *page);
|
||||
int chsc_determine_base_channel_path_desc(struct chp_id chpid,
|
||||
struct channel_path_desc *desc);
|
||||
int chsc_determine_fmt0_channel_path_desc(struct chp_id chpid,
|
||||
struct channel_path_desc_fmt0 *desc);
|
||||
int chsc_determine_fmt1_channel_path_desc(struct chp_id chpid,
|
||||
struct channel_path_desc_fmt1 *desc);
|
||||
void chsc_chp_online(struct chp_id chpid);
|
||||
|
@ -460,8 +460,8 @@ __u8 ccw_device_get_path_mask(struct ccw_device *cdev)
|
||||
* On success return a newly allocated copy of the channel-path description
|
||||
* data associated with the given channel path. Return %NULL on error.
|
||||
*/
|
||||
struct channel_path_desc *ccw_device_get_chp_desc(struct ccw_device *cdev,
|
||||
int chp_idx)
|
||||
struct channel_path_desc_fmt0 *ccw_device_get_chp_desc(struct ccw_device *cdev,
|
||||
int chp_idx)
|
||||
{
|
||||
struct subchannel *sch;
|
||||
struct chp_id chpid;
|
||||
|
@ -1361,7 +1361,7 @@ static void qeth_set_multiple_write_queues(struct qeth_card *card)
|
||||
static void qeth_update_from_chp_desc(struct qeth_card *card)
|
||||
{
|
||||
struct ccw_device *ccwdev;
|
||||
struct channel_path_desc *chp_dsc;
|
||||
struct channel_path_desc_fmt0 *chp_dsc;
|
||||
|
||||
QETH_DBF_TEXT(SETUP, 2, "chp_desc");
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user