리눅스 드라이버 질문 입니다. Virtual Serial Port 관련 문의

lchy0113의 이미지

------------------┌────────────┐ 외부 디바이스
------------------│SPI Device...........│
------------------└────────────┘
------------------------↕
------------------┌────────────┐ 보드
------------------│Dev/spidev.........│ 리눅스
------------------│ 장치파일..............│
------------------└────────────┘
예)---------------↕--------------↕---------------↕
┌───────────┐┌───────────┐┌───────────┐
│dev/spitty0.......││dev/spitty1.......││dev/spitty2.......│
└───────────┘└───────────┘└───────────┘
-----------------↕--------------↕---------------↕
┌───────────┐┌───────────┐┌───────────┐
│App0.................││App1................││App2.................│
└───────────┘└───────────┘└───────────┘

먼저 구현하고자 하는 구조는 위와 같은 구조 입니다. 외부 디바이스와 보드의 통신은 SPI 입니다.
현재 개발보드는 spidev 장치파일을 통해서 SPI 통신이 되고 있습니다.

다수의 앱들은 spidev 장치 파일을 통해 외부 디바이스와 수시로 통신을 진행해야 하는데, App들과 spidev장치로만 구성하고자 하니 App0이 통신을 하는경우 다른 App1~2는 spidev에 접근이 되지 않는 문제가 발생할 것 같습니다.
그래서 위 그림과 같이 spitty0~2 가상의 디바이스 파일을 만든 후, spidev 장치파일이 통신 데이터를 분석하여 spitty0~2에게 전달 또는 전송받도록 제어하는 구상을 하였습니다.

현재 'Virtual Serial Port' 키워드로 검색을 하며 구글링을 하고 있는데, 다른 고수님들의 의견 또는 도움, 정보들을 받기위해 글을 남기게 되었습니다. 감사합니다.

furmuwon의 이미지

먼저 드는 의문은 위와 같이 구상하실 때
spitty[N] <-> spidev fops 와 호출은 어떻게 하실려고 하시는지요?

만약 저라면...
a)
spi master를 직접 호출하는 slave spi device driver를 제작함과 동시에 misc driver를 등록하여
멀티 operation이 가능한 driver를 제작한다.
(이미 그렇게 구현 되어 있을 수도 있겠네요. 문제가 발생할 `것` 같다고 하신거는 해보지 않으셨다는 의미같은데...)

b)
userspace 모두 구현한다.
spi(slave) service(daemon) 만들고 spi(slave) client 만들어서
service는 spidev와 통신해 기기의 값을 저장해 놓고 client들은(app) service에게 값을 요청하는 방식으로...

자기에게 익숙한 레이어에서 구현하면 좋을 듯하네요...

아 추가적으로 a로 구현하면 GPL,
b 라면 귀사의 라이센스 이겠군요....

lchy0113의 이미지

먼저 furmuwon 님 신경써주시고 좋은 댓글 남겨 주셔서 너무 감사합니다.
아직 진행된 상태는 없으며, 진행하려고 정보 수집을 해보니 막막해서 질문하게되었습니다. ^^
날씨 추운데 감기 조심하세요^^

댓글 달기

Filtered HTML

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

BBCode

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param>
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

Textile

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • You can use Textile markup to format text.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Markdown

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • Quick Tips:
    • Two or more spaces at a line's end = Line break
    • Double returns = Paragraph
    • *Single asterisks* or _single underscores_ = Emphasis
    • **Double** or __double__ = Strong
    • This is [a link](http://the.link.example.com "The optional title text")
    For complete details on the Markdown syntax, see the Markdown documentation and Markdown Extra documentation for tables, footnotes, and more.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Plain text

  • HTML 태그를 사용할 수 없습니다.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 줄과 단락은 자동으로 분리됩니다.
댓글 첨부 파일
이 댓글에 이미지나 파일을 업로드 합니다.
파일 크기는 8 MB보다 작아야 합니다.
허용할 파일 형식: txt pdf doc xls gif jpg jpeg mp3 png rar zip.
CAPTCHA
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.