18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci * Copyright IBM Corp. 2020
48c2ecf20Sopenharmony_ci *
58c2ecf20Sopenharmony_ci * Author(s): Alexandra Winter <wintera@linux.ibm.com>
68c2ecf20Sopenharmony_ci *
78c2ecf20Sopenharmony_ci * Interface for Channel Subsystem Call
88c2ecf20Sopenharmony_ci */
98c2ecf20Sopenharmony_ci#ifndef _ASM_S390_CHSC_H
108c2ecf20Sopenharmony_ci#define _ASM_S390_CHSC_H
118c2ecf20Sopenharmony_ci
128c2ecf20Sopenharmony_ci#include <uapi/asm/chsc.h>
138c2ecf20Sopenharmony_ci
148c2ecf20Sopenharmony_ci/**
158c2ecf20Sopenharmony_ci * Operation codes for CHSC PNSO:
168c2ecf20Sopenharmony_ci *    PNSO_OC_NET_BRIDGE_INFO - only addresses that are visible to a bridgeport
178c2ecf20Sopenharmony_ci *    PNSO_OC_NET_ADDR_INFO   - all addresses
188c2ecf20Sopenharmony_ci */
198c2ecf20Sopenharmony_ci#define PNSO_OC_NET_BRIDGE_INFO		0
208c2ecf20Sopenharmony_ci#define PNSO_OC_NET_ADDR_INFO		3
218c2ecf20Sopenharmony_ci/**
228c2ecf20Sopenharmony_ci * struct chsc_pnso_naid_l2 - network address information descriptor
238c2ecf20Sopenharmony_ci * @nit:  Network interface token
248c2ecf20Sopenharmony_ci * @addr_lnid: network address and logical network id (VLAN ID)
258c2ecf20Sopenharmony_ci */
268c2ecf20Sopenharmony_cistruct chsc_pnso_naid_l2 {
278c2ecf20Sopenharmony_ci	u64 nit;
288c2ecf20Sopenharmony_ci	struct { u8 mac[6]; u16 lnid; } addr_lnid;
298c2ecf20Sopenharmony_ci} __packed;
308c2ecf20Sopenharmony_ci
318c2ecf20Sopenharmony_cistruct chsc_pnso_resume_token {
328c2ecf20Sopenharmony_ci	u64 t1;
338c2ecf20Sopenharmony_ci	u64 t2;
348c2ecf20Sopenharmony_ci} __packed;
358c2ecf20Sopenharmony_ci
368c2ecf20Sopenharmony_cistruct chsc_pnso_naihdr {
378c2ecf20Sopenharmony_ci	struct chsc_pnso_resume_token resume_token;
388c2ecf20Sopenharmony_ci	u32:32;
398c2ecf20Sopenharmony_ci	u32 instance;
408c2ecf20Sopenharmony_ci	u32:24;
418c2ecf20Sopenharmony_ci	u8 naids;
428c2ecf20Sopenharmony_ci	u32 reserved[3];
438c2ecf20Sopenharmony_ci} __packed;
448c2ecf20Sopenharmony_ci
458c2ecf20Sopenharmony_cistruct chsc_pnso_area {
468c2ecf20Sopenharmony_ci	struct chsc_header request;
478c2ecf20Sopenharmony_ci	u8:2;
488c2ecf20Sopenharmony_ci	u8 m:1;
498c2ecf20Sopenharmony_ci	u8:5;
508c2ecf20Sopenharmony_ci	u8:2;
518c2ecf20Sopenharmony_ci	u8 ssid:2;
528c2ecf20Sopenharmony_ci	u8 fmt:4;
538c2ecf20Sopenharmony_ci	u16 sch;
548c2ecf20Sopenharmony_ci	u8:8;
558c2ecf20Sopenharmony_ci	u8 cssid;
568c2ecf20Sopenharmony_ci	u16:16;
578c2ecf20Sopenharmony_ci	u8 oc;
588c2ecf20Sopenharmony_ci	u32:24;
598c2ecf20Sopenharmony_ci	struct chsc_pnso_resume_token resume_token;
608c2ecf20Sopenharmony_ci	u32 n:1;
618c2ecf20Sopenharmony_ci	u32:31;
628c2ecf20Sopenharmony_ci	u32 reserved[3];
638c2ecf20Sopenharmony_ci	struct chsc_header response;
648c2ecf20Sopenharmony_ci	u32:32;
658c2ecf20Sopenharmony_ci	struct chsc_pnso_naihdr naihdr;
668c2ecf20Sopenharmony_ci	struct chsc_pnso_naid_l2 entries[0];
678c2ecf20Sopenharmony_ci} __packed __aligned(PAGE_SIZE);
688c2ecf20Sopenharmony_ci
698c2ecf20Sopenharmony_ci#endif /* _ASM_S390_CHSC_H */
70